diff --git a/DEPS b/DEPS index 85937c6..63f6f49 100644 --- a/DEPS +++ b/DEPS
@@ -40,7 +40,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '578f064a60b63ddfb00831e9e59a47060bfcefe0', + 'skia_revision': 'e4259e2224a9bf3aa2229cc14f5e08c1cbeeb8c8', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -64,7 +64,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': '717a4fc857d66017cecc4c8f8285713135b9dc68', + 'pdfium_revision': '9162ff85c323b05e3280b319a388934e871e4aea', # 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. @@ -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': '90835c8a63dee2c4d38c223acc2a58e54574e333', + 'catapult_revision': 'e795f2d31cee595e9496e5056283190b58b2d612', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -124,7 +124,7 @@ deps = { 'src/breakpad/src': - Var('chromium_git') + '/breakpad/breakpad/src.git' + '@' + '37070c5e680f3356f7b14d239518a104edbc2c97', + Var('chromium_git') + '/breakpad/breakpad/src.git' + '@' + 'eaedc4571ccc7438955c084b8923dcf9e852bd47', 'src/buildtools': Var('chromium_git') + '/chromium/buildtools.git' + '@' + Var('buildtools_revision'), @@ -202,7 +202,7 @@ Var('chromium_git') + '/external/selenium/py.git' + '@' + '5fd78261a75fe08d27ca4835fb6c5ce4b42275bd', 'src/third_party/libvpx/source/libvpx': - Var('chromium_git') + '/webm/libvpx.git' + '@' + '4d4231352c8cefdae2e76b7bad4286ec21747c89', + Var('chromium_git') + '/webm/libvpx.git' + '@' + '8121f85473b28183c93fdcef290ed6f74b0b52db', 'src/third_party/ffmpeg': Var('chromium_git') + '/chromium/third_party/ffmpeg.git' + '@' + '3f3ad2ea90df08f5907bd997e1ce22e1c19ce215', @@ -232,7 +232,7 @@ Var('chromium_git') + '/native_client/src/third_party/scons-2.0.1.git' + '@' + '1c1550e17fc26355d08627fbdec13d8291227067', 'src/third_party/webrtc': - Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + 'b369f97c44d3c4c6e33843c2db0698c80fd929c9', # commit position 16867 + Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + 'd66ea106e37dd2428cfc117821a95ee1eff92f23', # commit position 16876 'src/third_party/openmax_dl': Var('chromium_git') + '/external/webrtc/deps/third_party/openmax.git' + '@' + Var('openmax_dl_revision'),
diff --git a/android_webview/tools/automated_ui_tests/javatests/src/org/chromium/webview_ui_test/test/ActionModeTest.java b/android_webview/tools/automated_ui_tests/javatests/src/org/chromium/webview_ui_test/test/ActionModeTest.java index ffbcca9..b9d58e1a 100644 --- a/android_webview/tools/automated_ui_tests/javatests/src/org/chromium/webview_ui_test/test/ActionModeTest.java +++ b/android_webview/tools/automated_ui_tests/javatests/src/org/chromium/webview_ui_test/test/ActionModeTest.java
@@ -41,17 +41,16 @@ import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; +import android.animation.ValueAnimator; import android.app.Activity; import android.app.Instrumentation; import android.content.Intent; import android.os.Build; import android.support.test.InstrumentationRegistry; -import android.support.test.espresso.Espresso; -import android.support.test.espresso.IdlingResource; -import android.support.test.espresso.IdlingResource.ResourceCallback; import android.support.test.espresso.NoMatchingViewException; import android.support.test.espresso.PerformException; import android.support.test.espresso.Root; +import android.support.test.espresso.ViewAction; import android.support.test.espresso.action.GeneralClickAction; import android.support.test.espresso.action.GeneralLocation; import android.support.test.espresso.action.Press; @@ -69,18 +68,20 @@ import org.hamcrest.Description; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; -import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; +import org.chromium.base.Log; import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.webview_ui_test.R; import org.chromium.webview_ui_test.WebViewUiTestActivity; import org.chromium.webview_ui_test.test.util.UseLayout; import org.chromium.webview_ui_test.test.util.WebViewUiTestRule; +import java.lang.reflect.Method; + /** * Tests for WebView ActionMode. */ @@ -104,8 +105,6 @@ public WebViewUiTestRule mWebViewActivityRule = new WebViewUiTestRule(WebViewUiTestActivity.class); - private ActionBarIdlingResource mActionBarIdlingResource; - @Before public void setUp() { mWebViewActivityRule.launchActivity(); @@ -115,13 +114,21 @@ onWebView(withId(R.id.webview)) .withElement(findElement(Locator.TAG_NAME, "p")) .check(webMatches(getText(), containsString("Hello world"))); - mActionBarIdlingResource = new ActionBarIdlingResource(); - Espresso.registerIdlingResources(mActionBarIdlingResource); + disableAnimation(); } - @After - public void tearDown() { - Espresso.unregisterIdlingResources(mActionBarIdlingResource); + /** + * Only way to disable popup animations. + */ + private void disableAnimation() { + try { + // This is a hidden method to disable animations. It is also being used by CTS tests. + Method setDurationScale = ValueAnimator.class.getMethod( + "setDurationScale", float.class); + setDurationScale.invoke(null, 0.0f); + } catch (Exception e) { + Log.e(TAG, "Couldn't disable animation", e); + } } /** @@ -131,9 +138,9 @@ @SmallTest @UseLayout("edittext_webview") public void testCopyPaste() { - longClickOnLastWord(R.id.webview); + onView(withId(R.id.webview)).perform(longClickOnLastWord()); clickPopupAction(COPY_ACTION); - longClickOnLastWord(R.id.edittext); + onView(withId(R.id.edittext)).perform(longClickOnLastWord()); clickPopupAction(PASTE_ACTION); onView(withId(R.id.edittext)) .check(matches(withText("world"))); @@ -146,10 +153,10 @@ @SmallTest @UseLayout("edittext_webview") public void testSelectAll() { - longClickOnLastWord(R.id.webview); + onView(withId(R.id.webview)).perform(longClickOnLastWord()); clickPopupAction("Select all"); clickPopupAction(COPY_ACTION); - longClickOnLastWord(R.id.edittext); + onView(withId(R.id.edittext)).perform(longClickOnLastWord()); clickPopupAction(PASTE_ACTION); onView(withId(R.id.edittext)) .check(matches(withText("Hello world"))); @@ -166,7 +173,7 @@ intending(anyIntent()) .respondWith(new Instrumentation.ActivityResult(Activity.RESULT_OK, new Intent())); - longClickOnLastWord(R.id.webview); + onView(withId(R.id.webview)).perform(longClickOnLastWord()); clickPopupAction(SHARE_ACTION); intended(allOf(hasAction(Intent.ACTION_CHOOSER), @@ -187,7 +194,7 @@ Intents.init(); intending(anyIntent()) .respondWith(new Instrumentation.ActivityResult(Activity.RESULT_OK, new Intent())); - longClickOnLastWord(R.id.webview); + onView(withId(R.id.webview)).perform(longClickOnLastWord()); clickPopupAction(WEB_SEARCH_ACTION); intended(allOf(hasAction(Intent.ACTION_WEB_SEARCH), hasExtras(allOf(hasEntry("com.android.browser.application_id", @@ -206,7 +213,7 @@ public void testAssist() { // TODO(aluo): Get SdkSuppress to work with the test runner if (Build.VERSION.SDK_INT < 24) return; - longClickOnLastWord(R.id.webview); + onView(withId(R.id.webview)).perform(longClickOnLastWord()); clickPopupAction(ASSIST_ACTION); UiDevice device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); UiObject assistUi = device.findObject(new UiSelector().packageName(QUICK_SEARCH_BOX_PKG)); @@ -223,7 +230,7 @@ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { try { // On L and lower, use the espresso DEFAULT root matcher if ActionBar is detected - onView(withClassName(endsWith("ActionBarContextView"))) + onView(withClassName(endsWith("widget.ActionBarContextView"))) .check(matches(isDisplayed())); rootMatcher = DEFAULT; } catch (NoMatchingViewException | AssertionFailedError e) { @@ -234,30 +241,27 @@ // On M and above, can use the decoreView matcher rootMatcher = withDecorView(isEnabled()); } - try { onView(anyOf(withText(name), withContentDescription(name))) .inRoot(rootMatcher) .perform(click()); - } catch (PerformException | NoMatchingViewException e) { + } catch (PerformException e) { // Take care of case when the item is in the overflow menu onView(withContentDescription(MORE_OPTIONS_ACTION)) - .inRoot(rootMatcher) + .inRoot(withDecorView(isEnabled())) .perform(click()); onData(new MenuItemMatcher(equalTo(name))).inRoot(rootMatcher).perform(click()); } } /** - * Perform a view action that clicks on the last word and start the idling resource - * to wait for completion of the popup menu + * This view action clicks on center right of a view to select the last word */ - private final void longClickOnLastWord(int viewId) { + private static final ViewAction longClickOnLastWord() { // TODO(aluo): This function is not guaranteed to click on element. Change to // implementation that gets bounding box for elements using Javascript. - onView(withId(viewId)).perform(actionWithAssertions( - new GeneralClickAction(Tap.LONG, GeneralLocation.CENTER_RIGHT, Press.FINGER))); - mActionBarIdlingResource.start(); + return actionWithAssertions( + new GeneralClickAction(Tap.LONG, GeneralLocation.CENTER_RIGHT, Press.FINGER)); } /** @@ -281,38 +285,4 @@ description.appendDescriptionOf(mTitleMatcher); } } - - private class ActionBarIdlingResource implements IdlingResource { - private boolean mActionStarting; - private ResourceCallback mResourceCallback; - - ActionBarIdlingResource() { - mActionStarting = false; - mResourceCallback = null; - } - - @Override - public String getName() { - return "ActionBarIdlingResource"; - } - - @Override - public boolean isIdleNow() { - if (!mActionStarting) return true; - if (mWebViewActivityRule.isActionBarDisplayed()) { - mActionStarting = false; - if (mResourceCallback != null) mResourceCallback.onTransitionToIdle(); - } - return !mActionStarting; - } - - @Override - public void registerIdleTransitionCallback(ResourceCallback callback) { - mResourceCallback = callback; - } - - public void start() { - mActionStarting = true; - } - } }
diff --git a/android_webview/tools/automated_ui_tests/javatests/src/org/chromium/webview_ui_test/test/util/WebViewUiTestRule.java b/android_webview/tools/automated_ui_tests/javatests/src/org/chromium/webview_ui_test/test/util/WebViewUiTestRule.java index c3e6a72..d60a16bd 100644 --- a/android_webview/tools/automated_ui_tests/javatests/src/org/chromium/webview_ui_test/test/util/WebViewUiTestRule.java +++ b/android_webview/tools/automated_ui_tests/javatests/src/org/chromium/webview_ui_test/test/util/WebViewUiTestRule.java
@@ -4,21 +4,7 @@ package org.chromium.webview_ui_test.test.util; -import static android.support.test.espresso.matcher.RootMatchers.withDecorView; -import static android.support.test.espresso.matcher.ViewMatchers.hasDescendant; -import static android.support.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed; -import static android.support.test.espresso.matcher.ViewMatchers.withChild; -import static android.support.test.espresso.matcher.ViewMatchers.withClassName; -import static android.support.test.espresso.matcher.ViewMatchers.withText; - -import static org.hamcrest.CoreMatchers.allOf; -import static org.hamcrest.Matchers.endsWith; -import static org.hamcrest.Matchers.hasItem; - import android.content.Intent; -import android.os.Build; -import android.support.test.espresso.BaseLayerComponent; -import android.support.test.espresso.DaggerBaseLayerComponent; import android.support.test.rule.ActivityTestRule; import android.webkit.WebView; @@ -39,7 +25,6 @@ private WebViewSyncWrapper mSyncWrapper; private String mLayout; - private BaseLayerComponent mBaseLayerComponent; public WebViewUiTestRule(Class<WebViewUiTestActivity> activityClass) { super(activityClass); @@ -96,35 +81,4 @@ Assert.fail(e.getMessage()); } } - - public boolean isActionBarDisplayed() { - if (mBaseLayerComponent == null) mBaseLayerComponent = DaggerBaseLayerComponent.create(); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - // For M and above - if (hasItem(withDecorView(withChild(allOf( - withClassName(endsWith("PopupBackgroundView")), - isCompletelyDisplayed())))).matches( - mBaseLayerComponent.activeRootLister().listActiveRoots())) { - return true; - } - } else { - // For L - if (hasItem(withDecorView(hasDescendant(allOf( - withClassName(endsWith("ActionMenuItemView")), - isCompletelyDisplayed())))).matches( - mBaseLayerComponent.activeRootLister().listActiveRoots())) { - return true; - } - - // Paste option is a popup on L - if (hasItem(withDecorView(withChild(withText("Paste")))).matches( - mBaseLayerComponent.activeRootLister().listActiveRoots())) { - return true; - } - } - - - return false; - } }
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 711c8ec..d021615 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -1218,6 +1218,23 @@ "laser/laser_pointer_controller_unittest.cc", "laser/laser_pointer_points_unittest.cc", "laser/laser_segment_utils_unittest.cc", + "metrics/desktop_task_switch_metric_recorder_unittest.cc", + "metrics/task_switch_metrics_recorder_unittest.cc", + "metrics/task_switch_time_tracker_unittest.cc", + "metrics/user_metrics_recorder_unittest.cc", + "root_window_controller_unittest.cc", + "rotator/screen_rotation_animation_unittest.cc", + "screen_util_unittest.cc", + "shelf/shelf_layout_manager_unittest.cc", + "shelf/shelf_unittest.cc", + "shelf/shelf_view_unittest.cc", + "shelf/shelf_widget_unittest.cc", + "shell_unittest.cc", + "sticky_keys/sticky_keys_overlay_unittest.cc", + "sticky_keys/sticky_keys_unittest.cc", + "system/chromeos/power/power_event_observer_unittest.cc", + "system/chromeos/power/tablet_power_button_controller_unittest.cc", + "system/chromeos/power/video_activity_notifier_unittest.cc", ] deps = [ "//ash", @@ -1302,25 +1319,12 @@ # Specific to X11. "host/ash_window_tree_host_x11_unittest.cc", + + # TODO: magnifier not supported in mash. http://crbug.com/647438. "magnifier/magnification_controller_unittest.cc", "magnifier/partial_magnification_controller_unittest.cc", - "metrics/desktop_task_switch_metric_recorder_unittest.cc", - "metrics/task_switch_metrics_recorder_unittest.cc", - "metrics/task_switch_time_tracker_unittest.cc", - "metrics/user_metrics_recorder_unittest.cc", - "root_window_controller_unittest.cc", - "rotator/screen_rotation_animation_unittest.cc", - "screen_util_unittest.cc", - "shelf/shelf_layout_manager_unittest.cc", - "shelf/shelf_unittest.cc", - "shelf/shelf_view_unittest.cc", - "shelf/shelf_widget_unittest.cc", - "shell_unittest.cc", - "sticky_keys/sticky_keys_overlay_unittest.cc", - "sticky_keys/sticky_keys_unittest.cc", - "system/chromeos/power/power_event_observer_unittest.cc", - "system/chromeos/power/tablet_power_button_controller_unittest.cc", - "system/chromeos/power/video_activity_notifier_unittest.cc", + + # TODO: investigate failure in mash, http://crbug.com/695887. "system/chromeos/rotation/tray_rotation_lock_unittest.cc", "system/chromeos/screen_layout_observer_unittest.cc", "system/overview/overview_button_tray_unittest.cc",
diff --git a/ash/common/ash_constants.cc b/ash/common/ash_constants.cc index d562a0db..0d0a5a9 100644 --- a/ash/common/ash_constants.cc +++ b/ash/common/ash_constants.cc
@@ -17,7 +17,7 @@ const SkColor kChromeOsBootColor = SkColorSetRGB(0xfe, 0xfe, 0xfe); const SkColor kFocusBorderColor = SkColorSetA(gfx::kGoogleBlue500, 0x99); -const float kFocusBorderThickness = 2.f; +const int kFocusBorderThickness = 2; const int kDefaultLargeCursorSize = 64;
diff --git a/ash/common/ash_constants.h b/ash/common/ash_constants.h index 66ce6d0..cf32eb1 100644 --- a/ash/common/ash_constants.h +++ b/ash/common/ash_constants.h
@@ -28,7 +28,7 @@ // The border color of keyboard focus for launcher items and system tray. extern const SkColor kFocusBorderColor; -extern const float kFocusBorderThickness; +extern const int kFocusBorderThickness; ASH_EXPORT extern const int kDefaultLargeCursorSize;
diff --git a/ash/common/system/chromeos/audio/tray_audio_delegate.h b/ash/common/system/chromeos/audio/tray_audio_delegate.h index 4d5e343..39d4b2a 100644 --- a/ash/common/system/chromeos/audio/tray_audio_delegate.h +++ b/ash/common/system/chromeos/audio/tray_audio_delegate.h
@@ -30,11 +30,6 @@ // should be muted. virtual int GetOutputDefaultVolumeMuteLevel() = 0; - // Gets the non-MD icon to use for the active output device. - // TODO(mohsen): Remove this once material design is enabled by default. See - // https://crbug.com/614453. - virtual int GetActiveOutputDeviceIconId() = 0; - // Gets the MD icon to use for the active output device. virtual const gfx::VectorIcon& GetActiveOutputDeviceVectorIcon() = 0;
diff --git a/ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.cc b/ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.cc index 0ca538d..dfe5def 100644 --- a/ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.cc +++ b/ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.cc
@@ -4,7 +4,6 @@ #include "ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.h" -#include "ash/resources/grit/ash_resources.h" #include "ash/resources/vector_icons/vector_icons.h" #include "chromeos/audio/cras_audio_handler.h" #include "ui/gfx/paint_vector_icon.h" @@ -26,23 +25,6 @@ return CrasAudioHandler::Get()->GetOutputVolumePercent(); } -int TrayAudioDelegateChromeOs::GetActiveOutputDeviceIconId() { - chromeos::AudioDevice device; - if (!CrasAudioHandler::Get()->GetPrimaryActiveOutputDevice(&device)) - return kNoAudioDeviceIcon; - - if (device.type == chromeos::AUDIO_TYPE_HEADPHONE) - return IDR_AURA_UBER_TRAY_AUDIO_HEADPHONE; - else if (device.type == chromeos::AUDIO_TYPE_USB) - return IDR_AURA_UBER_TRAY_AUDIO_USB; - else if (device.type == chromeos::AUDIO_TYPE_BLUETOOTH) - return IDR_AURA_UBER_TRAY_AUDIO_BLUETOOTH; - else if (device.type == chromeos::AUDIO_TYPE_HDMI) - return IDR_AURA_UBER_TRAY_AUDIO_HDMI; - else - return kNoAudioDeviceIcon; -} - const gfx::VectorIcon& TrayAudioDelegateChromeOs::GetActiveOutputDeviceVectorIcon() { chromeos::AudioDevice device;
diff --git a/ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.h b/ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.h index 03b272b..df82e3b7 100644 --- a/ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.h +++ b/ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.h
@@ -19,7 +19,6 @@ void AdjustOutputVolumeToAudibleLevel() override; int GetOutputDefaultVolumeMuteLevel() override; int GetOutputVolumeLevel() override; - int GetActiveOutputDeviceIconId() override; const gfx::VectorIcon& GetActiveOutputDeviceVectorIcon() override; bool HasAlternativeSources() override; bool IsOutputAudioMuted() override;
diff --git a/ash/common/system/chromeos/audio/volume_view.cc b/ash/common/system/chromeos/audio/volume_view.cc index 571b5bf9..ddb9ec7 100644 --- a/ash/common/system/chromeos/audio/volume_view.cc +++ b/ash/common/system/chromeos/audio/volume_view.cc
@@ -6,7 +6,6 @@ #include <algorithm> -#include "ash/common/material_design/material_design_controller.h" #include "ash/common/metrics/user_metrics_action.h" #include "ash/common/strings/grit/ash_strings.h" #include "ash/common/system/chromeos/audio/tray_audio_delegate.h" @@ -17,35 +16,19 @@ #include "ash/common/system/tray/tray_popup_utils.h" #include "ash/common/system/tray/tri_view.h" #include "ash/common/wm_shell.h" -#include "ash/resources/grit/ash_resources.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ui/accessibility/ax_node_data.h" -#include "ui/base/resource/resource_bundle.h" -#include "ui/events/keycodes/keyboard_codes.h" -#include "ui/gfx/image/image_skia_operations.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/vector_icon_types.h" #include "ui/views/background.h" #include "ui/views/border.h" #include "ui/views/controls/button/custom_button.h" #include "ui/views/controls/image_view.h" -#include "ui/views/controls/separator.h" #include "ui/views/controls/slider.h" -#include "ui/views/focus/focus_manager.h" -#include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" namespace { -const int kVolumeImageWidth = 25; -const int kVolumeImageHeight = 25; -const int kSeparatorSize = 3; -const int kSeparatorVerticalInset = 8; -const int kBoxLayoutPadding = 2; - -// IDR_AURA_UBER_TRAY_VOLUME_LEVELS contains 5 images, -// The one for mute is at the 0 index and the other -// four are used for ascending volume levels. -const int kVolumeLevels = 4; const gfx::VectorIcon* const kVolumeLevelIcons[] = { &ash::kSystemMenuVolumeMuteIcon, // Muted. @@ -72,10 +55,8 @@ image_(TrayPopupUtils::CreateMainImageView()), image_index_(-1) { TrayPopupUtils::ConfigureContainer(TriView::Container::START, this); - SetFocusBehavior(FocusBehavior::ALWAYS); AddChildView(image_); - if (MaterialDesignController::IsSystemTrayMenuMaterial()) - SetInkDropMode(InkDropMode::ON); + SetInkDropMode(InkDropMode::ON); Update(); set_notify_enter_exit_on_child(true); @@ -86,57 +67,29 @@ void Update() { float level = static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f; - int volume_levels = MaterialDesignController::IsSystemTrayMenuMaterial() - ? arraysize(kVolumeLevelIcons) - 1 - : kVolumeLevels; + int volume_levels = arraysize(kVolumeLevelIcons) - 1; int image_index = audio_delegate_->IsOutputAudioMuted() ? 0 : (level == 1.0 ? volume_levels : std::max(1, static_cast<int>(std::ceil( level * (volume_levels - 1))))); - if (image_index != image_index_) { - gfx::ImageSkia image_skia; - if (MaterialDesignController::IsSystemTrayMenuMaterial()) { - image_skia = gfx::CreateVectorIcon(*kVolumeLevelIcons[image_index], - kMenuIconColor); - } else { - gfx::Rect region(0, image_index * kVolumeImageHeight, kVolumeImageWidth, - kVolumeImageHeight); - gfx::Image image = - ui::ResourceBundle::GetSharedInstance().GetImageNamed( - IDR_AURA_UBER_TRAY_VOLUME_LEVELS); - image_skia = gfx::ImageSkiaOperations::ExtractSubset( - *(image.ToImageSkia()), region); - } - image_->SetImage(&image_skia); - image_index_ = image_index; - } + gfx::ImageSkia image_skia = + gfx::CreateVectorIcon(*kVolumeLevelIcons[image_index], kMenuIconColor); + image_->SetImage(&image_skia); + image_index_ = image_index; } private: // views::View: void GetAccessibleNodeData(ui::AXNodeData* node_data) override { - ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); node_data->SetName( - bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_VOLUME_MUTE)); + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VOLUME_MUTE)); node_data->role = ui::AX_ROLE_TOGGLE_BUTTON; if (audio_delegate_->IsOutputAudioMuted()) node_data->AddStateFlag(ui::AX_STATE_PRESSED); } - // views::CustomButton: - void StateChanged(ButtonState old_state) override { - if (state() == STATE_HOVERED || state() == STATE_PRESSED) { - if (!MaterialDesignController::IsSystemTrayMenuMaterial()) { - set_background( - views::Background::CreateSolidBackground(kHoverBackgroundColor)); - } - } else { - set_background(nullptr); - } - } - system::TrayAudioDelegate* audio_delegate_; views::ImageView* image_; int image_index_; @@ -153,10 +106,8 @@ more_button_(nullptr), icon_(nullptr), slider_(nullptr), - separator_(nullptr), device_type_(nullptr), is_default_view_(is_default_view) { - SetFocusBehavior(FocusBehavior::NEVER); SetLayoutManager(new views::FillLayout); AddChildView(tri_view_); @@ -167,8 +118,7 @@ slider_->SetValue( static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f); slider_->SetAccessibleName( - ui::ResourceBundle::GetSharedInstance().GetLocalizedString( - IDS_ASH_STATUS_TRAY_VOLUME)); + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VOLUME)); tri_view_->AddView(TriView::Container::CENTER, slider_); set_background(views::Background::CreateSolidBackground(kBackgroundColor)); @@ -182,41 +132,16 @@ more_button_ = new ButtonListenerActionableView( owner_, TrayPopupInkDropStyle::INSET_BOUNDS, this); TrayPopupUtils::ConfigureContainer(TriView::Container::END, more_button_); - more_button_->SetFocusBehavior(FocusBehavior::NEVER); - - device_type_ = TrayPopupUtils::CreateMoreImageView(); + more_button_->SetInkDropMode(views::InkDropHostView::InkDropMode::ON); more_button_->SetBorder(views::CreateEmptyBorder(gfx::Insets( 0, GetTrayConstant(TRAY_POPUP_ITEM_MORE_REGION_HORIZONTAL_INSET)))); + tri_view_->AddView(TriView::Container::END, more_button_); + + device_type_ = TrayPopupUtils::CreateMoreImageView(); + device_type_->SetVisible(false); more_button_->AddChildView(device_type_); - views::ImageView* more_arrow = TrayPopupUtils::CreateMoreImageView(); - if (MaterialDesignController::IsSystemTrayMenuMaterial()) { - more_arrow->SetImage( - gfx::CreateVectorIcon(kSystemMenuArrowRightIcon, kMenuIconColor)); - } else { - more_arrow->SetImage(ui::ResourceBundle::GetSharedInstance() - .GetImageNamed(IDR_AURA_UBER_TRAY_MORE) - .ToImageSkia()); - } - more_button_->AddChildView(more_arrow); - - if (MaterialDesignController::IsSystemTrayMenuMaterial()) { - more_button_->SetInkDropMode(views::InkDropHostView::InkDropMode::ON); - tri_view_->AddView(TriView::Container::END, more_button_); - } else { - separator_ = new views::Separator(); - separator_->SetColor(kButtonStrokeColor); - separator_->SetBorder(views::CreateEmptyBorder(kSeparatorVerticalInset, 0, - kSeparatorVerticalInset, - kBoxLayoutPadding)); - - TrayPopupItemContainer* more_container = - new TrayPopupItemContainer(separator_, true); - more_container->SetLayoutManager( - new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); - more_container->AddChildView(more_button_); - tri_view_->AddView(TriView::Container::END, more_container); - } + more_button_->AddChildView(TrayPopupUtils::CreateMoreImageView()); Update(); } @@ -254,24 +179,11 @@ if (!show_more) return; - bool target_visibility = false; - if (MaterialDesignController::IsSystemTrayMenuMaterial()) { - const gfx::VectorIcon& device_icon = - audio_delegate_->GetActiveOutputDeviceVectorIcon(); - if (!device_icon.is_empty()) { - device_type_->SetImage( - gfx::CreateVectorIcon(device_icon, kMenuIconColor)); - target_visibility = true; - } - } else { - int device_icon = audio_delegate_->GetActiveOutputDeviceIconId(); - if (device_icon != system::TrayAudioDelegate::kNoAudioDeviceIcon) { - device_type_->SetImage(ui::ResourceBundle::GetSharedInstance() - .GetImageNamed(device_icon) - .ToImageSkia()); - target_visibility = true; - } - } + const gfx::VectorIcon& device_icon = + audio_delegate_->GetActiveOutputDeviceVectorIcon(); + const bool target_visibility = !device_icon.is_empty(); + if (target_visibility) + device_type_->SetImage(gfx::CreateVectorIcon(device_icon, kMenuIconColor)); if (device_type_->visible() != target_visibility) { device_type_->SetVisible(target_visibility); device_type_->InvalidateLayout(); @@ -331,23 +243,5 @@ icon_->Update(); } -bool VolumeView::OnKeyPressed(const ui::KeyEvent& event) { - const views::FocusManager* focus_manager = GetFocusManager(); - if (enabled() && is_default_view_ && event.key_code() == ui::VKEY_RETURN && - focus_manager && focus_manager->GetFocusedView() == slider_) { - owner_->TransitionDetailedView(); - return true; - } - return View::OnKeyPressed(event); -} - -void VolumeView::OnBoundsChanged(const gfx::Rect& previous_bounds) { - // Separator's prefered size is based on set bounds. When an empty bounds is - // set on first layout this causes BoxLayout to ignore the separator. Reset - // its height on each bounds change so that it is laid out properly. - if (separator_) - separator_->SetSize(gfx::Size(kSeparatorSize, bounds().height())); -} - } // namespace tray } // namespace ash
diff --git a/ash/common/system/chromeos/audio/volume_view.h b/ash/common/system/chromeos/audio/volume_view.h index 1fe28fc..af164b2 100644 --- a/ash/common/system/chromeos/audio/volume_view.h +++ b/ash/common/system/chromeos/audio/volume_view.h
@@ -13,7 +13,6 @@ namespace views { class CustomButton; class ImageView; -class Separator; class Slider; } @@ -58,10 +57,6 @@ // views::ButtonListener: void ButtonPressed(views::Button* sender, const ui::Event& event) override; - // views::View: - bool OnKeyPressed(const ui::KeyEvent& event) override; - void OnBoundsChanged(const gfx::Rect& previous_bounds) override; - SystemTrayItem* owner_; // The only immediate child view of |this|. All other view elements are added // to the |tri_view_| to handle layout. @@ -70,7 +65,6 @@ views::CustomButton* more_button_; VolumeButton* icon_; views::Slider* slider_; - views::Separator* separator_; // Not used in material design. views::ImageView* device_type_; bool is_default_view_;
diff --git a/ash/common/system/tray/tray_item_more.cc b/ash/common/system/tray/tray_item_more.cc index 7685365..19edec9 100644 --- a/ash/common/system/tray/tray_item_more.cc +++ b/ash/common/system/tray/tray_item_more.cc
@@ -9,11 +9,9 @@ #include "ash/common/system/tray/tray_popup_item_style.h" #include "ash/common/system/tray/tray_popup_utils.h" #include "ash/common/system/tray/tri_view.h" -#include "ash/resources/vector_icons/vector_icons.h" #include "base/memory/ptr_util.h" #include "ui/accessibility/ax_node_data.h" #include "ui/gfx/image/image.h" -#include "ui/gfx/paint_vector_icon.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/fill_layout.h" @@ -29,9 +27,6 @@ AddChildView(tri_view_); SetLayoutManager(new views::FillLayout); - more_->SetImage( - gfx::CreateVectorIcon(kSystemMenuArrowRightIcon, kMenuIconColor)); - tri_view_->AddView(TriView::Container::START, icon_); tri_view_->AddView(TriView::Container::CENTER, label_); tri_view_->AddView(TriView::Container::END, more_);
diff --git a/ash/common/system/tray/tray_popup_utils.cc b/ash/common/system/tray/tray_popup_utils.cc index 8289326..5ac84e2 100644 --- a/ash/common/system/tray/tray_popup_utils.cc +++ b/ash/common/system/tray/tray_popup_utils.cc
@@ -15,8 +15,10 @@ #include "ash/common/system/tray/tray_constants.h" #include "ash/common/system/tray/tray_popup_item_style.h" #include "ash/common/wm_shell.h" +#include "ash/resources/vector_icons/vector_icons.h" #include "base/memory/ptr_util.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/flood_fill_ink_drop_ripple.h" #include "ui/views/animation/ink_drop_highlight.h" #include "ui/views/animation/ink_drop_impl.h" @@ -225,6 +227,8 @@ new FixedSizedImageView(GetTrayConstant(TRAY_POPUP_ITEM_MORE_IMAGE_SIZE), GetTrayConstant(TRAY_POPUP_ITEM_MORE_IMAGE_SIZE)); image->EnableCanvasFlippingForRTLUI(true); + image->SetImage( + gfx::CreateVectorIcon(kSystemMenuArrowRightIcon, kMenuIconColor)); return image; }
diff --git a/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc b/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc index 91e4c18..2dcf49f 100644 --- a/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc +++ b/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/common/wm_shell.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "base/test/user_action_tester.h" @@ -119,6 +120,10 @@ // that a null window was activated last. TEST_F(DesktopTaskSwitchMetricRecorderTest, ActivatePositionableWindowWhenNullWindowWasActivatedLast) { + // TODO: investigate failure in mash, http://crbug.com/695628. + if (WmShell::Get()->IsRunningInMash()) + return; + std::unique_ptr<aura::Window> null_window; std::unique_ptr<aura::Window> positionable_window = CreatePositionableWindow(); @@ -135,6 +140,10 @@ TEST_F( DesktopTaskSwitchMetricRecorderTest, ActivatePositionableWindowWhenADifferentPositionableWindowWasActivatedLast) { + // TODO: investigate failure in mash, http://crbug.com/695628. + if (WmShell::Get()->IsRunningInMash()) + return; + std::unique_ptr<aura::Window> positionable_window_1 = CreatePositionableWindow(); std::unique_ptr<aura::Window> positionable_window_2 = @@ -166,6 +175,10 @@ // a non-positionable window was activated last. TEST_F(DesktopTaskSwitchMetricRecorderTest, ActivatePositionableWindowWhenANonPositionableWindowWasActivatedLast) { + // TODO: investigate failure in mash, http://crbug.com/695628. + if (WmShell::Get()->IsRunningInMash()) + return; + std::unique_ptr<aura::Window> non_positionable_window = CreateNonPositionableWindow(); std::unique_ptr<aura::Window> positionable_window = @@ -307,6 +320,9 @@ // a INPUT_EVENT. TEST_F(DesktopTaskSwitchMetricRecorderWithShellIntegrationTest, ActivatePositionableWindowWithInputEvent) { + // TODO: investigate failure in mash, http://crbug.com/695628. + if (WmShell::Get()->IsRunningInMash()) + return; aura::Window* positionable_window = CreatePositionableWindowInShellWithBounds(gfx::Rect(0, 0, 10, 10));
diff --git a/ash/metrics/user_metrics_recorder_unittest.cc b/ash/metrics/user_metrics_recorder_unittest.cc index c805d75..8351032 100644 --- a/ash/metrics/user_metrics_recorder_unittest.cc +++ b/ash/metrics/user_metrics_recorder_unittest.cc
@@ -187,6 +187,10 @@ // Verify the shelf item counts recorded by the // UserMetricsRecorder::RecordPeriodicMetrics() method. TEST_F(UserMetricsRecorderTest, ValuesRecordedByRecordShelfItemCounts) { + // TODO: investigate failure in mash, http://crbug.com/695629. + if (WmShell::Get()->IsRunningInMash()) + return; + test::TestShelfDelegate* test_shelf_delegate = test::TestShelfDelegate::instance(); SetUserInActiveDesktopEnvironment(true);
diff --git a/ash/resources/ash_resources.grd b/ash/resources/ash_resources.grd index 39588dd..c3b084a 100644 --- a/ash/resources/ash_resources.grd +++ b/ash/resources/ash_resources.grd
@@ -85,7 +85,6 @@ <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_NOTIFICATION_DATASAVER" file="cros/network/notification_datasaver.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_NOTIFICATION_LTE" file="cros/network/notification_lte.png" /> - <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_MORE" file="cros/status/status_more.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_SCREENSHARE" file="cros/status/status_screenshare.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_SCREENSHARE_DARK" file="cros/status/status_screenshare_dark.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_SHUTDOWN" file="cros/status/status_shutdown.png" /> @@ -99,10 +98,6 @@ <structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_BLUETOOTH" file="cros/notification/notification_bluetooth_icon.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_DISPLAY" file="cros/notification/display_notification_icon.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_NOTIFICATION_LOW_POWER_CHARGER" file="cros/notification/notification_low_power_charger.png" /> - <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_AUDIO_BLUETOOTH" file="cros/status/status_audio_device_bluetooth.png" /> - <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_AUDIO_HDMI" file="cros/status/status_audio_device_hdmi.png" /> - <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_AUDIO_HEADPHONE" file="cros/status/status_audio_device_headphones.png" /> - <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_AUDIO_USB" file="cros/status/status_audio_device_usb.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_BRIGHTNESS" file="cros/status/status_brightness.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_BUBBLE_SESSION_LENGTH_LIMIT" file="cros/status/status_session_length_timer.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_CELLULAR_DISABLED" file="cros/network/status_cellular_disabled.png" /> @@ -128,8 +123,6 @@ <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_WIFI_ENABLED_HOVER" file="cros/network/status_wifi_enabled_hover.png" /> </if> - <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_VOLUME_LEVELS" file="cros/status/status_volume_dark.png" /> - <structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_HEADER_SHADE_INACTIVE_BOTTOM" file="common/window_header_shade_bottom_inactive.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_HEADER_SHADE_INACTIVE_LEFT" file="common/window_header_shade_left_inactive.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_HEADER_SHADE_INACTIVE_RIGHT" file="common/window_header_shade_right_inactive.png" />
diff --git a/ash/resources/default_100_percent/cros/status/status_audio_device_bluetooth.png b/ash/resources/default_100_percent/cros/status/status_audio_device_bluetooth.png deleted file mode 100644 index 75ac66a..0000000 --- a/ash/resources/default_100_percent/cros/status/status_audio_device_bluetooth.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_100_percent/cros/status/status_audio_device_hdmi.png b/ash/resources/default_100_percent/cros/status/status_audio_device_hdmi.png deleted file mode 100644 index bb3fd14..0000000 --- a/ash/resources/default_100_percent/cros/status/status_audio_device_hdmi.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_100_percent/cros/status/status_audio_device_headphones.png b/ash/resources/default_100_percent/cros/status/status_audio_device_headphones.png deleted file mode 100644 index 93267c7e..0000000 --- a/ash/resources/default_100_percent/cros/status/status_audio_device_headphones.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_100_percent/cros/status/status_audio_device_usb.png b/ash/resources/default_100_percent/cros/status/status_audio_device_usb.png deleted file mode 100644 index e9c1bfe..0000000 --- a/ash/resources/default_100_percent/cros/status/status_audio_device_usb.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_100_percent/cros/status/status_more.png b/ash/resources/default_100_percent/cros/status/status_more.png deleted file mode 100644 index 41b59950..0000000 --- a/ash/resources/default_100_percent/cros/status/status_more.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_100_percent/cros/status/status_volume_dark.png b/ash/resources/default_100_percent/cros/status/status_volume_dark.png deleted file mode 100644 index 76dc185..0000000 --- a/ash/resources/default_100_percent/cros/status/status_volume_dark.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_200_percent/cros/status/status_audio_device_bluetooth.png b/ash/resources/default_200_percent/cros/status/status_audio_device_bluetooth.png deleted file mode 100644 index 28d36d0d..0000000 --- a/ash/resources/default_200_percent/cros/status/status_audio_device_bluetooth.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_200_percent/cros/status/status_audio_device_hdmi.png b/ash/resources/default_200_percent/cros/status/status_audio_device_hdmi.png deleted file mode 100644 index d6ddc09..0000000 --- a/ash/resources/default_200_percent/cros/status/status_audio_device_hdmi.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_200_percent/cros/status/status_audio_device_headphones.png b/ash/resources/default_200_percent/cros/status/status_audio_device_headphones.png deleted file mode 100644 index 4c0e648..0000000 --- a/ash/resources/default_200_percent/cros/status/status_audio_device_headphones.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_200_percent/cros/status/status_audio_device_usb.png b/ash/resources/default_200_percent/cros/status/status_audio_device_usb.png deleted file mode 100644 index f17edcf..0000000 --- a/ash/resources/default_200_percent/cros/status/status_audio_device_usb.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_200_percent/cros/status/status_more.png b/ash/resources/default_200_percent/cros/status/status_more.png deleted file mode 100644 index e990383..0000000 --- a/ash/resources/default_200_percent/cros/status/status_more.png +++ /dev/null Binary files differ
diff --git a/ash/resources/default_200_percent/cros/status/status_volume_dark.png b/ash/resources/default_200_percent/cros/status/status_volume_dark.png deleted file mode 100644 index b8593a6..0000000 --- a/ash/resources/default_200_percent/cros/status/status_volume_dark.png +++ /dev/null Binary files differ
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc index 56b06555..074b48e 100644 --- a/ash/root_window_controller_unittest.cc +++ b/ash/root_window_controller_unittest.cc
@@ -135,6 +135,10 @@ }; TEST_F(RootWindowControllerTest, MoveWindows_Basic) { + // TODO: triggers shutdown crash in mash. http://crbug.com/695632. + if (WmShell::Get()->IsRunningInMash()) + return; + // Windows origin should be doubled when moved to the 1st display. UpdateDisplay("600x600,300x300"); aura::Window::Windows root_windows = Shell::GetAllRootWindows(); @@ -159,8 +163,7 @@ EXPECT_EQ("550,10 200x200", minimized->GetWindowBoundsInScreen().ToString()); views::Widget* fullscreen = CreateTestWidget(gfx::Rect(850, 10, 200, 200)); - display::Display secondary_display = - Shell::GetInstance()->display_manager()->GetSecondaryDisplay(); + display::Display secondary_display = GetSecondaryDisplay(); gfx::Rect orig_bounds = fullscreen->GetWindowBoundsInScreen(); EXPECT_TRUE(secondary_display.work_area().Intersects(orig_bounds)); EXPECT_FALSE(secondary_display.work_area().Contains(orig_bounds)); @@ -291,6 +294,10 @@ // Make sure lock related windows moves. TEST_F(RootWindowControllerTest, MoveWindows_LockWindowsInUnified) { + // TODO: requires unified desktop mode. http://crbug.com/581462. + if (WmShell::Get()->IsRunningInMash()) + return; + display_manager()->SetUnifiedDesktopEnabled(true); UpdateDisplay("500x500"); @@ -749,6 +756,10 @@ // a display which has touch capability. TEST_F(VirtualKeyboardRootWindowControllerTest, VirtualKeyboardOnTouchableDisplayOnly) { + // TODO: investigate failure in mash. http://crbug.com/695640. + if (WmShell::Get()->IsRunningInMash()) + return; + UpdateDisplay("500x500,500x500"); display::Display secondary_display = Shell::GetInstance()->display_manager()->GetSecondaryDisplay(); @@ -799,6 +810,10 @@ // Test for http://crbug.com/303429. If both of displays have touch capability, // virtual keyboard follows the input focus. TEST_F(VirtualKeyboardRootWindowControllerTest, FollowInputFocus) { + // TODO: investigate failure in mash. http://crbug.com/695640. + if (WmShell::Get()->IsRunningInMash()) + return; + UpdateDisplay("500x500,500x500"); const int64_t primary_display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); @@ -867,9 +882,12 @@ // capability, the virtual keyboard shows up on the specified display. TEST_F(VirtualKeyboardRootWindowControllerTest, VirtualKeyboardShowOnSpecifiedDisplay) { + // TODO: fails in mash. http://crbug.com/695640. + if (WmShell::Get()->IsRunningInMash()) + return; + UpdateDisplay("500x500,500x500"); - display::Display secondary_display = - Shell::GetInstance()->display_manager()->GetSecondaryDisplay(); + display::Display secondary_display = GetSecondaryDisplay(); aura::Window::Windows root_windows = Shell::GetAllRootWindows(); aura::Window* primary_root_window = Shell::GetPrimaryRootWindow(); @@ -1058,11 +1076,14 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, EnsureCaretInWorkAreaWithMultipleDisplays) { + // TODO: fails in mash. http://crbug.com/695640. + if (WmShell::Get()->IsRunningInMash()) + return; + UpdateDisplay("500x500,600x600"); const int64_t primary_display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); - const int64_t secondary_display_id = - Shell::GetInstance()->display_manager()->GetSecondaryDisplay().id(); + const int64_t secondary_display_id = GetSecondaryDisplay().id(); ASSERT_NE(primary_display_id, secondary_display_id); aura::Window::Windows root_windows = Shell::GetAllRootWindows();
diff --git a/ash/screen_util_unittest.cc b/ash/screen_util_unittest.cc index 7090555..efbd30b 100644 --- a/ash/screen_util_unittest.cc +++ b/ash/screen_util_unittest.cc
@@ -6,6 +6,7 @@ #include "ash/common/wm/wm_screen_util.h" #include "ash/common/wm_lookup.h" +#include "ash/common/wm_shell.h" #include "ash/common/wm_window.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" @@ -105,6 +106,10 @@ } TEST_F(ScreenUtilTest, ShelfDisplayBoundsInUnifiedDesktop) { + // TODO: requires unified desktop mode. http://crbug.com/581462. + if (WmShell::Get()->IsRunningInMash()) + return; + display_manager()->SetUnifiedDesktopEnabled(true); views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds(
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 7bafd482..456b185e 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -303,6 +303,10 @@ ash::WmShell::Get()->session_controller()->SetSessionInfo(std::move(info)); } + int64_t GetPrimaryDisplayId() { + return display::Screen::GetScreen()->GetPrimaryDisplay().id(); + } + private: DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManagerTest); }; @@ -680,6 +684,10 @@ // Various assertions around auto-hide. TEST_F(ShelfLayoutManagerTest, AutoHide) { + // TODO: investigate failure in mash, http://crbug.com/695686. + if (WmShell::Get()->IsRunningInMash()) + return; + ui::test::EventGenerator& generator(GetEventGenerator()); WmShelf* shelf = GetPrimaryShelf(); @@ -739,6 +747,10 @@ // Test the behavior of the shelf when it is auto hidden and it is on the // boundary between the primary and the secondary display. TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) { + // TODO: investigate failure in mash, http://crbug.com/695686. + if (WmShell::Get()->IsRunningInMash()) + return; + UpdateDisplay("800x600,800x600"); Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( display::test::CreateDisplayLayout(display_manager(), @@ -944,8 +956,12 @@ EXPECT_FALSE(app_list_presenter_impl.GetTargetVisibility()); EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState()); + // TODO: fails in mash because of AppListPresenter. http://crbug.com/696028. + if (WmShell::Get()->IsRunningInMash()) + return; + // Show the app list and the shelf stays visible. - app_list_presenter_impl.Show(display_manager()->first_display_id()); + app_list_presenter_impl.Show(GetPrimaryDisplayId()); EXPECT_TRUE(app_list_presenter_impl.GetTargetVisibility()); EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState()); @@ -972,8 +988,12 @@ EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); + // TODO: fails in mash because of AppListPresenter. http://crbug.com/696028. + if (WmShell::Get()->IsRunningInMash()) + return; + // Show the app list and the shelf should be temporarily visible. - app_list_presenter_impl.Show(display_manager()->first_display_id()); + app_list_presenter_impl.Show(GetPrimaryDisplayId()); // The shelf's auto hide state won't be changed until the timer fires, so // force it to update now. GetShelfLayoutManager()->UpdateVisibilityState(); @@ -1036,8 +1056,12 @@ EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_1->GetAutoHideState()); EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf_2->GetAutoHideState()); + // TODO: fails in mash because of AppListPresenter. http://crbug.com/696028. + if (WmShell::Get()->IsRunningInMash()) + return; + // Show the app list; only the shelf on the same display should be shown. - app_list_presenter_impl.Show(display_manager()->first_display_id()); + app_list_presenter_impl.Show(GetPrimaryDisplayId()); Shell::GetInstance()->UpdateShelfVisibility(); EXPECT_TRUE(app_list_presenter_impl.GetTargetVisibility()); EXPECT_EQ(SHELF_AUTO_HIDE, shelf_1->GetVisibilityState()); @@ -1072,8 +1096,12 @@ EXPECT_FALSE(app_list_presenter_impl.GetTargetVisibility()); EXPECT_EQ(SHELF_HIDDEN, shelf->GetVisibilityState()); + // TODO: fails in mash because of AppListPresenter. http://crbug.com/696028. + if (WmShell::Get()->IsRunningInMash()) + return; + // Show the app list and the shelf should be temporarily visible. - app_list_presenter_impl.Show(display_manager()->first_display_id()); + app_list_presenter_impl.Show(GetPrimaryDisplayId()); EXPECT_TRUE(app_list_presenter_impl.GetTargetVisibility()); EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState()); @@ -1215,6 +1243,10 @@ // Test for Pinned mode. TEST_F(ShelfLayoutManagerTest, PinnedWindowHidesShelf) { + // TODO: investigate failure in mash, http://crbug.com/695686. + if (WmShell::Get()->IsRunningInMash()) + return; + WmShelf* shelf = GetPrimaryShelf(); aura::Window* window1 = CreateTestWindow(); @@ -1301,6 +1333,10 @@ } TEST_F(ShelfLayoutManagerTest, GestureDrag) { + // TODO: investigate failure in mash, http://crbug.com/695686. + if (WmShell::Get()->IsRunningInMash()) + return; + // Slop is an implementation detail of gesture recognition, and complicates // these tests. Ignore it. ui::GestureConfiguration::GetInstance() @@ -1448,6 +1484,10 @@ } TEST_F(ShelfLayoutManagerTest, ShelfFlickerOnTrayActivation) { + // TODO: investigate failure in mash, http://crbug.com/695686. + if (WmShell::Get()->IsRunningInMash()) + return; + WmShelf* shelf = GetPrimaryShelf(); // Create a visible window so auto-hide behavior is enforced. @@ -1703,6 +1743,10 @@ } TEST_F(ShelfLayoutManagerTest, ShelfLayoutInUnifiedDesktop) { + // TODO: requires unified desktop mode. http://crbug.com/581462. + if (WmShell::Get()->IsRunningInMash()) + return; + Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(true); UpdateDisplay("500x400, 500x400");
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc index d3a1b3d..01d7681 100644 --- a/ash/shelf/shelf_view_unittest.cc +++ b/ash/shelf/shelf_view_unittest.cc
@@ -197,6 +197,10 @@ // Make sure creating/deleting an window on one displays notifies a // shelf on external display as well as one on primary. TEST_F(WmShelfObserverIconTest, AddRemoveWithMultipleDisplays) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + UpdateDisplay("400x400,400x400"); WmWindow* second_root = WmShell::Get()->GetAllRootWindows()[1]; WmShelf* second_shelf = second_root->GetRootWindowController()->GetShelf(); @@ -857,6 +861,10 @@ } TEST_F(ShelfViewTest, AddPanelHidesPlatformAppButton) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + // All buttons should be visible. ASSERT_EQ(test_api_->GetButtonCount(), test_api_->GetLastVisibleIndex() + 1); @@ -1569,6 +1577,10 @@ // Checks the overflow bubble size when an item is ripped off and re-inserted. TEST_F(ShelfViewTest, OverflowBubbleSize) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + shelf_delegate_->set_is_app_pinned(true); AddButtonsUntilOverflow(); // Add one more button to prevent the overflow bubble to disappear upon @@ -1623,6 +1635,10 @@ // Check the drag insertion bounds of scrolled overflow bubble. TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + UpdateDisplay("400x300"); EXPECT_EQ(2, model_->item_count()); @@ -1774,6 +1790,10 @@ // Checks various drag and drop operations from OverflowBubble to Shelf. TEST_F(ShelfViewTest, CheckDragAndDropFromOverflowBubbleToShelf) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + AddButtonsUntilOverflow(); // Add one more button to prevent the overflow bubble to disappear upon // dragging an item out on windows (flakiness, see crbug.com/425097). @@ -1803,6 +1823,10 @@ // item is selected. TEST_F(ShelfViewTest, Launcher_ButtonPressedUserActionsRecordedWhenItemSelected) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + base::UserActionTester user_action_tester; ShelfID browser_shelf_id = model_->items()[browser_index_].id; @@ -1818,6 +1842,10 @@ // Verifies that Launcher_*Task UMA user actions are recorded when an item is // selected. TEST_F(ShelfViewTest, Launcher_TaskUserActionsRecordedWhenItemSelected) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + base::UserActionTester user_action_tester; ShelfID browser_shelf_id = model_->items()[browser_index_].id; @@ -2040,6 +2068,10 @@ // Tests that changing visibility of the app list transitions app list button's // ink drop states correctly. TEST_F(ShelfViewInkDropTest, AppListButtonWhenVisibilityChanges) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + InitAppListButtonInkDrop(); ShowAppList(); @@ -2093,6 +2125,10 @@ // which dismisses the app list, transitions ink drop states correctly. Also, // tests that mouse drag and mouse release does not affect the ink drop state. TEST_F(ShelfViewInkDropTest, AppListButtonMouseEventsWhenVisible) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + InitAppListButtonInkDrop(); ShowAppList(); @@ -2156,6 +2192,10 @@ // Tests that when the app list is visible, tapping on the app list button // transitions ink drop states correctly. TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapWhenVisible) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + InitAppListButtonInkDrop(); ShowAppList(); @@ -2222,6 +2262,10 @@ // Tests that when the app list is visible, tapping down on the app list button // and dragging the touch point transitions ink drop states correctly. TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapDragWhenVisible) { + // TODO: investigate failure in mash, http://crbug.com/695751. + if (WmShell::Get()->IsRunningInMash()) + return; + InitAppListButtonInkDrop(); ShowAppList();
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc index fe929cb6..881b972 100644 --- a/ash/shell_unittest.cc +++ b/ash/shell_unittest.cc
@@ -459,6 +459,10 @@ // Tests that the cursor-filter is ahead of the drag-drop controller in the // pre-target list. TEST_F(ShellTest, TestPreTargetHandlerOrder) { + // TODO: investigate failure in mash, http://crbug.com/695758. + if (WmShell::Get()->IsRunningInMash()) + return; + Shell* shell = Shell::GetInstance(); ui::EventTargetTestApi test_api(shell); test::ShellTestApi shell_test_api(shell); @@ -503,6 +507,13 @@ }; TEST_F(ShellTest2, DontCrashWhenWindowDeleted) { + // TODO: delete this test when conversion to mash is done. This test isn't + // applicable to mash as all windows must be destroyed before ash, that isn't + // the case with classic-ash where embedders can separately create + // aura::Windows. + if (WmShell::Get()->IsRunningInMash()) + return; + window_.reset(new aura::Window(NULL)); window_->Init(ui::LAYER_NOT_DRAWN); }
diff --git a/ash/sticky_keys/sticky_keys_overlay_unittest.cc b/ash/sticky_keys/sticky_keys_overlay_unittest.cc index 5a5c538..c6e2f5bc 100644 --- a/ash/sticky_keys/sticky_keys_overlay_unittest.cc +++ b/ash/sticky_keys/sticky_keys_overlay_unittest.cc
@@ -4,6 +4,7 @@ #include "ash/sticky_keys/sticky_keys_overlay.h" +#include "ash/common/wm_shell.h" #include "ash/display/window_tree_host_manager.h" #include "ash/shell.h" #include "ash/sticky_keys/sticky_keys_controller.h" @@ -45,6 +46,10 @@ // This test addresses the crash report at crbug.com/435600, speculated to be // caused by using sticky keys with multiple displays. TEST_F(StickyKeysOverlayTest, OverlayNotDestroyedAfterDisplayRemoved) { + // TODO: investigate failure in mash, http://crbug.com/696006. + if (WmShell::Get()->IsRunningInMash()) + return; + // Add a secondary display to the left of the primary one. UpdateDisplay("1280x1024,1980x1080"); display::DisplayIdList display_ids =
diff --git a/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc b/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc index 546c861..8a2df30 100644 --- a/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc +++ b/ash/system/chromeos/power/tablet_power_button_controller_unittest.cc
@@ -75,8 +75,11 @@ void TearDown() override { generator_ = nullptr; + const bool is_mash = WmShell::Get()->IsRunningInMash(); AshTestBase::TearDown(); - chromeos::DBusThreadManager::Shutdown(); + // Mash shuts down dbus after each test. + if (!is_mash) + chromeos::DBusThreadManager::Shutdown(); } protected:
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc index 50c8921..399d37b 100644 --- a/base/json/json_parser.cc +++ b/base/json/json_parser.cc
@@ -133,58 +133,62 @@ JSONParser::StringBuilder::StringBuilder() : StringBuilder(nullptr) {} JSONParser::StringBuilder::StringBuilder(const char* pos) - : pos_(pos), - length_(0), - string_(nullptr) { -} - -void JSONParser::StringBuilder::Swap(StringBuilder* other) { - std::swap(other->string_, string_); - std::swap(other->pos_, pos_); - std::swap(other->length_, length_); -} + : pos_(pos), length_(0), has_string_(false) {} JSONParser::StringBuilder::~StringBuilder() { - delete string_; + if (has_string_) + string_.Destroy(); +} + +void JSONParser::StringBuilder::operator=(StringBuilder&& other) { + pos_ = other.pos_; + length_ = other.length_; + has_string_ = other.has_string_; + if (has_string_) + string_.InitFromMove(std::move(other.string_)); } void JSONParser::StringBuilder::Append(const char& c) { DCHECK_GE(c, 0); DCHECK_LT(static_cast<unsigned char>(c), 128); - if (string_) + if (has_string_) string_->push_back(c); else ++length_; } -void JSONParser::StringBuilder::AppendString(const std::string& str) { - DCHECK(string_); - string_->append(str); +void JSONParser::StringBuilder::AppendString(const char* str, size_t len) { + DCHECK(has_string_); + string_->append(str, len); } void JSONParser::StringBuilder::Convert() { - if (string_) + if (has_string_) return; - string_ = new std::string(pos_, length_); -} -bool JSONParser::StringBuilder::CanBeStringPiece() const { - return !string_; + has_string_ = true; + string_.Init(pos_, length_); } StringPiece JSONParser::StringBuilder::AsStringPiece() { - if (string_) - return StringPiece(); + if (has_string_) + return StringPiece(*string_); return StringPiece(pos_, length_); } const std::string& JSONParser::StringBuilder::AsString() { - if (!string_) + if (!has_string_) Convert(); return *string_; } +std::string JSONParser::StringBuilder::DestructiveAsString() { + if (has_string_) + return std::move(*string_); + return std::string(pos_, length_); +} + // JSONParser private ////////////////////////////////////////////////////////// inline bool JSONParser::CanConsume(int length) { @@ -372,7 +376,7 @@ return nullptr; } - dict->SetWithoutPathExpansion(key.AsString(), std::move(value)); + dict->SetWithoutPathExpansion(key.AsStringPiece(), std::move(value)); NextChar(); token = GetNextToken(); @@ -440,7 +444,7 @@ if (!ConsumeStringRaw(&string)) return nullptr; - return base::MakeUnique<StringValue>(string.AsString()); + return base::MakeUnique<StringValue>(string.DestructiveAsString()); } bool JSONParser::ConsumeStringRaw(StringBuilder* out) { @@ -468,13 +472,14 @@ } CBU8_NEXT(start_pos_, start_index, length, next_char); string.Convert(); - string.AppendString(kUnicodeReplacementString); + string.AppendString(kUnicodeReplacementString, + arraysize(kUnicodeReplacementString) - 1); continue; } if (next_char == '"') { --index_; // Rewind by one because of CBU8_NEXT. - out->Swap(&string); + *out = std::move(string); return true; } @@ -536,7 +541,7 @@ return false; } - string.AppendString(utf8_units); + string.AppendString(utf8_units.data(), utf8_units.length()); break; } case '"': @@ -661,7 +666,7 @@ dest->Convert(); // CBU8_APPEND_UNSAFE can overwrite up to 4 bytes, so utf8_units may not be // zero terminated at this point. |offset| contains the correct length. - dest->AppendString(std::string(utf8_units, offset)); + dest->AppendString(utf8_units, offset); } } @@ -680,11 +685,7 @@ end_index = index_; // The optional fraction part. - if (*pos_ == '.') { - if (!CanConsume(1)) { - ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; - } + if (CanConsume(1) && *pos_ == '.') { NextChar(); if (!ReadInt(true)) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); @@ -694,10 +695,15 @@ } // Optional exponent part. - if (*pos_ == 'e' || *pos_ == 'E') { + if (CanConsume(1) && (*pos_ == 'e' || *pos_ == 'E')) { NextChar(); - if (*pos_ == '-' || *pos_ == '+') + if (!CanConsume(1)) { + ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); + return nullptr; + } + if (*pos_ == '-' || *pos_ == '+') { NextChar(); + } if (!ReadInt(true)) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); return nullptr; @@ -742,13 +748,18 @@ } bool JSONParser::ReadInt(bool allow_leading_zeros) { - char first = *pos_; - int len = 0; + size_t len = 0; + char first = 0; - char c = first; - while (CanConsume(1) && IsAsciiDigit(c)) { - c = *NextChar(); + while (CanConsume(1)) { + if (!IsAsciiDigit(*pos_)) + break; + + if (len == 0) + first = *pos_; + ++len; + NextChar(); } if (len == 0)
diff --git a/base/json/json_parser.h b/base/json/json_parser.h index 1cebb8d..d2850e5 100644 --- a/base/json/json_parser.h +++ b/base/json/json_parser.h
@@ -16,6 +16,7 @@ #include "base/gtest_prod_util.h" #include "base/json/json_reader.h" #include "base/macros.h" +#include "base/memory/manual_constructor.h" #include "base/strings/string_piece.h" namespace base { @@ -93,7 +94,7 @@ // This class centralizes that logic. class StringBuilder { public: - // Empty constructor. Used for creating a builder with which to Swap(). + // Empty constructor. Used for creating a builder with which to assign to. StringBuilder(); // |pos| is the beginning of an input string, excluding the |"|. @@ -101,8 +102,7 @@ ~StringBuilder(); - // Swaps the contents of |other| with this. - void Swap(StringBuilder* other); + void operator=(StringBuilder&& other); // Either increases the |length_| of the string or copies the character if // the StringBuilder has been converted. |c| must be in the basic ASCII @@ -111,23 +111,24 @@ void Append(const char& c); // Appends a string to the std::string. Must be Convert()ed to use. - void AppendString(const std::string& str); + void AppendString(const char* str, size_t len); // Converts the builder from its default StringPiece to a full std::string, // performing a copy. Once a builder is converted, it cannot be made a // StringPiece again. void Convert(); - // Returns whether the builder can be converted to a StringPiece. - bool CanBeStringPiece() const; - - // Returns the StringPiece representation. Returns an empty piece if it - // cannot be converted. + // Returns the builder as a StringPiece. StringPiece AsStringPiece(); // Returns the builder as a std::string. const std::string& AsString(); + // Returns the builder as a string, invalidating all state. This allows + // the internal string buffer representation to be destructively moved + // in cases where the builder will not be needed any more. + std::string DestructiveAsString(); + private: // The beginning of the input string. const char* pos_; @@ -135,9 +136,10 @@ // Number of bytes in |pos_| that make up the string being built. size_t length_; - // The copied string representation. NULL until Convert() is called. - // Strong. std::unique_ptr<T> has too much of an overhead here. - std::string* string_; + // The copied string representation. Will be uninitialized until Convert() + // is called, which will set has_string_ to true. + bool has_string_; + base::ManualConstructor<std::string> string_; }; // Quick check that the stream has capacity to consume |length| more bytes. @@ -181,7 +183,7 @@ // Assuming that the parser is wound to a double quote, this parses a string, // decoding any escape sequences and converts UTF-16 to UTF-8. Returns true on - // success and Swap()s the result into |out|. Returns false on failure with + // success and places result into |out|. Returns false on failure with // error information set. bool ConsumeStringRaw(StringBuilder* out); // Helper function for ConsumeStringRaw() that consumes the next four or 10
diff --git a/base/json/json_parser_unittest.cc b/base/json/json_parser_unittest.cc index d004c480..e3f635b7 100644 --- a/base/json/json_parser_unittest.cc +++ b/base/json/json_parser_unittest.cc
@@ -9,6 +9,8 @@ #include <memory> #include "base/json/json_reader.h" +#include "base/memory/ptr_util.h" +#include "base/strings/stringprintf.h" #include "base/values.h" #include "testing/gtest/include/gtest/gtest.h" @@ -342,5 +344,51 @@ EXPECT_EQ(kUnicodeReplacementString, str); } +TEST_F(JSONParserTest, ParseNumberErrors) { + const struct { + const char* input; + bool parse_success; + double value; + } kCases[] = { + // clang-format off + {"1", true, 1}, + {"2.", false, 0}, + {"42", true, 42}, + {"6e", false, 0}, + {"43e2", true, 4300}, + {"43e-", false, 0}, + {"9e-3", true, 0.009}, + {"2e+", false, 0}, + {"2e+2", true, 200}, + // clang-format on + }; + + for (unsigned int i = 0; i < arraysize(kCases); ++i) { + auto test_case = kCases[i]; + SCOPED_TRACE(StringPrintf("case %u: \"%s\"", i, test_case.input)); + + // MSan will do a better job detecting over-read errors if the input is + // not nul-terminated on the heap. + size_t str_len = strlen(test_case.input); + auto non_nul_termianted = MakeUnique<char[]>(str_len); + memcpy(non_nul_termianted.get(), test_case.input, str_len); + + StringPiece string_piece(non_nul_termianted.get(), str_len); + std::unique_ptr<Value> result = JSONReader::Read(string_piece); + if (test_case.parse_success) { + EXPECT_TRUE(result); + } else { + EXPECT_FALSE(result); + } + + if (!result) + continue; + + double double_value = 0; + EXPECT_TRUE(result->GetAsDouble(&double_value)); + EXPECT_EQ(test_case.value, double_value); + } +} + } // namespace internal } // namespace base
diff --git a/base/win/OWNERS b/base/win/OWNERS index 78473b9e..69c8613 100644 --- a/base/win/OWNERS +++ b/base/win/OWNERS
@@ -2,3 +2,5 @@ grt@chromium.org jschuh@chromium.org scottmg@chromium.org + +# COMPONENT: Internals>PlatformIntegration
diff --git a/breakpad/symupload.exe b/breakpad/symupload.exe index 9ddf91d..584151b 100755 --- a/breakpad/symupload.exe +++ b/breakpad/symupload.exe Binary files differ
diff --git a/build/nocompile.gni b/build/nocompile.gni index 7c91c67..c971464 100644 --- a/build/nocompile.gni +++ b/build/nocompile.gni
@@ -59,7 +59,8 @@ declare_args() { # TODO(crbug.com/105388): make sure no-compile test is not flaky. - enable_nocompile_tests = is_linux && is_clang && host_cpu == target_cpu + enable_nocompile_tests = + (is_linux || is_mac || is_ios) && is_clang && host_cpu == target_cpu } if (enable_nocompile_tests) {
diff --git a/cc/BUILD.gn b/cc/BUILD.gn index 3fc669a..4ca2f28 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn
@@ -614,8 +614,6 @@ "test/fake_video_frame_provider.h", "test/geometry_test_utils.cc", "test/geometry_test_utils.h", - "test/layer_internals_for_test.cc", - "test/layer_internals_for_test.h", "test/layer_test_common.cc", "test/layer_test_common.h", "test/layer_tree_json_parser.cc",
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index be0070c..04fa7f4 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc
@@ -156,11 +156,6 @@ host->SetNeedsCommit(); } -void Layer::SetNeedsUpdate() { - if (layer_tree_host_ && !ignore_set_needs_commit_) - layer_tree_host_->SetNeedsUpdateLayers(); -} - void Layer::SetNeedsCommit() { if (!layer_tree_host_) return; @@ -1061,8 +1056,8 @@ SetNeedsPushProperties(); inputs_.update_rect.Union(dirty_rect); - if (DrawsContent()) - SetNeedsUpdate(); + if (DrawsContent() && layer_tree_host_ && !ignore_set_needs_commit_) + layer_tree_host_->SetNeedsUpdateLayers(); } bool Layer::DescendantIsFixedToContainerLayer() const { @@ -1334,49 +1329,11 @@ } void Layer::OnOpacityAnimated(float opacity) { - DCHECK_GE(opacity, 0.f); - DCHECK_LE(opacity, 1.f); - - if (inputs_.opacity == opacity) - return; inputs_.opacity = opacity; - // Changing the opacity may make a previously hidden layer visible, so a new - // recording may be needed. - SetNeedsUpdate(); - if (layer_tree_host_) { - PropertyTrees* property_trees = layer_tree_host_->property_trees(); - if (property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, - id())) { - DCHECK_EQ(effect_tree_index(), - property_trees->layer_id_to_effect_node_index[id()]); - EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); - node->opacity = opacity; - property_trees->effect_tree.set_needs_update(true); - } - } } void Layer::OnTransformAnimated(const gfx::Transform& transform) { - if (inputs_.transform == transform) - return; inputs_.transform = transform; - // Changing the transform may change the visible part of this layer, so a new - // recording may be needed. - SetNeedsUpdate(); - if (layer_tree_host_) { - PropertyTrees* property_trees = layer_tree_host_->property_trees(); - if (property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM, - id())) { - DCHECK_EQ(transform_tree_index(), - property_trees->layer_id_to_transform_node_index[id()]); - TransformNode* node = - property_trees->transform_tree.Node(transform_tree_index()); - node->local = transform; - node->needs_local_transform_update = true; - node->has_potential_animation = true; - property_trees->transform_tree.set_needs_update(true); - } - } } void Layer::OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) { @@ -1567,14 +1524,6 @@ SetNeedsCommit(); } -void Layer::DidBeginTracing() { - // We'll be dumping layer trees as part of trace, so make sure - // PushPropertiesTo() propagates layer debug info to the impl - // side -- otherwise this won't happen for the the layers that - // remain unchanged since tracing started. - SetNeedsPushProperties(); -} - int Layer::num_copy_requests_in_target_subtree() { return layer_tree_host_->property_trees() ->effect_tree.Node(effect_tree_index())
diff --git a/cc/layers/layer.h b/cc/layers/layer.h index 534316e..c310377 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h
@@ -347,6 +347,8 @@ return paint_properties_; } + // Mark the layer as needing to push its properties to the LayerImpl during + // commit. void SetNeedsPushProperties(); void ResetNeedsPushPropertiesForTesting(); @@ -407,8 +409,6 @@ void SetMayContainVideo(bool yes); - void DidBeginTracing(); - int num_copy_requests_in_target_subtree(); void SetElementId(ElementId id); @@ -456,19 +456,16 @@ // These SetNeeds functions are in order of severity of update: // - // Called when this layer has been modified in some way, but isn't sure - // that it needs a commit yet. It needs CalcDrawProperties and UpdateLayers - // before it knows whether or not a commit is required. - void SetNeedsUpdate(); - // Called when a property has been modified in a way that the layer - // knows immediately that a commit is required. This implies SetNeedsUpdate - // as well as SetNeedsPushProperties to push that property. + // Called when a property has been modified in a way that the layer knows + // immediately that a commit is required. This implies SetNeedsPushProperties + // to push that property. void SetNeedsCommit(); // This is identical to SetNeedsCommit, but the former requests a rebuild of // the property trees. void SetNeedsCommitNoRebuild(); - // Called when there's been a change in layer structure. Implies both - // SetNeedsUpdate and SetNeedsCommit, but not SetNeedsPushProperties. + // Called when there's been a change in layer structure. Implies + // SetNeedsCommit and property tree rebuld, but not SetNeedsPushProperties + // (the full tree is synced over). void SetNeedsFullTreeSync(); // Called when the next commit should wait until the pending tree is activated
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc index 04afe16..1a227ca 100644 --- a/cc/layers/layer_unittest.cc +++ b/cc/layers/layer_unittest.cc
@@ -23,7 +23,6 @@ #include "cc/test/fake_layer_tree_host_client.h" #include "cc/test/fake_layer_tree_host_impl.h" #include "cc/test/geometry_test_utils.h" -#include "cc/test/layer_internals_for_test.h" #include "cc/test/layer_test_common.h" #include "cc/test/stub_layer_tree_host_single_thread_client.h" #include "cc/test/test_task_graph_runner.h" @@ -1382,25 +1381,31 @@ } TEST_F(LayerTest, AnimationSchedulesLayerUpdate) { + // TODO(weiliangc): This is really a LayerTreeHost unittest by this point, + // though currently there is no good place for this unittest to go. Move to + // LayerTreeHost unittest when there is a good setup. scoped_refptr<Layer> layer = Layer::Create(); + layer->SetElementId(ElementId(2, 0)); EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(layer)); - - LayerInternalsForTest layer_internals(layer.get()); + auto element_id = layer->element_id(); EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1); - layer_internals.OnOpacityAnimated(0.5f); + layer_tree_host_->SetElementOpacityMutated(element_id, + ElementListType::ACTIVE, 0.5f); Mock::VerifyAndClearExpectations(layer_tree_host_.get()); EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1); gfx::Transform transform; transform.Rotate(45.0); - layer_internals.OnTransformAnimated(transform); + layer_tree_host_->SetElementTransformMutated( + element_id, ElementListType::ACTIVE, transform); Mock::VerifyAndClearExpectations(layer_tree_host_.get()); // Scroll offset animation should not schedule a layer update since it is // handled similarly to normal compositor scroll updates. EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(0); - layer_internals.OnScrollOffsetAnimated(gfx::ScrollOffset(10, 10)); + layer_tree_host_->SetElementScrollOffsetMutated( + element_id, ElementListType::ACTIVE, gfx::ScrollOffset(10, 10)); Mock::VerifyAndClearExpectations(layer_tree_host_.get()); }
diff --git a/cc/test/layer_internals_for_test.cc b/cc/test/layer_internals_for_test.cc deleted file mode 100644 index 321330c..0000000 --- a/cc/test/layer_internals_for_test.cc +++ /dev/null
@@ -1,27 +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 "cc/test/layer_internals_for_test.h" - -#include "cc/layers/layer.h" - -namespace cc { - -LayerInternalsForTest::LayerInternalsForTest(Layer* layer) : layer_(layer) {} - -void LayerInternalsForTest::OnOpacityAnimated(float opacity) { - layer_->OnOpacityAnimated(opacity); -} - -void LayerInternalsForTest::OnTransformAnimated( - const gfx::Transform& transform) { - layer_->OnTransformAnimated(transform); -} - -void LayerInternalsForTest::OnScrollOffsetAnimated( - const gfx::ScrollOffset& scroll_offset) { - layer_->OnScrollOffsetAnimated(scroll_offset); -} - -} // namespace cc
diff --git a/cc/test/layer_internals_for_test.h b/cc/test/layer_internals_for_test.h deleted file mode 100644 index 58fce8c..0000000 --- a/cc/test/layer_internals_for_test.h +++ /dev/null
@@ -1,28 +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 CC_TEST_LAYER_INTERNALS_FOR_TEST_H_ -#define CC_TEST_LAYER_INTERNALS_FOR_TEST_H_ - -#include "base/macros.h" -#include "cc/layers/layer.h" - -namespace cc { - -// Utility class to give tests access to Layer private methods. -class LayerInternalsForTest { - public: - explicit LayerInternalsForTest(Layer* layer); - - void OnOpacityAnimated(float opacity); - void OnTransformAnimated(const gfx::Transform& transform); - void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset); - - private: - Layer* layer_; -}; - -} // namespace cc - -#endif // CC_TEST_LAYER_INTERNALS_FOR_TEST_H_
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index c042518..09eae2b 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc
@@ -43,6 +43,7 @@ #include "cc/layers/painted_scrollbar_layer.h" #include "cc/resources/ui_resource_manager.h" #include "cc/trees/draw_property_utils.h" +#include "cc/trees/effect_node.h" #include "cc/trees/layer_tree_host_client.h" #include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_host_impl.h" @@ -52,6 +53,7 @@ #include "cc/trees/proxy_main.h" #include "cc/trees/single_thread_proxy.h" #include "cc/trees/swap_promise_manager.h" +#include "cc/trees/transform_node.h" #include "cc/trees/tree_synchronizer.h" #include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/geometry/vector2d_conversions.h" @@ -272,8 +274,12 @@ if (is_new_trace && frame_viewer_instrumentation::IsTracingLayerTreeSnapshots() && root_layer()) { + // We'll be dumping layer trees as part of trace, so make sure + // PushPropertiesTo() propagates layer debug info to the impl side -- + // otherwise this won't happen for the layers that remain unchanged since + // tracing started. LayerTreeHostCommon::CallFunctionForEveryLayer( - this, [](Layer* layer) { layer->DidBeginTracing(); }); + this, [](Layer* layer) { layer->SetNeedsPushProperties(); }); } LayerTreeImpl* sync_tree = host_impl->sync_tree(); @@ -637,6 +643,8 @@ LayerList update_layer_list; { + base::AutoReset<bool> update_property_trees(&in_update_property_trees_, + true); TRACE_EVENT0("cc", "LayerTreeHostInProcess::UpdateLayers::BuildPropertyTrees"); TRACE_EVENT0( @@ -674,7 +682,7 @@ bool content_is_suitable_for_gpu = true; bool did_paint_content = - UpdateLayers(update_layer_list, &content_is_suitable_for_gpu); + PaintContent(update_layer_list, &content_is_suitable_for_gpu); if (content_is_suitable_for_gpu) { ++num_consecutive_frames_suitable_for_gpu_; @@ -991,7 +999,7 @@ return layer_id_map_.size(); } -bool LayerTreeHost::UpdateLayers(const LayerList& update_layer_list, +bool LayerTreeHost::PaintContent(const LayerList& update_layer_list, bool* content_is_suitable_for_gpu) { base::AutoReset<bool> painting(&in_paint_layer_contents_, true); bool did_paint_content = false; @@ -1210,7 +1218,24 @@ float opacity) { Layer* layer = LayerByElementId(element_id); DCHECK(layer); + DCHECK_GE(opacity, 0.f); + DCHECK_LE(opacity, 1.f); layer->OnOpacityAnimated(opacity); + + if (property_trees_.IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, + layer->id())) { + DCHECK_EQ(layer->effect_tree_index(), + property_trees_.layer_id_to_effect_node_index[layer->id()]); + EffectNode* node = + property_trees_.effect_tree.Node(layer->effect_tree_index()); + if (node->opacity == opacity) + return; + + node->opacity = opacity; + property_trees_.effect_tree.set_needs_update(true); + } + + SetNeedsUpdateLayers(); } void LayerTreeHost::SetElementTransformMutated( @@ -1220,6 +1245,23 @@ Layer* layer = LayerByElementId(element_id); DCHECK(layer); layer->OnTransformAnimated(transform); + + if (property_trees_.IsInIdToIndexMap(PropertyTrees::TreeType::TRANSFORM, + layer->id())) { + DCHECK_EQ(layer->transform_tree_index(), + property_trees_.layer_id_to_transform_node_index[layer->id()]); + TransformNode* node = + property_trees_.transform_tree.Node(layer->transform_tree_index()); + if (node->local == transform) + return; + + node->local = transform; + node->needs_local_transform_update = true; + node->has_potential_animation = true; + property_trees_.transform_tree.set_needs_update(true); + } + + SetNeedsUpdateLayers(); } void LayerTreeHost::SetElementScrollOffsetMutated(
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index 4661d981..2b33aac 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h
@@ -322,7 +322,8 @@ size_t NumLayers() const; - bool UpdateLayers(const LayerList& update_layer_list, + bool in_update_property_trees() const { return in_update_property_trees_; } + bool PaintContent(const LayerList& update_layer_list, bool* content_is_suitable_for_gpu); bool in_paint_layer_contents() const { return in_paint_layer_contents_; } @@ -594,6 +595,7 @@ std::unordered_map<ElementId, Layer*, ElementIdHash> element_layers_map_; bool in_paint_layer_contents_ = false; + bool in_update_property_trees_ = false; MutatorHost* mutator_host_;
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index e5f4583..eaf3c475 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc
@@ -45,7 +45,6 @@ #include "cc/test/fake_scoped_ui_resource.h" #include "cc/test/fake_video_frame_provider.h" #include "cc/test/geometry_test_utils.h" -#include "cc/test/layer_internals_for_test.h" #include "cc/test/layer_tree_test.h" #include "cc/test/push_properties_counting_layer.h" #include "cc/test/push_properties_counting_layer_impl.h" @@ -1404,6 +1403,9 @@ root_->SetBounds(gfx::Size(50, 50)); + // Make sure child is registerd for animation. + child_->SetElementId(ElementId(2, 0)); + // Make sure child and grand_child have transform nodes. gfx::Transform rotation; rotation.RotateAboutZAxis(45.0); @@ -1422,7 +1424,8 @@ if (layer_tree_host()->SourceFrameNumber() == 1) { gfx::Transform scale; scale.Scale(2.0, 2.0); - LayerInternalsForTest(child_.get()).OnTransformAnimated(scale); + layer_tree_host()->SetElementTransformMutated( + child_->element_id(), ElementListType::ACTIVE, scale); } }
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 8dd229a5..27dad66 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -172,7 +172,7 @@ "//components/minidump_uploader:minidump_uploader_java", "//components/navigation_interception/android:navigation_interception_java", "//components/ntp_tiles/android:ntp_tiles_java", - "//components/payments:payment_request_java", + "//components/payments/content:payment_request_java", "//components/policy/android:policy_java", "//components/precache/android:precache_java", "//components/safe_browsing_db/android:safe_browsing_java", @@ -322,7 +322,7 @@ "//chrome/test/android:chrome_java_test_support", "//components/bookmarks/common/android:bookmarks_java", "//components/invalidation/impl:java", - "//components/payments:payment_request_java", + "//components/payments/content:payment_request_java", "//components/signin/core/browser/android:java", "//components/signin/core/browser/android:signin_java_test_support", "//components/sync:sync_java_test_support", @@ -401,7 +401,7 @@ "//components/minidump_uploader:minidump_uploader_java", "//components/minidump_uploader:minidump_uploader_javatests", "//components/navigation_interception/android:navigation_interception_java", - "//components/payments:payment_request_java", + "//components/payments/content:payment_request_java", "//components/policy/android:policy_java", "//components/precache/android:precache_java", "//components/precache/android:precache_javatests",
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java index a9866ba..20d43e10 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java
@@ -81,7 +81,7 @@ @VisibleForTesting static final String ONLINE_DETECTION_DISABLED = "disable_online_detection"; - private static final String ENABLE_AMP_AS_SEPARATE_TAB = "enable_amp_as_separate_tab"; + private static final String DISABLE_AMP_AS_SEPARATE_TAB = "disable_amp_as_separate_tab"; // Privacy-related flags private static final String ENABLE_SEND_HOME_COUNTRY = "enable_send_home_country"; @@ -109,7 +109,7 @@ private static Boolean sShouldHideContextualCardsData; private static Boolean sIsContextualCardsBarIntegrationEnabled; private static Boolean sIsOnlineDetectionDisabled; - private static Boolean sIsAmpAsSeparateTabEnabled; + private static Boolean sIsAmpAsSeparateTabDisabled; private static Boolean sContextualSearchSingleActionsEnabled; private static Boolean sCanSendHomeCountry; private static Boolean sContextualSearchUrlActionsEnabled; @@ -367,13 +367,13 @@ } /** - * @return Whether to auto-promote clicks in the AMP carousel into a separate Tab. + * @return Whether to disable auto-promotion of clicks in the AMP carousel into a separate Tab. */ - static boolean isAmpAsSeparateTabEnabled() { - if (sIsAmpAsSeparateTabEnabled == null) { - sIsAmpAsSeparateTabEnabled = getBooleanParam(ENABLE_AMP_AS_SEPARATE_TAB); + static boolean isAmpAsSeparateTabDisabled() { + if (sIsAmpAsSeparateTabDisabled == null) { + sIsAmpAsSeparateTabDisabled = getBooleanParam(DISABLE_AMP_AS_SEPARATE_TAB); } - return sIsAmpAsSeparateTabEnabled; + return sIsAmpAsSeparateTabDisabled; } // TODO(donnd): Remove once bar-integration is fully landed if still unused (native only).
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java index b32f4967..74383743 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
@@ -944,8 +944,8 @@ @Override public void onMainFrameNavigation(String url, boolean isExternalUrl, boolean isFailure) { if (isExternalUrl) { - if (ContextualSearchFieldTrial.isAmpAsSeparateTabEnabled() && mPolicy.isAmpUrl(url) - && mSearchPanel.didTouchContent()) { + if (!ContextualSearchFieldTrial.isAmpAsSeparateTabDisabled() + && mPolicy.isAmpUrl(url) && mSearchPanel.didTouchContent()) { onExternalNavigation(url); } } else {
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 48065c7..16e4ce0 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
@@ -24,8 +24,11 @@ */ @JNINamespace("offline_pages::android") public class OfflinePageBridge { + // These constants must be kept in sync with the constants defined in + // //components/offline_pages/core/client_namespace_constants.cc public static final String ASYNC_NAMESPACE = "async_loading"; public static final String BOOKMARK_NAMESPACE = "bookmark"; + public static final String LAST_N_NAMESPACE = "last_n"; public static final String SHARE_NAMESPACE = "share"; /**
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 index 946645c5..c25dc4806 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -76,7 +76,7 @@ /** * Android implementation of the PaymentRequest service defined in - * components/payments/payment_request.mojom. + * components/payments/content/payment_request.mojom. */ public class PaymentRequestImpl implements PaymentRequest, PaymentRequestUI.Client, PaymentApp.InstrumentsCallback,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java index 5a0b5024..3baaac0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java
@@ -16,6 +16,8 @@ import android.view.ViewGroup; import android.widget.TextView; +import org.chromium.base.Log; +import org.chromium.base.annotations.SuppressFBWarnings; import org.chromium.chrome.R; import org.chromium.chrome.browser.widget.DateDividedAdapter.ItemGroup; @@ -277,6 +279,8 @@ public static final int TYPE_NORMAL = 1; public static final int TYPE_SUBSECTION_HEADER = 2; + private static final String TAG = "DateDividedAdapter"; + private int mSize; private boolean mHasListHeader; private boolean mHasListFooter; @@ -590,8 +594,19 @@ /** * @param item The item to remove from the adapter. */ + // #getGroupAt() asserts false before returning null, causing findbugs to complain about + // a redundant nullcheck even though getGroupAt can return null. + @SuppressFBWarnings({"RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"}) protected void removeItem(TimedItem item) { - ItemGroup group = getGroupAt(item.getPosition()).first; + Pair<ItemGroup, Integer> groupPair = getGroupAt(item.getPosition()); + if (groupPair == null) { + Log.e(TAG, + "Failed to find group for item during remove. Item position: " + + item.getPosition() + ", total size: " + mSize); + return; + } + + ItemGroup group = groupPair.first; group.removeItem(item); mSize--;
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index cab70c9..1c5516c 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -1356,6 +1356,7 @@ "javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java", "javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageRequestTest.java", "javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtilsTest.java", + "javatests/src/org/chromium/chrome/browser/offlinepages/RecentTabsTest.java", "javatests/src/org/chromium/chrome/browser/omaha/ExponentialBackoffSchedulerTest.java", "javatests/src/org/chromium/chrome/browser/omaha/MockExponentialBackoffScheduler.java", "javatests/src/org/chromium/chrome/browser/omaha/OmahaClientTest.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/RecentTabsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/RecentTabsTest.java new file mode 100644 index 0000000..7e388ac --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/RecentTabsTest.java
@@ -0,0 +1,163 @@ +// 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.support.test.filters.MediumTest; + +import org.chromium.base.Callback; +import org.chromium.base.ThreadUtils; +import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.chrome.browser.offlinepages.OfflinePageBridge.OfflinePageModelObserver; +import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.test.ChromeTabbedActivityTestBase; +import org.chromium.net.NetworkChangeNotifier; +import org.chromium.net.test.EmbeddedTestServer; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Semaphore; +import java.util.concurrent.TimeUnit; + +/** Integration tests for the Last 1 feature of Offline Pages. */ +@CommandLineFlags.Add("enable-features=OfflineRecentPages") +public class RecentTabsTest extends ChromeTabbedActivityTestBase { + private static final String TEST_PAGE = "/chrome/test/data/android/about.html"; + private static final int TIMEOUT_MS = 5000; + + private OfflinePageBridge mOfflinePageBridge; + private EmbeddedTestServer mTestServer; + private String mTestPage; + + private void initializeBridgeForProfile(final boolean incognitoProfile) + throws InterruptedException { + final Semaphore semaphore = new Semaphore(0); + ThreadUtils.runOnUiThread(new Runnable() { + @Override + public void run() { + Profile profile = Profile.getLastUsedProfile(); + if (incognitoProfile) { + profile = profile.getOffTheRecordProfile(); + } + // Ensure we start in an offline state. + mOfflinePageBridge = OfflinePageBridge.getForProfile(profile); + if (mOfflinePageBridge == null || mOfflinePageBridge.isOfflinePageModelLoaded()) { + semaphore.release(); + return; + } + mOfflinePageBridge.addObserver(new OfflinePageModelObserver() { + @Override + public void offlinePageModelLoaded() { + semaphore.release(); + mOfflinePageBridge.removeObserver(this); + } + }); + } + }); + assertTrue(semaphore.tryAcquire(TIMEOUT_MS, TimeUnit.MILLISECONDS)); + } + + @Override + protected void setUp() throws Exception { + super.setUp(); + + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + // Ensure we start in an offline state. + NetworkChangeNotifier.forceConnectivityState(false); + Context context = getActivity().getBaseContext(); + if (!NetworkChangeNotifier.isInitialized()) { + NetworkChangeNotifier.init(context); + } + } + }); + + initializeBridgeForProfile(false); + + mTestServer = EmbeddedTestServer.createAndStartServer(getInstrumentation().getContext()); + mTestPage = mTestServer.getURL(TEST_PAGE); + } + + @Override + protected void tearDown() throws Exception { + mTestServer.stopAndDestroyServer(); + super.tearDown(); + } + + @Override + public void startMainActivity() throws InterruptedException { + startMainActivityOnBlankPage(); + } + + @CommandLineFlags.Add("short-offline-page-snapshot-delay-for-test") + @MediumTest + public void testLastNPageSavedWhenTabSwitched() throws Exception { + // The tab of interest. + Tab tab = loadUrlInNewTab(mTestPage); + + final ClientId firstTabClientId = + new ClientId(OfflinePageBridge.LAST_N_NAMESPACE, Integer.toString(tab.getId())); + + // The tab should be foreground and so no snapshot should exist. + assertNull(getPageByClientId(firstTabClientId)); + + // Note, that switching to a new tab must occur after the SnapshotController believes the + // page quality is good enough. With the debug flag, the delay after DomContentLoaded is 0 + // so we can definitely snapshot after onload (which is what |loadUrlInNewTab| waits for). + + // Switch to a new tab to cause the WebContents hidden event. + loadUrlInNewTab("about:blank"); + + waitForPageWithClientId(firstTabClientId); + } + + private void waitForPageWithClientId(final ClientId clientId) throws InterruptedException { + if (getPageByClientId(clientId) != null) return; + + final Semaphore semaphore = new Semaphore(0); + ThreadUtils.runOnUiThread(new Runnable() { + @Override + public void run() { + mOfflinePageBridge.addObserver(new OfflinePageModelObserver() { + @Override + public void offlinePageAdded(OfflinePageItem newPage) { + if (newPage.getClientId().equals(clientId)) { + mOfflinePageBridge.removeObserver(this); + semaphore.release(); + } + } + }); + } + }); + assertTrue(semaphore.tryAcquire(TIMEOUT_MS, TimeUnit.MILLISECONDS)); + } + + private OfflinePageItem getPageByClientId(ClientId clientId) throws InterruptedException { + final OfflinePageItem[] result = {null}; + final Semaphore semaphore = new Semaphore(0); + final List<ClientId> clientIdList = new ArrayList<>(); + clientIdList.add(clientId); + + ThreadUtils.runOnUiThread(new Runnable() { + @Override + public void run() { + mOfflinePageBridge.getPagesByClientIds( + clientIdList, new Callback<List<OfflinePageItem>>() { + @Override + public void onResult(List<OfflinePageItem> items) { + if (!items.isEmpty()) { + result[0] = items.get(0); + } + semaphore.release(); + } + }); + } + }); + assertTrue(semaphore.tryAcquire(TIMEOUT_MS, TimeUnit.MILLISECONDS)); + return result[0]; + } +}
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 39c52c9..f4f4ae9 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -439,18 +439,12 @@ </message> <!-- Generic terms --> - <message name="IDS_ADD" desc="Used for Add on buttons"> - Add - </message> <message name="IDS_UNDO_DELETE" desc="Description for a command to undo a delete command."> Undo Delete </message> <message name="IDS_EDIT" desc="Edit menu item"> &Edit </message> - <message name="IDS_SAVE" desc="Used on a button to save information you are editing."> - Save - </message> <message name="IDS_CONFIRM" desc="A button that lets the user confirm something."> Confirm </message> @@ -4373,6 +4367,9 @@ <message name="IDS_MD_EXTENSIONS_ITEM_INSPECT_VIEWS" desc="The text next to any inspectable views for an extension."> Inspect views: </message> + <message name="IDS_MD_EXTENSIONS_ITEM_INSPECT_VIEWS_EXTRA" desc="The text to indicate there are additional inspectable views that aren't listed."> + <ph name="NUMBER_OF_VIEWS">$1<ex>2</ex></ph> more... + </message> <message name="IDS_MD_EXTENSIONS_ITEM_ALLOW_INCOGNITO" desc="The text next to the checkbox to enable an extension in incognito mode."> Allow in incognito </message>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 8a67168..00e9a117 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -1370,7 +1370,7 @@ public_deps = [ "//chrome/common", "//components/autofill/core/browser", - "//components/payments:payment_validation", + "//components/payments/core", "//components/sync", "//content/public/browser", "//sql", @@ -1462,8 +1462,8 @@ "//components/password_manager/core/browser", "//components/password_manager/core/common", "//components/password_manager/sync/browser", - "//components/payments:payment_app", - "//components/payments:payment_request", + "//components/payments/content:payment_app", + "//components/payments/content:payment_request", "//components/policy:generated", "//components/policy/core/browser", "//components/policy/proto", @@ -2029,8 +2029,6 @@ "safe_browsing/permission_reporter.h", "safe_browsing/ping_manager.cc", "safe_browsing/ping_manager.h", - "safe_browsing/protocol_manager_helper.cc", - "safe_browsing/protocol_manager_helper.h", "safe_browsing/safe_browsing_blocking_page.cc", "safe_browsing/safe_browsing_blocking_page.h", "safe_browsing/safe_browsing_navigation_observer.cc", @@ -3040,7 +3038,7 @@ "//chrome/browser/android/webapk:proto", "//components/cdm/browser", "//components/data_usage/android", - "//components/payments/android:payments_jni", + "//components/payments/content/android", "//components/precache/content", "//components/precache/core", "//components/resources:components_resources", @@ -3614,7 +3612,7 @@ "payments/payment_request_factory.cc", "payments/payment_request_factory.h", ] - deps += [ "//components/payments:payment_request_impl" ] + deps += [ "//components/payments/content:payment_request_impl" ] } if (is_linux || is_win) {
diff --git a/chrome/browser/android/chrome_jni_registrar.cc b/chrome/browser/android/chrome_jni_registrar.cc index feb96d4..4c4df86994 100644 --- a/chrome/browser/android/chrome_jni_registrar.cc +++ b/chrome/browser/android/chrome_jni_registrar.cc
@@ -168,8 +168,8 @@ #include "components/gcm_driver/android/component_jni_registrar.h" #include "components/gcm_driver/instance_id/android/component_jni_registrar.h" #include "components/invalidation/impl/android/component_jni_registrar.h" -#include "components/payments/android/currency_formatter_android.h" -#include "components/payments/android/payments_jni_registrar.h" +#include "components/payments/content/android/currency_formatter_android.h" +#include "components/payments/content/android/payment_details_validation_android.h" #include "components/policy/core/browser/android/component_jni_registrar.h" #include "components/safe_browsing_db/android/jni_registrar.h" #include "components/safe_json/android/component_jni_registrar.h"
diff --git a/chrome/browser/android/compositor/layer/content_layer.cc b/chrome/browser/android/compositor/layer/content_layer.cc index 67f0057..d9ea860 100644 --- a/chrome/browser/android/compositor/layer/content_layer.cc +++ b/chrome/browser/android/compositor/layer/content_layer.cc
@@ -7,6 +7,7 @@ #include "base/lazy_instance.h" #include "cc/layers/layer.h" #include "cc/layers/layer_collections.h" +#include "cc/layers/surface_layer.h" #include "cc/output/filter_operations.h" #include "chrome/browser/android/compositor/layer/thumbnail_layer.h" #include "chrome/browser/android/compositor/tab_content_manager.h" @@ -32,28 +33,27 @@ } } -static bool DoesLeafDrawContents(scoped_refptr<cc::Layer> layer) { +static cc::Layer* GetDrawsContentLeaf(scoped_refptr<cc::Layer> layer) { if (!layer.get()) - return false; + return nullptr; // If the subtree is hidden, then any layers in this tree will not be drawn. if (layer->hide_layer_and_subtree()) - return false; + return nullptr; - // TODO: Remove the need for this logic. We can't really guess from - // an opaque layer type whether it has valid live contents, or for example - // just a background color placeholder. Need to get this from somewhere else - // like ContentViewCore or RWHV. - if (layer->DrawsContent() && !layer->background_color()) { - return true; - } + if (layer->opacity() == 0.0f) + return nullptr; + + if (layer->DrawsContent()) + return layer.get(); const cc::LayerList& children = layer->children(); for (unsigned i = 0; i < children.size(); i++) { - if (DoesLeafDrawContents(children[i])) - return true; + cc::Layer* leaf = GetDrawsContentLeaf(children[i]); + if (leaf) + return leaf; } - return false; + return nullptr; } void ContentLayer::SetProperties(int id, @@ -64,33 +64,31 @@ float saturation, bool should_clip, const gfx::Rect& clip) { - scoped_refptr<cc::Layer> content_layer = - tab_content_manager_->GetLiveLayer(id); - bool content_layer_draws = DoesLeafDrawContents(content_layer); + scoped_refptr<cc::Layer> live_layer; + if (can_use_live_layer) + live_layer = tab_content_manager_->GetLiveLayer(id); + bool live_layer_draws = GetDrawsContentLeaf(live_layer); scoped_refptr<ThumbnailLayer> static_layer = - tab_content_manager_->GetStaticLayer( - id, !(can_use_live_layer && content_layer_draws)); + tab_content_manager_->GetOrCreateStaticLayer(id, !live_layer_draws); float content_opacity = should_override_content_alpha ? content_alpha_override : 1.0f; float static_opacity = should_override_content_alpha ? content_alpha_override : 1.0f; - if (content_layer.get() && can_use_live_layer && content_layer_draws) + if (live_layer_draws) static_opacity = static_to_view_blend; - if (!can_use_live_layer) - content_opacity = 0.0f; const cc::LayerList& layer_children = layer_->children(); for (unsigned i = 0; i < layer_children.size(); i++) layer_children[i]->RemoveFromParent(); - if (content_layer.get()) { - content_layer->SetMasksToBounds(should_clip); - content_layer->SetBounds(clip.size()); - SetOpacityOnLeaf(content_layer, content_opacity); + if (live_layer.get()) { + live_layer->SetMasksToBounds(should_clip); + live_layer->SetBounds(clip.size()); + SetOpacityOnLeaf(live_layer, content_opacity); - layer_->AddChild(content_layer); + layer_->AddChild(live_layer); } if (static_layer.get()) { static_layer->layer()->SetIsDrawable(true); @@ -111,6 +109,23 @@ } } +gfx::Size ContentLayer::ComputeSize(int id) const { + gfx::Size size; + + scoped_refptr<cc::Layer> live_layer = tab_content_manager_->GetLiveLayer(id); + cc::SurfaceLayer* surface_layer = + static_cast<cc::SurfaceLayer*>(GetDrawsContentLeaf(live_layer)); + if (surface_layer) + size.SetToMax(surface_layer->primary_surface_info().size_in_pixels()); + + scoped_refptr<ThumbnailLayer> static_layer = + tab_content_manager_->GetStaticLayer(id); + if (static_layer.get() && GetDrawsContentLeaf(static_layer->layer())) + size.SetToMax(static_layer->layer()->bounds()); + + return size; +} + scoped_refptr<cc::Layer> ContentLayer::layer() { return layer_; }
diff --git a/chrome/browser/android/compositor/layer/content_layer.h b/chrome/browser/android/compositor/layer/content_layer.h index 6736063..752c643b 100644 --- a/chrome/browser/android/compositor/layer/content_layer.h +++ b/chrome/browser/android/compositor/layer/content_layer.h
@@ -19,7 +19,6 @@ namespace android { class TabContentManager; -class ThumbnailLayer; // Sub layer tree representation of the contents of a tab. // Contains logic to temporarily display a static thumbnail @@ -40,14 +39,13 @@ scoped_refptr<cc::Layer> layer() override; + gfx::Size ComputeSize(int id) const; + protected: explicit ContentLayer(TabContentManager* tab_content_manager); ~ContentLayer() override; private: - void SetContentLayer(scoped_refptr<cc::Layer> layer); - void SetStaticLayer(scoped_refptr<ThumbnailLayer> layer); - // This is an intermediate shim layer whose children are // both the static and content layers (or either, or none, depending on which // is available).
diff --git a/chrome/browser/android/compositor/layer/tab_layer.cc b/chrome/browser/android/compositor/layer/tab_layer.cc index 68084d26..2becca9e 100644 --- a/chrome/browser/android/compositor/layer/tab_layer.cc +++ b/chrome/browser/android/compositor/layer/tab_layer.cc
@@ -554,7 +554,7 @@ // padding_ Transform gfx::Size content_bounds; if (!back_visible) - content_bounds = content_->layer()->bounds(); + content_bounds = content_->ComputeSize(id); gfx::Rect side_padding_rect; gfx::Rect bottom_padding_rect;
diff --git a/chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.cc b/chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.cc index 3917963..ef171f58 100644 --- a/chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.cc +++ b/chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.cc
@@ -318,6 +318,18 @@ return layer_tree; } +bool TabStripSceneLayer::ShouldShowBackground() { + if (content_tree_) + return content_tree_->ShouldShowBackground(); + return SceneLayer::ShouldShowBackground(); +} + +SkColor TabStripSceneLayer::GetBackgroundColor() { + if (content_tree_) + return content_tree_->GetBackgroundColor(); + return SceneLayer::GetBackgroundColor(); +} + static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& jobj) { // This will automatically bind to the Java object and pass ownership there. TabStripSceneLayer* scene_layer = new TabStripSceneLayer(env, jobj);
diff --git a/chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.h b/chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.h index 88195706..4119c10 100644 --- a/chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.h +++ b/chrome/browser/android/compositor/scene_layer/tab_strip_scene_layer.h
@@ -111,6 +111,9 @@ const base::android::JavaParamRef<jobject>& jlayer_title_cache, const base::android::JavaParamRef<jobject>& jresource_manager); + bool ShouldShowBackground() override; + SkColor GetBackgroundColor() override; + private: scoped_refptr<TabHandleLayer> GetNextLayer( LayerTitleCache* layer_title_cache);
diff --git a/chrome/browser/android/compositor/tab_content_manager.cc b/chrome/browser/android/compositor/tab_content_manager.cc index 505c843..fe40101 100644 --- a/chrome/browser/android/compositor/tab_content_manager.cc +++ b/chrome/browser/android/compositor/tab_content_manager.cc
@@ -134,7 +134,11 @@ return live_layer_list_[tab_id]; } -scoped_refptr<ThumbnailLayer> TabContentManager::GetStaticLayer( +scoped_refptr<ThumbnailLayer> TabContentManager::GetStaticLayer(int tab_id) { + return static_layer_cache_[tab_id]; +} + +scoped_refptr<ThumbnailLayer> TabContentManager::GetOrCreateStaticLayer( int tab_id, bool force_disk_read) { Thumbnail* thumbnail = thumbnail_cache_->Get(tab_id, force_disk_read, true);
diff --git a/chrome/browser/android/compositor/tab_content_manager.h b/chrome/browser/android/compositor/tab_content_manager.h index 13b3655..70b5372c 100644 --- a/chrome/browser/android/compositor/tab_content_manager.h +++ b/chrome/browser/android/compositor/tab_content_manager.h
@@ -53,9 +53,11 @@ // Get the live layer from the cache. scoped_refptr<cc::Layer> GetLiveLayer(int tab_id); + scoped_refptr<ThumbnailLayer> GetStaticLayer(int tab_id); + // Get the static thumbnail from the cache, or the NTP. - scoped_refptr<ThumbnailLayer> GetStaticLayer(int tab_id, - bool force_disk_read); + scoped_refptr<ThumbnailLayer> GetOrCreateStaticLayer(int tab_id, + bool force_disk_read); // Should be called when a tab gets a new live layer that should be served // by the cache to the CompositorView.
diff --git a/chrome/browser/android/payments/service_worker_payment_app_bridge.cc b/chrome/browser/android/payments/service_worker_payment_app_bridge.cc index 443e81a..3047a45 100644 --- a/chrome/browser/android/payments/service_worker_payment_app_bridge.cc +++ b/chrome/browser/android/payments/service_worker_payment_app_bridge.cc
@@ -10,7 +10,7 @@ #include "base/android/jni_string.h" #include "base/android/scoped_java_ref.h" #include "chrome/browser/profiles/profile_manager.h" -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/payment_app_provider.h" #include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/autofill/android/personal_data_manager_android.h b/chrome/browser/autofill/android/personal_data_manager_android.h index 15013b1..5d82d1d 100644 --- a/chrome/browser/autofill/android/personal_data_manager_android.h +++ b/chrome/browser/autofill/android/personal_data_manager_android.h
@@ -11,7 +11,7 @@ #include "base/memory/weak_ptr.h" #include "components/autofill/core/browser/personal_data_manager.h" #include "components/autofill/core/browser/personal_data_manager_observer.h" -#include "components/payments/address_normalizer.h" +#include "components/payments/core/address_normalizer.h" namespace autofill {
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index bf9b94a..8adb92cdde 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -277,7 +277,7 @@ #include "chrome/browser/android/service_tab_launcher.h" #include "chrome/browser/android/tab_android.h" #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" -#include "components/payments/payment_request.mojom.h" +#include "components/payments/content/payment_request.mojom.h" #include "content/public/browser/android/java_interfaces.h" #include "ui/base/ui_base_paths.h" #else
diff --git a/chrome/browser/component_updater/OWNERS b/chrome/browser/component_updater/OWNERS index 859891f..5292cc6 100644 --- a/chrome/browser/component_updater/OWNERS +++ b/chrome/browser/component_updater/OWNERS
@@ -6,3 +6,5 @@ per-file ppapi_utils*=bbudge@chromium.org per-file ppapi_utils*=raymes@chromium.org + +# COMPONENT: Internals>Installer>Components
diff --git a/chrome/browser/diagnostics/OWNERS b/chrome/browser/diagnostics/OWNERS index 3aae3d6..cd426a40 100644 --- a/chrome/browser/diagnostics/OWNERS +++ b/chrome/browser/diagnostics/OWNERS
@@ -1 +1,3 @@ cpu@chromium.org + +# COMPONENT: Internals>PlatformIntegration
diff --git a/chrome/browser/extensions/blacklist_state_fetcher.cc b/chrome/browser/extensions/blacklist_state_fetcher.cc index 5af640d..86308b82 100644 --- a/chrome/browser/extensions/blacklist_state_fetcher.cc +++ b/chrome/browser/extensions/blacklist_state_fetcher.cc
@@ -7,7 +7,6 @@ #include "base/strings/stringprintf.h" #include "base/threading/thread_task_runner_handle.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/safe_browsing/protocol_manager_helper.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/common/safe_browsing/crx_info.pb.h" #include "google_apis/google_api_keys.h"
diff --git a/chrome/browser/extensions/blacklist_state_fetcher.h b/chrome/browser/extensions/blacklist_state_fetcher.h index cb5f651..d8d1aaa 100644 --- a/chrome/browser/extensions/blacklist_state_fetcher.h +++ b/chrome/browser/extensions/blacklist_state_fetcher.h
@@ -13,7 +13,7 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/safe_browsing/protocol_manager_helper.h" +#include "components/safe_browsing_db/util.h" #include "extensions/browser/blacklist_state.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher_delegate.h"
diff --git a/chrome/browser/extensions/component_extensions_whitelist/OWNERS b/chrome/browser/extensions/component_extensions_whitelist/OWNERS index e80a2f8..1e2130bf 100644 --- a/chrome/browser/extensions/component_extensions_whitelist/OWNERS +++ b/chrome/browser/extensions/component_extensions_whitelist/OWNERS
@@ -9,3 +9,6 @@ dglazkov@chromium.org jam@chromium.org jochen@chromium.org + +# TEAM: extensions-dev@chromium.org +# COMPONENT: Platform>Extensions
diff --git a/chrome/browser/first_run/OWNERS b/chrome/browser/first_run/OWNERS index 9f9db77..1ac84ce6 100644 --- a/chrome/browser/first_run/OWNERS +++ b/chrome/browser/first_run/OWNERS
@@ -1,3 +1,5 @@ cpu@chromium.org gab@chromium.org grt@chromium.org + +# COMPONENT: UI>Browser>FirstRun
diff --git a/chrome/browser/first_run/upgrade_util_win.cc b/chrome/browser/first_run/upgrade_util_win.cc index 9670c26..266f9b9 100644 --- a/chrome/browser/first_run/upgrade_util_win.cc +++ b/chrome/browser/first_run/upgrade_util_win.cc
@@ -30,6 +30,7 @@ #include "chrome/browser/shell_integration.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "chrome/install_static/install_util.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_constants.h" #include "chrome/installer/util/install_util.h" @@ -57,10 +58,8 @@ if (!FAILED(ipl.CreateInstance(__uuidof(ProcessLauncherClass)))) { ULONG_PTR phandle = NULL; DWORD id = GetCurrentProcessId(); - BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - if (!FAILED(ipl->LaunchCmdElevated(dist->GetAppGuid().c_str(), - google_update::kRegRenameCmdField, - id, + if (!FAILED(ipl->LaunchCmdElevated(install_static::GetAppGuid(), + google_update::kRegRenameCmdField, id, &phandle))) { HANDLE handle = HANDLE(phandle); WaitForSingleObject(handle, INFINITE);
diff --git a/chrome/browser/google/google_update_win.cc b/chrome/browser/google/google_update_win.cc index 0c0d6cc1..c70b2a1 100644 --- a/chrome/browser/google/google_update_win.cc +++ b/chrome/browser/google/google_update_win.cc
@@ -33,6 +33,7 @@ #include "base/win/windows_version.h" #include "chrome/common/url_constants.h" #include "chrome/grit/generated_resources.h" +#include "chrome/install_static/install_util.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/helper.h" @@ -562,15 +563,14 @@ // Get a reference to the Chrome app in the bundle. if (!app_) { - base::string16 app_guid = - BrowserDistribution::GetDistribution()->GetAppGuid(); - DCHECK(!app_guid.empty()); + const wchar_t* app_guid = install_static::GetAppGuid(); + DCHECK(app_guid); + DCHECK(*app_guid); base::win::ScopedComPtr<IDispatch> dispatch; // It is common for this call to fail with APP_USING_EXTERNAL_UPDATER if // an auto update is in progress. - hresult = app_bundle_->createInstalledApp( - base::win::ScopedBstr(app_guid.c_str())); + hresult = app_bundle_->createInstalledApp(base::win::ScopedBstr(app_guid)); if (FAILED(hresult)) return hresult; // Move the IAppBundleWeb reference into a local now so that failures from
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.cc b/chrome/browser/payments/chrome_payment_request_delegate.cc index 58a6492..919fd539 100644 --- a/chrome/browser/payments/chrome_payment_request_delegate.cc +++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
@@ -8,7 +8,7 @@ #include "chrome/browser/autofill/personal_data_manager_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_dialogs.h" -#include "components/payments/payment_request_dialog.h" +#include "components/payments/content/payment_request_dialog.h" #include "content/public/browser/web_contents.h" namespace payments {
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.h b/chrome/browser/payments/chrome_payment_request_delegate.h index 25fb740..5423c52 100644 --- a/chrome/browser/payments/chrome_payment_request_delegate.h +++ b/chrome/browser/payments/chrome_payment_request_delegate.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ #include "base/macros.h" -#include "components/payments/payment_request_delegate.h" +#include "components/payments/content/payment_request_delegate.h" namespace content { class WebContents;
diff --git a/chrome/browser/payments/payment_request_factory.cc b/chrome/browser/payments/payment_request_factory.cc index 110e753..fc6c4ca 100644 --- a/chrome/browser/payments/payment_request_factory.cc +++ b/chrome/browser/payments/payment_request_factory.cc
@@ -9,8 +9,8 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "chrome/browser/payments/chrome_payment_request_delegate.h" -#include "components/payments/payment_request_delegate.h" -#include "components/payments/payment_request_web_contents_manager.h" +#include "components/payments/content/payment_request_delegate.h" +#include "components/payments/content/payment_request_web_contents_manager.h" #include "content/public/browser/web_contents.h" namespace payments {
diff --git a/chrome/browser/payments/payment_request_factory.h b/chrome/browser/payments/payment_request_factory.h index 457a2205..f2120f29 100644 --- a/chrome/browser/payments/payment_request_factory.h +++ b/chrome/browser/payments/payment_request_factory.h
@@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_FACTORY_H_ #define CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_FACTORY_H_ -#include "components/payments/payment_request.mojom.h" +#include "components/payments/content/payment_request.mojom.h" #include "mojo/public/cpp/bindings/binding.h" namespace content {
diff --git a/chrome/browser/printing/pdf_to_emf_converter.cc b/chrome/browser/printing/pdf_to_emf_converter.cc index f5066dc4..84a9c21 100644 --- a/chrome/browser/printing/pdf_to_emf_converter.cc +++ b/chrome/browser/printing/pdf_to_emf_converter.cc
@@ -373,8 +373,7 @@ reinterpret_cast<const EMRGDICOMMENT*>(emf_record); const char* data = reinterpret_cast<const char*>(comment->Data); const uint16_t* ptr = reinterpret_cast<const uint16_t*>(data); - int ret = - ExtEscape(hdc, POSTSCRIPT_PASSTHROUGH, 2 + *ptr, data, 0, nullptr); + int ret = ExtEscape(hdc, PASSTHROUGH, 2 + *ptr, data, 0, nullptr); DCHECK_EQ(*ptr, ret); } }
diff --git a/chrome/browser/resources/inline_login/inline_login.html b/chrome/browser/resources/inline_login/inline_login.html index bf65d14..d7745f7 100644 --- a/chrome/browser/resources/inline_login/inline_login.html +++ b/chrome/browser/resources/inline_login/inline_login.html
@@ -2,6 +2,7 @@ <html i18n-values="dir:textdirection;lang:language"> <head> <title i18n-content="title"></title> + <link rel="import" href="chrome://resources/html/polymer.html"> <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/iron-icons/iron-icons.html"> <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
diff --git a/chrome/browser/resources/md_downloads/compiled_resources2.gyp b/chrome/browser/resources/md_downloads/compiled_resources2.gyp index 9d15a90..a435a08c 100644 --- a/chrome/browser/resources/md_downloads/compiled_resources2.gyp +++ b/chrome/browser/resources/md_downloads/compiled_resources2.gyp
@@ -66,6 +66,7 @@ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util', '<(DEPTH)/ui/webui/resources/cr_elements/cr_action_menu/compiled_resources2.gyp:cr_action_menu', '<(DEPTH)/ui/webui/resources/cr_elements/cr_toolbar/compiled_resources2.gyp:cr_toolbar', + '<(DEPTH)/third_party/polymer/v1_0/components-chromium/iron-a11y-announcer/compiled_resources2.gyp:iron-a11y-announcer-extracted', '<(DEPTH)/third_party/polymer/v1_0/components-chromium/paper-menu/compiled_resources2.gyp:paper-menu-extracted', 'action_service', ],
diff --git a/chrome/browser/resources/md_downloads/manager.html b/chrome/browser/resources/md_downloads/manager.html index 895a11a..fa6a529 100644 --- a/chrome/browser/resources/md_downloads/manager.html +++ b/chrome/browser/resources/md_downloads/manager.html
@@ -3,6 +3,7 @@ <link rel="import" href="chrome://resources/html/cr/ui/command.html"> <link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/util.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-announcer/iron-a11y-announcer.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html"> <link rel="import" href="chrome://downloads/action_service.html"> <link rel="import" href="chrome://downloads/constants.html">
diff --git a/chrome/browser/resources/md_downloads/manager.js b/chrome/browser/resources/md_downloads/manager.js index 743aacd..d01c3d3 100644 --- a/chrome/browser/resources/md_downloads/manager.js +++ b/chrome/browser/resources/md_downloads/manager.js
@@ -89,6 +89,16 @@ /** @private */ itemsChanged_: function() { this.hasDownloads_ = this.items_.length > 0; + + if (this.inSearchMode_) { + Polymer.IronA11yAnnouncer.requestAvailability(); + this.fire('iron-announce', { + text: this.hasDownloads_ ? + loadTimeData.getStringF( + 'searchResultsFor', this.$.toolbar.getSearchText()) : + this.noDownloadsText_() + }); + } }, /**
diff --git a/chrome/browser/resources/md_downloads/toolbar.js b/chrome/browser/resources/md_downloads/toolbar.js index 4a40daa..d533889 100644 --- a/chrome/browser/resources/md_downloads/toolbar.js +++ b/chrome/browser/resources/md_downloads/toolbar.js
@@ -27,8 +27,12 @@ /** @return {boolean} Whether "Clear all" should be allowed. */ canClearAll: function() { - return !this.$.toolbar.getSearchField().getValue() && - this.downloadsShowing; + return this.getSearchText().length == 0 && this.downloadsShowing; + }, + + /** @return {string} The full text being searched. */ + getSearchText: function() { + return this.$.toolbar.getSearchField().getValue(); }, onFindCommand: function() {
diff --git a/chrome/browser/resources/md_extensions/item.html b/chrome/browser/resources/md_extensions/item.html index 845f318..e468731 100644 --- a/chrome/browser/resources/md_extensions/item.html +++ b/chrome/browser/resources/md_extensions/item.html
@@ -31,21 +31,18 @@ width: 36px; } - #card, - #card-wrapper { - min-height: 154px; - width: 400px; - } - - #card-wrapper { + #card { @apply(--shadow-elevation-2dp); background: white; - } - - #card { display: flex; flex-direction: column; font-size: 13px; + height: 160px; + width: 400px; + } + + #card.dev-mode { + height: 208px; } #card.disabled { @@ -55,27 +52,33 @@ #main { display: flex; flex-grow: 1; - padding: 16px; + padding: 16px 20px 17px; } #content { -webkit-margin-start: 24px; + display: flex; + flex-direction: column; width: 100%; } #name-and-version { + line-height: 15px; margin-bottom: 4px; } #name { -webkit-margin-end: 8px; - color: var(--paper-grey-800); + color: #333; } - #description { + #description, + #warnings { + flex-grow: 1; margin-bottom: 8px; } + #description, #version, #extension-id, #inspect-views, @@ -91,40 +94,47 @@ #inspect-views paper-button { color: var(--google-blue-700); + height: 20px; + padding: 0; + text-transform: none; } #button-strip { + -webkit-padding-end: 4px; + -webkit-padding-start: 20px; border-top: 1px solid var(--paper-grey-400); + box-sizing: border-box; + height: 48px; + padding-bottom: 8px; + padding-top: 8px; } #source-indicator { - align-items: center; - align-self: flex-end; - border-radius: 0 2px; - color: var(--paper-grey-800); - display: flex; - min-height: 32px; - padding: 0 8px; + -webkit-margin-start: 30px; + margin-top: 30px; position: absolute; - white-space: nowrap; } #source-indicator iron-icon { - height: 16px; - width: 16px; + height: 22px; + width: 22px; } - #source-indicator span { - -webkit-margin-end: 8px; - display: none; - } - - #source-indicator:hover { - background-color: var(--paper-grey-700); + #source-indicator-text { + -webkit-margin-start: 11px; /* To align with the center of the icon. */ + background: black; + border-radius: 2px; color: white; + display: none; + margin-top: 8px; + opacity: 0.6; + padding: 8px 12px; + position: absolute; + transform: translateX(-50%); /* Move back 50% of width so that the + text and icon share an x-center. */ } - #source-indicator:hover span { + #source-indicator:hover #source-indicator-text { display: block; } @@ -136,115 +146,109 @@ #button-strip paper-button { align-items: center; display: flex; - margin: 4px; + margin: 0 4px; min-height: 32px; padding: 0 12px; text-transform: uppercase; } - #enable-toggle { - -webkit-margin-end: 16px; + .action-button { + color: var(--google-blue-500); } - .warning { - align-items: center; - display: flex; - font-size: 13px; - justify-content: space-between; - padding: 12px 16px; - } - - .warning paper-button { - -webkit-margin-start: 12px; - align-items: center; - display: flex; - text-transform: uppercase; - } - - .severe.warning { - background-color: var(--paper-red-50); - color: var(--paper-red-700); - } - - .mild.warning { - background-color: var(--paper-yellow-50); - color: var(--paper-grey-600); + #warnings { + color: var(--google-red-700); } #blacklisted-warning:empty { display: none; } </style> - <div id="card-wrapper" class$="[[computeClasses_(data.state)]]"> - <div id="card"> + <div id="card" class$="[[computeClasses_(data.state, inDevMode)]]"> + <div id="main"> <template is="dom-if" if="[[computeSourceIndicatorIcon_(data.*)]]"> <div id="source-indicator"> - <span>[[computeSourceIndicatorText_(data.*)]]</span> <iron-icon icon="[[computeSourceIndicatorIcon_(data.*)]]"> </iron-icon> + <div id="source-indicator-text"> + [[computeSourceIndicatorText_(data.*)]] + </div> </div> </template> - <div id="main"> - <div id="icon-wrapper"> - <img alt="" id="icon" src="[[data.iconUrl]]"> - </div> - <div id="content"> - <div id="name-and-version" class="layout horizontal center"> - <div id="name">[[data.name]]</div> - <template is="dom-if" if="[[inDevMode]]"> - <span id="version">[[data.version]]</span> - </template> - </div> - <div id="description">[[data.description]]</div> + <div id="icon-wrapper"> + <img alt="" id="icon" src="[[data.iconUrl]]"> + </div> + <div id="content"> + <div id="name-and-version" class="layout horizontal center"> + <div id="name">[[data.name]]</div> <template is="dom-if" if="[[inDevMode]]"> - <div id="extension-id">[[data.id]]</div> - <div id="inspect-views"> - <span>$i18n{itemInspectViews}</span> - <template is="dom-repeat" items="[[data.views]]"> - <paper-button on-tap="onInspectTap_"> - [[computeInspectLabel_(item)]] - </paper-button> - </template> - </div> - </div> + <span id="version">[[data.version]]</span> </template> </div> - </div> - <div id="button-strip" class="layout horizontal"> - <div class="layout flex horizontal center"> - <paper-button id="details-button" on-tap="onDetailsTap_"> - $i18n{itemDetails} - </paper-button> - <paper-button id="errors-button" on-tap="onErrorsTap_" - hidden$="[[computeErrorsHidden_(data.*)]]"> - $i18n{itemErrors} - </paper-button> - <paper-button id="remove-button" on-tap="onRemoveTap_"> - $i18n{itemRemove} - </paper-button> + <div id="description" hidden$="[[hasWarnings_(data.*)]]"> + [[data.description]] </div> - <paper-toggle-button id="enable-toggle" - checked="[[isEnabled_(data.state)]]" on-change="onEnableChange_"> - </paper-toggle-button> + <div id="warnings" hidden$="[[!hasWarnings_(data.*)]]"> + <div id="suspicious-warning" + hidden$="[[!data.disableReasons.suspiciousInstall]]"> + $i18n{itemSuspiciousInstall} + </div> + <div id="corrupted-warning" + hidden$="[[!data.disableReasons.corruptInstall]]"> + $i18n{itemCorruptInstall} + </div> + <div id="blacklisted-warning"><!-- No whitespace + -->[[data.blacklistText]]<!-- so we can use :empty in css. + --></div> + </div> + <template is="dom-if" if="[[inDevMode]]"> + <div id="extension-id">[[data.id]]</div> + <template is="dom-if" + if="[[!computeInspectViewsHidden_(data.views)]]"> + <div id="inspect-views"> + <span>$i18n{itemInspectViews}</span> + <paper-button on-tap="onInspectTap_"> + [[computeFirstInspectLabel_(data.views)]] + </paper-button> + <paper-button + hidden$="[[computeExtraViewsHidden_(data.views)]]" + on-tap="onExtraInspectTap_"> + [[computeExtraInspectLabel_(data.views)]] + </paper-button> + </div> + </template> + </template> </div> </div> - <template is="dom-if" if="[[hasWarnings_(data.*)]]"> - <div id="suspicious-warning" class="warning mild" - hidden$="[[!data.disableReasons.suspiciousInstall]]"> - $i18n{itemSuspiciousInstall} - </div> - <div id="corrupted-warning" class="warning severe" - hidden$="[[!data.disableReasons.corruptInstall]]"> - <span>$i18n{itemCorruptInstall}</span> - <paper-button id="repair-button" on-tap="onRepairTap_"> - $i18n{itemRepair} + <div id="button-strip" class="layout horizontal"> + <div class="layout flex horizontal center"> + <paper-button id="details-button" on-tap="onDetailsTap_"> + $i18n{itemDetails} + </paper-button> + <paper-button id="remove-button" on-tap="onRemoveTap_"> + $i18n{itemRemove} + </paper-button> + <paper-button id="errors-button" on-tap="onErrorsTap_" + hidden$="[[computeErrorsHidden_(data.*)]]"> + $i18n{itemErrors} </paper-button> </div> - <div id="blacklisted-warning" class="warning severe"><!-- No whitespace - -->[[data.blacklistText]]<!-- ... so we can use :empty in css - --></div> - </template> + <paper-button id="repair-button" class="action-button" + on-tap="onRepairTap_" + hidden$="[[!data.disableReasons.corruptInstall]]"> + $i18n{itemRepair} + </paper-button> + <paper-button id="reload-button" on-tap="onReloadTap_" + class="action-button" + hidden$="[[!isTerminated_(data.state)]]"> + $i18n{itemReload} + </paper-button> + <paper-toggle-button id="enable-toggle" class="action-button" + checked="[[isEnabled_(data.state)]]" on-change="onEnableChange_" + hidden$="[[!showEnableToggle_(data.*)]]"> + </paper-toggle-button> + </div> </div> </template> <script src="chrome://extensions/item.js"></script>
diff --git a/chrome/browser/resources/md_extensions/item.js b/chrome/browser/resources/md_extensions/item.js index ae9df0a..cd03c28 100644 --- a/chrome/browser/resources/md_extensions/item.js +++ b/chrome/browser/resources/md_extensions/item.js
@@ -47,6 +47,9 @@ inspectItemView: assertNotReached, /** @param {string} id */ + reloadItem: assertNotReached, + + /** @param {string} id */ repairItem: assertNotReached, /** @param {string} id */ @@ -135,7 +138,17 @@ * @private */ onInspectTap_: function(e) { - this.delegate.inspectItemView(this.data.id, e.model.item); + this.delegate.inspectItemView(this.data.id, this.data.views[0]); + }, + + /** @private */ + onExtraInspectTap_: function() { + this.fire('extension-item-show-details', {data: this.data}); + }, + + /** @private */ + onReloadTap_: function() { + this.delegate.reloadItem(this.data.id); }, /** @private */ @@ -160,9 +173,34 @@ assertNotReached(); // FileNotFound. }, - /** @private */ + /** + * Returns true if the enable toggle should be shown. + * @return {boolean} + * @private + */ + showEnableToggle_: function() { + return !this.isTerminated_() && !this.data.disableReasons.corruptInstall; + }, + + /** + * Returns true if the extension is in the terminated state. + * @return {boolean} + * @private + */ + isTerminated_: function() { + return this.data.state == + chrome.developerPrivate.ExtensionState.TERMINATED; + }, + + /** + * return {string} + * @private + */ computeClasses_: function() { - return this.isEnabled_() ? 'enabled' : 'disabled'; + var classes = this.isEnabled_() ? 'enabled' : 'disabled'; + if (this.inDevMode) + classes += ' dev-mode'; + return classes; }, /** @@ -194,10 +232,19 @@ }, /** - * @param {chrome.developerPrivate.ExtensionView} view + * @return {boolean} * @private */ - computeInspectLabel_: function(view) { + computeInspectViewsHidden_: function() { + return !this.data.views || this.data.views.length == 0; + }, + + /** + * @return {string} + * @private + */ + computeFirstInspectLabel_: function() { + var view = this.data.views[0]; // Trim the "chrome-extension://<id>/". var url = new URL(view.url); var label = view.url; @@ -210,6 +257,10 @@ (view.renderProcessId == -1 ? ' ' + this.i18n('viewInactive') : '') + (view.isIframe ? ' ' + this.i18n('viewIframe') : ''); + var index = this.data.views.indexOf(view); + assert(index >= 0); + if (index < this.data.views.length - 1) + label += ','; return label; }, @@ -217,6 +268,23 @@ * @return {boolean} * @private */ + computeExtraViewsHidden_: function() { + return this.data.views.length <= 1; + }, + + /** + * @return {string} + * @private + */ + computeExtraInspectLabel_: function() { + return loadTimeData.getStringF('itemInspectViewsExtra', + this.data.views.length - 1); + }, + + /** + * @return {boolean} + * @private + */ hasWarnings_: function() { return this.data.disableReasons.corruptInstall || this.data.disableReasons.suspiciousInstall ||
diff --git a/chrome/browser/resources/md_extensions/service.js b/chrome/browser/resources/md_extensions/service.js index 08abe7d..147e09d4 100644 --- a/chrome/browser/resources/md_extensions/service.js +++ b/chrome/browser/resources/md_extensions/service.js
@@ -222,6 +222,11 @@ }, /** @override */ + reloadItem: function(id) { + chrome.developerPrivate.reload(id, {failQuietly: false}); + }, + + /** @override */ repairItem: function(id) { chrome.developerPrivate.repairExtension(id); },
diff --git a/chrome/browser/resources/options/chromeos/OWNERS b/chrome/browser/resources/options/chromeos/OWNERS index 3d5f91e..66764c92 100644 --- a/chrome/browser/resources/options/chromeos/OWNERS +++ b/chrome/browser/resources/options/chromeos/OWNERS
@@ -1,3 +1,4 @@ +# This UI is deprecated. See chrome/browser/resources/settings/ instead. achuith@chromium.org stevenjb@chromium.org xiyuan@chromium.org
diff --git a/chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js b/chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js index b6d0678..2cf087d 100644 --- a/chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js +++ b/chrome/browser/resources/options/chromeos/quick_unlock_configure_overlay.js
@@ -65,10 +65,15 @@ settings.navigateTo(settings.Route.LOCK_SCREEN); var lockScreen = document.querySelector('settings-lock-screen'); - var checkbox = - lockScreen.root.querySelector( - 'div.settings-box.single-column.screen-lock'); - checkbox.hidden = true; + // On settings the screen lock is part of the lock screen, but on options + // it is already part of the sync page, so hide the lock screen version on + // options. + var screenLockDiv = lockScreen.root.querySelector('#screenLockDiv'); + screenLockDiv.hidden = true; + + // The fingerprint settings on options is always hidden. + var fingerprintDiv = lockScreen.root.querySelector('#fingerprintDiv'); + fingerprintDiv.hidden = true; var passwordPrompt = lockScreen.root. querySelector('settings-password-prompt-dialog');
diff --git a/chrome/browser/resources/settings/internet_page/internet_page.html b/chrome/browser/resources/settings/internet_page/internet_page.html index 1a07d2b..8d6eecf 100644 --- a/chrome/browser/resources/settings/internet_page/internet_page.html +++ b/chrome/browser/resources/settings/internet_page/internet_page.html
@@ -31,9 +31,8 @@ </style> <settings-animated-pages id="pages" section="internet"> <neon-animatable route-path="default"> - <network-summary on-show-detail="onShowDetail_" - default-network="{{defaultNetwork}}" - on-show-known-networks="onShowKnownNetworks_" + <network-summary default-network="{{defaultNetwork}}" + device-states="{{deviceStates}}" global-policy="[[globalPolicy_]]" networking-private="[[networkingPrivate]]"> </network-summary> @@ -80,6 +79,7 @@ </div> </template> </neon-animatable> + <template is="dom-if" route-path="/networkDetail" no-search> <settings-subpage page-title="$i18n{internetDetailPageTitle}"> <settings-internet-detail-page prefs="{{prefs}}" @@ -89,11 +89,11 @@ </settings-internet-detail-page> </settings-subpage> </template> + <template is="dom-if" route-path="/knownNetworks" no-search> <settings-subpage page-title="$i18n{internetKnownNetworksPageTitle}"> <settings-internet-known-networks-page network-type="[[knownNetworksType_]]" - on-show-detail="onShowDetail_" networking-private="[[networkingPrivate]]"> </settings-internet-known-networks-page> </settings-subpage>
diff --git a/chrome/browser/resources/settings/internet_page/internet_page.js b/chrome/browser/resources/settings/internet_page/internet_page.js index 8854cba..af8d951 100644 --- a/chrome/browser/resources/settings/internet_page/internet_page.js +++ b/chrome/browser/resources/settings/internet_page/internet_page.js
@@ -29,6 +29,25 @@ }, /** + * The device state for each network device type. Set by network-summary. + * @type {!Object<chrome.networkingPrivate.DeviceStateProperties>|undefined} + * @private + */ + deviceStates: { + type: Object, + notify: true, + }, + + /** + * Highest priority connected network or null. Set by network-summary. + * @type {?CrOnc.NetworkStateProperties|undefined} + */ + defaultNetwork: { + type: Object, + notify: true, + }, + + /** * The network type for the known networks subpage. * @private */ @@ -59,21 +78,38 @@ }, }, + // Element event listeners + listeners: { + 'device-enabled-toggled': 'onDeviceEnabledToggled_', + 'show-detail': 'onShowDetail_', + 'show-known-networks': 'onShowKnownNetworks_', + }, + + // chrome.networkingPrivate listeners + /** @private {Function} */ + onExtensionAddedListener_: null, + + /** @private {Function} */ + onExtensionRemovedListener_: null, + + /** @private {Function} */ + onExtensionDisabledListener_: null, + /** @override */ attached: function() { - this.boundOnExtensionAdded_ = this.boundOnExtensionAdded_ || + this.onExtensionAddedListener_ = this.onExtensionAddedListener_ || this.onExtensionAdded_.bind(this); - chrome.management.onInstalled.addListener(this.boundOnExtensionAdded_); - chrome.management.onEnabled.addListener(this.boundOnExtensionAdded_); + chrome.management.onInstalled.addListener(this.onExtensionAddedListener_); + chrome.management.onEnabled.addListener(this.onExtensionAddedListener_); - this.boundOnExtensionRemoved_ = this.boundOnExtensionRemoved_ || + this.onExtensionRemovedListener_ = this.onExtensionRemovedListener_ || this.onExtensionRemoved_.bind(this); chrome.management.onUninstalled.addListener( - this.boundOnExtensionRemoved_); + this.onExtensionRemovedListener_); - this.boundOnExtensionDisabled_ = this.boundOnExtensionDisabled_ || + this.onExtensionDisabledListener_ = this.onExtensionDisabledListener_ || this.onExtensionDisabled_.bind(this); - chrome.management.onDisabled.addListener(this.boundOnExtensionDisabled_); + chrome.management.onDisabled.addListener(this.onExtensionDisabledListener_); chrome.management.getAll(this.onGetAllExtensions_.bind(this)); @@ -85,32 +121,27 @@ /** @override */ detached: function() { chrome.management.onInstalled.removeListener( - assert(this.boundOnExtensionAdded_)); + assert(this.onExtensionAddedListener_)); chrome.management.onEnabled.removeListener( - assert(this.boundOnExtensionAdded_)); + assert(this.onExtensionAddedListener_)); chrome.management.onUninstalled.removeListener( - assert(this.boundOnExtensionRemoved_)); + assert(this.onExtensionRemovedListener_)); chrome.management.onDisabled.removeListener( - assert(this.boundOnExtensionDisabled_)); + assert(this.onExtensionDisabledListener_)); }, /** - * Reference to the bound listener, such that it can be removed on detach. - * @private {Function} + * Event triggered by a device state enabled toggle. + * @param {!{detail: {enabled: boolean, + * type: chrome.networkingPrivate.NetworkType}}} event + * @private */ - boundOnExtensionAdded_: null, - - /** - * Reference to the bound listener, such that it can be removed on detach. - * @private {Function} - */ - boundOnExtensionRemoved_: null, - - /** - * Reference to the bound listener, such that it can be removed on detach. - * @private {Function} - */ - boundOnExtensionDisabled_: null, + onDeviceEnabledToggled_: function(event) { + if (event.detail.enabled) + this.networkingPrivate.enableNetworkType(event.detail.type); + else + this.networkingPrivate.disableNetworkType(event.detail.type); + }, /** * @param {!{detail: !CrOnc.NetworkStateProperties}} event
diff --git a/chrome/browser/resources/settings/internet_page/network_summary.html b/chrome/browser/resources/settings/internet_page/network_summary.html index 46d05049..211fac2 100644 --- a/chrome/browser/resources/settings/internet_page/network_summary.html +++ b/chrome/browser/resources/settings/internet_page/network_summary.html
@@ -9,13 +9,11 @@ <template is="dom-repeat" items="[[activeNetworkStates_]]"> <network-summary-item id="[[item.Type]]" active-network-state="[[item]]" - device-state="[[get(item.Type, deviceStates_)]]" + device-state="[[get(item.Type, deviceStates)]]" network-state-list="[[get(item.Type, networkStateLists_)]]" network-type="[[item.Type]]" networking-private="[[networkingPrivate]]" - on-expanded="onExpanded_" - on-selected="onSelected_" - on-device-enabled-toggled="onDeviceEnabledToggled_"> + on-expanded="onExpanded_" on-selected="onSelected_"> </network-summary-item> </template> </div>
diff --git a/chrome/browser/resources/settings/internet_page/network_summary.js b/chrome/browser/resources/settings/internet_page/network_summary.js index c27bb32..0b65a68 100644 --- a/chrome/browser/resources/settings/internet_page/network_summary.js +++ b/chrome/browser/resources/settings/internet_page/network_summary.js
@@ -61,11 +61,12 @@ * The device state for each network device type. * @private {DeviceStateObject} */ - deviceStates_: { + deviceStates: { type: Object, value: function() { return {}; }, + notify: true, }, /** @@ -178,20 +179,6 @@ }, /** - * Event triggered when the enabled state of a network-summary-item is - * toggled. - * @param {!{detail: {enabled: boolean, - * type: chrome.networkingPrivate.NetworkType}}} event - * @private - */ - onDeviceEnabledToggled_: function(event) { - if (event.detail.enabled) - this.networkingPrivate.enableNetworkType(event.detail.type); - else - this.networkingPrivate.disableNetworkType(event.detail.type); - }, - - /** * networkingPrivate.onNetworkListChanged event callback. * @private */ @@ -346,7 +333,7 @@ newDeviceStates[state.Type] = state; } } else { - newDeviceStates = this.deviceStates_; + newDeviceStates = this.deviceStates; } // Clear any current networks. @@ -408,7 +395,7 @@ this.activeNetworkIds_.add(state.GUID); } - this.deviceStates_ = newDeviceStates; + this.deviceStates = newDeviceStates; this.networkStateLists_ = newNetworkStateLists; // Set activeNetworkStates last to rebuild the dom-repeat. this.activeNetworkStates_ = newActiveNetworkStates;
diff --git a/chrome/browser/resources/settings/people_page/import_data_dialog.html b/chrome/browser/resources/settings/people_page/import_data_dialog.html index 989941b..dd9124d 100644 --- a/chrome/browser/resources/settings/people_page/import_data_dialog.html +++ b/chrome/browser/resources/settings/people_page/import_data_dialog.html
@@ -6,12 +6,11 @@ <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <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="../controls/settings_checkbox.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html"> <link rel="import" href="../controls/settings_toggle_button.html"> <link rel="import" href="../i18n_setup.html"> <link rel="import" href="../icons.html"> <link rel="import" href="import_data_browser_proxy.html"> -<link rel="import" href="../prefs/prefs_behavior.html"> <link rel="import" href="../settings_vars_css.html"> <dom-module id="settings-import-data-dialog"> @@ -20,7 +19,6 @@ .description { align-items: center; display: flex; - min-height: var(--settings-row-min-height); } paper-spinner { @@ -33,6 +31,10 @@ margin: auto; width: 100%; } + + .row { + min-height: var(--settings-row-min-height); + } </style> <dialog is="cr-dialog" id="dialog" close-text="$i18n{close}" ignore-popstate> <div class="title">$i18n{importTitle}</div> @@ -41,8 +43,8 @@ importStatusEnum_.SUCCEEDED, importStatus_)]]"> <iron-icon id="successIcon" icon="settings:check-circle"> </iron-icon> - <div hidden$="[[!prefs.import_bookmarks.value]]"> - <div class="description">$i18n{importSuccess}</div> + <div hidden$="[[!showBookmarkSuccess_]]"> + <div class="description row">$i18n{importSuccess}</div> <settings-toggle-button class="start" label="$i18n{showBookmarksBar}" pref="{{prefs.bookmark_bar.show_on_all_tabs}}"> @@ -61,32 +63,34 @@ </select> <span class="md-select-underline"></span> </span> - <div class="description">$i18n{importDescription}</div> - <settings-checkbox - hidden="[[!selected_.history]]" - pref="{{prefs.import_history}}" - label="$i18n{importHistory}"> - </settings-checkbox> - <settings-checkbox - hidden="[[!selected_.favorites]]" - pref="{{prefs.import_bookmarks}}" - label="$i18n{importFavorites}"> - </settings-checkbox> - <settings-checkbox - hidden="[[!selected_.passwords]]" - pref="{{prefs.import_saved_passwords}}" - label="$i18n{importPasswords}"> - </settings-checkbox> - <settings-checkbox - hidden="[[!selected_.search]]" - pref="{{prefs.import_search_engine}}" - label="$i18n{importSearch}"> - </settings-checkbox> - <settings-checkbox - hidden="[[!selected_.autofillFormData]]" - pref="{{prefs.import_autofill_form_data}}" - label="$i18n{importAutofillFormData}"> - </settings-checkbox> + <div class="description row">$i18n{importDescription}</div> + <div on-change="onCheckboxChange_"> + <div class="row" hidden$="[[!selected_.history]]"> + <paper-checkbox id="history" checked> + $i18n{importHistory} + </paper-checkbox> + </div> + <div class="row" hidden$="[[!selected_.favorites]]"> + <paper-checkbox id="favorites" checked> + $i18n{importFavorites} + </paper-checkbox> + </div> + <div class="row" hidden$="[[!selected_.passwords]]"> + <paper-checkbox id="passwords" checked> + $i18n{importPasswords}" + </paper-checkbox> + </div> + <div class="row" hidden$="[[!selected_.search]]"> + <paper-checkbox id="search" checked> + $i18n{importSearch} + </paper-checkbox> + </div> + <div class="row" hidden="[[!selected_.autofillFormData]]"> + <paper-checkbox id="autofillFormData" checked> + $i18n{importAutofillFormData} + </paper-checkbox> + </div> + </div> </div> </div> <div class="button-container">
diff --git a/chrome/browser/resources/settings/people_page/import_data_dialog.js b/chrome/browser/resources/settings/people_page/import_data_dialog.js index 6e0f1c2c..a63b308 100644 --- a/chrome/browser/resources/settings/people_page/import_data_dialog.js +++ b/chrome/browser/resources/settings/people_page/import_data_dialog.js
@@ -9,7 +9,7 @@ Polymer({ is: 'settings-import-data-dialog', - behaviors: [I18nBehavior, WebUIListenerBehavior, PrefsBehavior], + behaviors: [I18nBehavior, WebUIListenerBehavior], properties: { /** @private {!Array<!settings.BrowserProfile>} */ @@ -41,11 +41,10 @@ type: Object, value: settings.ImportDataStatus, }, - }, - observers: [ - 'prefsChanged_(selected_, prefs.*)', - ], + /** @private */ + showBookmarkSuccess_: Boolean, + }, /** @private {?settings.ImportDataBrowserProxy} */ browserProxy_: null, @@ -69,22 +68,24 @@ /** @param {settings.ImportDataStatus} importStatus */ function(importStatus) { this.importStatus_ = importStatus; + if (this.hasImportStatus_(settings.ImportDataStatus.SUCCEEDED)) { + this.showBookmarkSuccess_ = + this.$.favorites.checked && this.selected_.favorites; + } + if (this.hasImportStatus_(settings.ImportDataStatus.FAILED)) this.closeDialog_(); }.bind(this)); }, /** @private */ - prefsChanged_: function() { + onCheckboxChange_: function() { this.noImportDataTypeSelected_ = - !(this.getPref('import_history').value && this.selected_.history) && - !(this.getPref('import_bookmarks').value && this.selected_.favorites) && - !(this.getPref('import_saved_passwords').value && - this.selected_.passwords) && - !(this.getPref('import_search_engine').value && - this.selected_.search) && - !(this.getPref('import_autofill_form_data').value && - this.selected_.autofillFormData); + !(this.selected_.history && this.$.history.checked) && + !(this.selected_.favorites && this.$.favorites.checked) && + !(this.selected_.passwords && this.$.passwords.checked) && + !(this.selected_.search && this.$.search.checked) && + !(this.selected_.autofillFormData && this.$.autofillFormData.checked); }, /** @@ -115,6 +116,7 @@ /** @private */ onBrowserProfileSelectionChange_: function() { this.selected_ = this.browserProfiles_[this.$.browserSelect.selectedIndex]; + this.onCheckboxChange_(); }, /** @private */
diff --git a/chrome/browser/resources/settings/people_page/lock_screen.html b/chrome/browser/resources/settings/people_page/lock_screen.html index e1e610a6..6064de3 100644 --- a/chrome/browser/resources/settings/people_page/lock_screen.html +++ b/chrome/browser/resources/settings/people_page/lock_screen.html
@@ -42,7 +42,7 @@ </div> </div> - <div class="settings-box"> + <div id="screenLockDiv" class="settings-box"> <settings-toggle-button class="start" pref="{{prefs.settings.enable_screen_lock}}" label="$i18n{enableScreenlock}"> @@ -50,27 +50,29 @@ </div> <template is="dom-if" if="[[fingerprintUnlockEnabled_]]"> - <div class="settings-box"> - <settings-toggle-button class="start" - pref="{{prefs.settings.enable_quick_unlock_fingerprint}}" - label="$i18n{lockScreenFingerprintEnable}"> - </settings-toggle-button> - </div> - <iron-collapse - opened="[[prefs.settings.enable_quick_unlock_fingerprint.value]]"> - <div class="settings-box continuation" on-tap="onEditFingerprints_" - actionable> - <div class="start"> - $i18n{lockScreenEditFingerprints} - <div class="secondary" id="lockScreenEditFingerprintsSecondary"> - [[getDescriptionText_(numFingerprints_)]] - </div> - </div> - <button class="subpage-arrow" is="paper-icon-button-light" - aria-label="$i18n{lockScreenEditFingerprints}" - aria-describedby="lockScreenEditFingerprintsSecondary"></button> + <div id="fingerprintDiv"> + <div class="settings-box"> + <settings-toggle-button class="start" + pref="{{prefs.settings.enable_quick_unlock_fingerprint}}" + label="$i18n{lockScreenFingerprintEnable}"> + </settings-toggle-button> </div> - </iron-collapse> + <iron-collapse + opened="[[prefs.settings.enable_quick_unlock_fingerprint.value]]"> + <div class="settings-box continuation" on-tap="onEditFingerprints_" + actionable> + <div class="start"> + $i18n{lockScreenEditFingerprints} + <div class="secondary" id="lockScreenEditFingerprintsSecondary"> + [[getDescriptionText_(numFingerprints_)]] + </div> + </div> + <button class="subpage-arrow" is="paper-icon-button-light" + aria-label="$i18n{lockScreenEditFingerprints}" + aria-describedby="lockScreenEditFingerprintsSecondary"></button> + </div> + </iron-collapse> + </div> </template> <settings-password-prompt-dialog id="passwordPrompt"
diff --git a/chrome/browser/rlz/OWNERS b/chrome/browser/rlz/OWNERS index d1986d9..bee2d9df 100644 --- a/chrome/browser/rlz/OWNERS +++ b/chrome/browser/rlz/OWNERS
@@ -2,3 +2,4 @@ gwilson@chromium.org rogerta@chromium.org +# COMPONENT: Internals>Core
diff --git a/chrome/browser/safe_browsing/ping_manager.cc b/chrome/browser/safe_browsing/ping_manager.cc index b223a15f..b0d27cc 100644 --- a/chrome/browser/safe_browsing/ping_manager.cc +++ b/chrome/browser/safe_browsing/ping_manager.cc
@@ -4,64 +4,15 @@ #include "chrome/browser/safe_browsing/ping_manager.h" -#include <utility> - -#include "base/base64.h" -#include "base/logging.h" #include "base/memory/ptr_util.h" -#include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" -#include "base/values.h" #include "chrome/browser/safe_browsing/notification_image_reporter.h" #include "chrome/browser/safe_browsing/permission_reporter.h" -#include "components/data_use_measurement/core/data_use_user_data.h" #include "content/public/browser/browser_thread.h" -#include "google_apis/google_api_keys.h" -#include "net/base/escape.h" -#include "net/base/load_flags.h" -#include "net/log/net_log_source_type.h" -#include "net/ssl/ssl_info.h" -#include "net/url_request/url_fetcher.h" -#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" -#include "net/url_request/url_request_status.h" #include "third_party/skia/include/core/SkBitmap.h" -#include "url/gurl.h" using content::BrowserThread; -namespace { -// Returns a dictionary with "url"=|url-spec| and "data"=|payload| for -// netlogging the start phase of a ping. -std::unique_ptr<base::Value> NetLogPingStartCallback( - const net::NetLogWithSource& net_log, - const GURL& url, - const std::string& payload, - net::NetLogCaptureMode) { - std::unique_ptr<base::DictionaryValue> event_params( - new base::DictionaryValue()); - event_params->SetString("url", url.spec()); - event_params->SetString("payload", payload); - net_log.source().AddToEventParameters(event_params.get()); - return std::move(event_params); -} - -// Returns a dictionary with "url"=|url-spec|, "status"=|status| and -// "error"=|error| for netlogging the end phase of a ping. -std::unique_ptr<base::Value> NetLogPingEndCallback( - const net::NetLogWithSource& net_log, - const net::URLRequestStatus& status, - net::NetLogCaptureMode) { - std::unique_ptr<base::DictionaryValue> event_params( - new base::DictionaryValue()); - event_params->SetInteger("status", status.status()); - event_params->SetInteger("error", status.error()); - net_log.source().AddToEventParameters(event_params.get()); - return std::move(event_params); -} - -} // namespace - namespace safe_browsing { // SafeBrowsingPingManager implementation ---------------------------------- @@ -78,97 +29,18 @@ SafeBrowsingPingManager::SafeBrowsingPingManager( net::URLRequestContextGetter* request_context_getter, const SafeBrowsingProtocolConfig& config) - : client_name_(config.client_name), - request_context_getter_(request_context_getter), - url_prefix_(config.url_prefix) { - DCHECK(!url_prefix_.empty()); - + : BasePingManager(request_context_getter, config) { if (request_context_getter) { permission_reporter_ = base::MakeUnique<PermissionReporter>( request_context_getter->GetURLRequestContext()); notification_image_reporter_ = base::MakeUnique<NotificationImageReporter>( request_context_getter->GetURLRequestContext()); - - net_log_ = net::NetLogWithSource::Make( - request_context_getter->GetURLRequestContext()->net_log(), - net::NetLogSourceType::SAFE_BROWSING); } - - version_ = SafeBrowsingProtocolManagerHelper::Version(); } SafeBrowsingPingManager::~SafeBrowsingPingManager() { } -// net::URLFetcherDelegate implementation ---------------------------------- - -// All SafeBrowsing request responses are handled here. -void SafeBrowsingPingManager::OnURLFetchComplete( - const net::URLFetcher* source) { - net_log_.EndEvent( - net::NetLogEventType::SAFE_BROWSING_PING, - base::Bind(&NetLogPingEndCallback, net_log_, source->GetStatus())); - auto it = - std::find_if(safebrowsing_reports_.begin(), safebrowsing_reports_.end(), - [source](const std::unique_ptr<net::URLFetcher>& ptr) { - return ptr.get() == source; - }); - DCHECK(it != safebrowsing_reports_.end()); - safebrowsing_reports_.erase(it); -} - -// Sends a SafeBrowsing "hit" report. -void SafeBrowsingPingManager::ReportSafeBrowsingHit( - const safe_browsing::HitReport& hit_report) { - GURL report_url = SafeBrowsingHitUrl(hit_report); - std::unique_ptr<net::URLFetcher> report_ptr = net::URLFetcher::Create( - report_url, hit_report.post_data.empty() ? net::URLFetcher::GET - : net::URLFetcher::POST, - this); - net::URLFetcher* report = report_ptr.get(); - data_use_measurement::DataUseUserData::AttachToFetcher( - report, data_use_measurement::DataUseUserData::SAFE_BROWSING); - report_ptr->SetLoadFlags(net::LOAD_DISABLE_CACHE); - report_ptr->SetRequestContext(request_context_getter_.get()); - std::string post_data_base64; - if (!hit_report.post_data.empty()) { - report_ptr->SetUploadData("text/plain", hit_report.post_data); - base::Base64Encode(hit_report.post_data, &post_data_base64); - } - - net_log_.BeginEvent( - net::NetLogEventType::SAFE_BROWSING_PING, - base::Bind(&NetLogPingStartCallback, net_log_, - report_ptr->GetOriginalURL(), post_data_base64)); - - report->Start(); - safebrowsing_reports_.insert(std::move(report_ptr)); -} - -// Sends threat details for users who opt-in. -void SafeBrowsingPingManager::ReportThreatDetails(const std::string& report) { - GURL report_url = ThreatDetailsUrl(); - std::unique_ptr<net::URLFetcher> fetcher = - net::URLFetcher::Create(report_url, net::URLFetcher::POST, this); - data_use_measurement::DataUseUserData::AttachToFetcher( - fetcher.get(), data_use_measurement::DataUseUserData::SAFE_BROWSING); - fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE); - fetcher->SetRequestContext(request_context_getter_.get()); - fetcher->SetUploadData("application/octet-stream", report); - // Don't try too hard to send reports on failures. - fetcher->SetAutomaticallyRetryOn5xx(false); - - std::string report_base64; - base::Base64Encode(report, &report_base64); - net_log_.BeginEvent( - net::NetLogEventType::SAFE_BROWSING_PING, - base::Bind(&NetLogPingStartCallback, net_log_, fetcher->GetOriginalURL(), - report_base64)); - - fetcher->Start(); - safebrowsing_reports_.insert(std::move(fetcher)); -} - void SafeBrowsingPingManager::ReportPermissionAction( const PermissionReportInfo& report_info) { permission_reporter_->SendReport(report_info); @@ -183,100 +55,4 @@ profile, database_manager, origin, image); } -GURL SafeBrowsingPingManager::SafeBrowsingHitUrl( - const safe_browsing::HitReport& hit_report) const { - DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || - hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || - hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || - hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || - hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || - hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); - std::string url = SafeBrowsingProtocolManagerHelper::ComposeUrl( - url_prefix_, "report", client_name_, version_, std::string(), - hit_report.extended_reporting_level); - - std::string threat_list = "none"; - switch (hit_report.threat_type) { - case SB_THREAT_TYPE_URL_MALWARE: - threat_list = "malblhit"; - break; - case SB_THREAT_TYPE_URL_PHISHING: - threat_list = "phishblhit"; - break; - case SB_THREAT_TYPE_URL_UNWANTED: - threat_list = "uwsblhit"; - break; - case SB_THREAT_TYPE_BINARY_MALWARE_URL: - threat_list = "binurlhit"; - break; - case SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL: - threat_list = "phishcsdhit"; - break; - case SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL: - threat_list = "malcsdhit"; - break; - default: - NOTREACHED(); - } - - std::string threat_source = "none"; - switch (hit_report.threat_source) { - case safe_browsing::ThreatSource::DATA_SAVER: - threat_source = "ds"; - break; - case safe_browsing::ThreatSource::REMOTE: - threat_source = "rem"; - break; - case safe_browsing::ThreatSource::LOCAL_PVER3: - threat_source = "l3"; - break; - case safe_browsing::ThreatSource::LOCAL_PVER4: - threat_source = "l4"; - break; - case safe_browsing::ThreatSource::CLIENT_SIDE_DETECTION: - threat_source = "csd"; - break; - case safe_browsing::ThreatSource::UNKNOWN: - NOTREACHED(); - } - - // Add user_population component only if it's not empty. - std::string user_population_comp; - if (!hit_report.population_id.empty()) { - // Population_id should be URL-safe, but escape it and size-limit it - // anyway since it came from outside Chrome. - std::string up_str = - net::EscapeQueryParamValue(hit_report.population_id, true); - if (up_str.size() > 512) { - DCHECK(false) << "population_id is too long: " << up_str; - up_str = "UP_STRING_TOO_LONG"; - } - - user_population_comp = "&up=" + up_str; - } - - return GURL(base::StringPrintf( - "%s&evts=%s&evtd=%s&evtr=%s&evhr=%s&evtb=%d&src=%s&m=%d%s", url.c_str(), - threat_list.c_str(), - net::EscapeQueryParamValue(hit_report.malicious_url.spec(), true).c_str(), - net::EscapeQueryParamValue(hit_report.page_url.spec(), true).c_str(), - net::EscapeQueryParamValue(hit_report.referrer_url.spec(), true).c_str(), - hit_report.is_subresource, threat_source.c_str(), - hit_report.is_metrics_reporting_active, user_population_comp.c_str())); -} - -GURL SafeBrowsingPingManager::ThreatDetailsUrl() const { - std::string url = base::StringPrintf( - "%s/clientreport/malware?client=%s&appver=%s&pver=1.0", - url_prefix_.c_str(), - client_name_.c_str(), - version_.c_str()); - std::string api_key = google_apis::GetAPIKey(); - if (!api_key.empty()) { - base::StringAppendF(&url, "&key=%s", - net::EscapeQueryParamValue(api_key, true).c_str()); - } - return GURL(url); -} - } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/ping_manager.h b/chrome/browser/safe_browsing/ping_manager.h index 676fedf5..e6e0c429 100644 --- a/chrome/browser/safe_browsing/ping_manager.h +++ b/chrome/browser/safe_browsing/ping_manager.h
@@ -5,24 +5,10 @@ #ifndef CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ #define CHROME_BROWSER_SAFE_BROWSING_PING_MANAGER_H_ -// A class that reports safebrowsing statistics to Google's SafeBrowsing -// servers. -#include <memory> -#include <set> -#include <string> -#include <vector> - -#include "base/gtest_prod_util.h" -#include "base/macros.h" #include "chrome/browser/permissions/permission_uma_util.h" -#include "chrome/browser/safe_browsing/protocol_manager_helper.h" -#include "components/safe_browsing_db/hit_report.h" -#include "components/safe_browsing_db/util.h" -#include "net/log/net_log_with_source.h" -#include "net/url_request/url_fetcher_delegate.h" -#include "url/gurl.h" +#include "components/safe_browsing/base_ping_manager.h" +#include "content/public/browser/permission_type.h" -class Profile; class SkBitmap; namespace net { @@ -35,7 +21,7 @@ class PermissionReporter; class SafeBrowsingDatabaseManager; -class SafeBrowsingPingManager : public net::URLFetcherDelegate { +class SafeBrowsingPingManager : public BasePingManager { public: ~SafeBrowsingPingManager() override; @@ -44,18 +30,6 @@ net::URLRequestContextGetter* request_context_getter, const SafeBrowsingProtocolConfig& config); - // net::URLFetcherDelegate interface. - void OnURLFetchComplete(const net::URLFetcher* source) override; - - // Report to Google when a SafeBrowsing warning is shown to the user. - // |hit_report.threat_type| should be one of the types known by - // SafeBrowsingtHitUrl. - void ReportSafeBrowsingHit(const safe_browsing::HitReport& hit_report); - - // Users can opt-in on the SafeBrowsing interstitial to send detailed - // threat reports. |report| is the serialized report. - void ReportThreatDetails(const std::string& report); - // Report permission action to SafeBrowsing servers. void ReportPermissionAction(const PermissionReportInfo& report_info); @@ -69,56 +43,21 @@ private: friend class NotificationImageReporterTest; friend class PermissionReporterBrowserTest; - friend class SafeBrowsingPingManagerTest; - FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, - TestSafeBrowsingHitUrl); - FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, TestThreatDetailsUrl); - FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, - TestReportThreatDetails); - FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerTest, - TestReportSafeBrowsingHit); FRIEND_TEST_ALL_PREFIXES(SafeBrowsingPingManagerCertReportingTest, UMAOnFailure); - typedef std::set<std::unique_ptr<net::URLFetcher>> Reports; - // Constructs a SafeBrowsingPingManager that issues network requests // using |request_context_getter|. SafeBrowsingPingManager( net::URLRequestContextGetter* request_context_getter, const SafeBrowsingProtocolConfig& config); - // Generates URL for reporting safe browsing hits. - GURL SafeBrowsingHitUrl(const safe_browsing::HitReport& hit_report) const; - - // Generates URL for reporting threat details for users who opt-in. - GURL ThreatDetailsUrl() const; - - // Current product version sent in each request. - std::string version_; - - // The safe browsing client name sent in each request. - std::string client_name_; - - // The context we use to issue network requests. - scoped_refptr<net::URLRequestContextGetter> request_context_getter_; - - // URL prefix where browser reports hits to the safebrowsing list and - // sends detaild threat reports for UMA users. - std::string url_prefix_; - - // Track outstanding SafeBrowsing report fetchers for clean up. - // We add both "hit" and "detail" fetchers in this set. - Reports safebrowsing_reports_; - // Sends reports of permission actions. std::unique_ptr<PermissionReporter> permission_reporter_; // Sends reports of notification content images. std::unique_ptr<NotificationImageReporter> notification_image_reporter_; - net::NetLogWithSource net_log_; - DISALLOW_COPY_AND_ASSIGN(SafeBrowsingPingManager); };
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index 4432206e..770e6cf 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -166,7 +166,7 @@ // Set the backoff multiplier fuzz to a random value between 0 and 1. back_off_fuzz_ = static_cast<float>(base::RandDouble()); if (version_.empty()) - version_ = SafeBrowsingProtocolManagerHelper::Version(); + version_ = ProtocolManagerHelper::Version(); } // static @@ -743,7 +743,7 @@ GURL SafeBrowsingProtocolManager::UpdateUrl( ExtendedReportingLevel reporting_level) const { - std::string url = SafeBrowsingProtocolManagerHelper::ComposeUrl( + std::string url = ProtocolManagerHelper::ComposeUrl( url_prefix_, "downloads", client_name_, version_, additional_query_, reporting_level); return GURL(url); @@ -754,7 +754,7 @@ DCHECK(backup_update_reason >= 0 && backup_update_reason < BACKUP_UPDATE_REASON_MAX); DCHECK(!backup_url_prefixes_[backup_update_reason].empty()); - std::string url = SafeBrowsingProtocolManagerHelper::ComposeUrl( + std::string url = ProtocolManagerHelper::ComposeUrl( backup_url_prefixes_[backup_update_reason], "downloads", client_name_, version_, additional_query_); return GURL(url); @@ -762,7 +762,7 @@ GURL SafeBrowsingProtocolManager::GetHashUrl( ExtendedReportingLevel reporting_level) const { - std::string url = SafeBrowsingProtocolManagerHelper::ComposeUrl( + std::string url = ProtocolManagerHelper::ComposeUrl( url_prefix_, "gethash", client_name_, version_, additional_query_, reporting_level); return GURL(url);
diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h index fbe9c16..ae17540 100644 --- a/chrome/browser/safe_browsing/protocol_manager.h +++ b/chrome/browser/safe_browsing/protocol_manager.h
@@ -28,7 +28,6 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "chrome/browser/safe_browsing/chunk_range.h" -#include "chrome/browser/safe_browsing/protocol_manager_helper.h" #include "chrome/browser/safe_browsing/protocol_parser.h" #include "chrome/browser/safe_browsing/safe_browsing_util.h" #include "components/safe_browsing_db/safe_browsing_prefs.h"
diff --git a/chrome/browser/safe_browsing/protocol_manager_helper.cc b/chrome/browser/safe_browsing/protocol_manager_helper.cc deleted file mode 100644 index 93c87a4f0..0000000 --- a/chrome/browser/safe_browsing/protocol_manager_helper.cc +++ /dev/null
@@ -1,76 +0,0 @@ -// Copyright (c) 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 "chrome/browser/safe_browsing/protocol_manager_helper.h" - -#ifndef NDEBUG -#include "base/base64.h" -#endif -#include "base/environment.h" -#include "base/logging.h" -#include "base/stl_util.h" -#include "base/strings/string_util.h" -#include "base/strings/stringprintf.h" -#include "components/version_info/version_info.h" -#include "google_apis/google_api_keys.h" -#include "net/base/escape.h" - -namespace safe_browsing { - -SafeBrowsingProtocolConfig::SafeBrowsingProtocolConfig() - : disable_auto_update(false) {} - -SafeBrowsingProtocolConfig::SafeBrowsingProtocolConfig( - const SafeBrowsingProtocolConfig& other) = default; - -SafeBrowsingProtocolConfig::~SafeBrowsingProtocolConfig() {} - -// static -std::string SafeBrowsingProtocolManagerHelper::Version() { - if (version_info::GetVersionNumber().empty()) - return "0.1"; - else - return version_info::GetVersionNumber(); -} - -// static -std::string SafeBrowsingProtocolManagerHelper::ComposeUrl( - const std::string& prefix, - const std::string& method, - const std::string& client_name, - const std::string& version, - const std::string& additional_query) { - DCHECK(!prefix.empty() && !method.empty() && - !client_name.empty() && !version.empty()); - std::string url = base::StringPrintf("%s/%s?client=%s&appver=%s&pver=3.0", - prefix.c_str(), method.c_str(), - client_name.c_str(), version.c_str()); - std::string api_key = google_apis::GetAPIKey(); - if (!api_key.empty()) { - base::StringAppendF(&url, "&key=%s", - net::EscapeQueryParamValue(api_key, true).c_str()); - } - if (!additional_query.empty()) { - DCHECK(url.find("?") != std::string::npos); - url.append("&"); - url.append(additional_query); - } - return url; -} - -// static -std::string SafeBrowsingProtocolManagerHelper::ComposeUrl( - const std::string& prefix, - const std::string& method, - const std::string& client_name, - const std::string& version, - const std::string& additional_query, - ExtendedReportingLevel reporting_level) { - std::string url = - ComposeUrl(prefix, method, client_name, version, additional_query); - url.append(base::StringPrintf("&ext=%d", reporting_level)); - return url; -} - -} // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/protocol_manager_helper.h b/chrome/browser/safe_browsing/protocol_manager_helper.h deleted file mode 100644 index 5777fdfb..0000000 --- a/chrome/browser/safe_browsing/protocol_manager_helper.h +++ /dev/null
@@ -1,62 +0,0 @@ -// Copyright (c) 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 CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_HELPER_H_ -#define CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_HELPER_H_ - -// A class that provides common functionality for safebrowsing protocol managers -// that communicate with Google servers. - -#include <memory> -#include <string> - -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "components/safe_browsing_db/safe_browsing_prefs.h" - -namespace safe_browsing { - -struct SafeBrowsingProtocolConfig { - SafeBrowsingProtocolConfig(); - SafeBrowsingProtocolConfig(const SafeBrowsingProtocolConfig& other); - ~SafeBrowsingProtocolConfig(); - std::string client_name; - std::string url_prefix; - std::string backup_connect_error_url_prefix; - std::string backup_http_error_url_prefix; - std::string backup_network_error_url_prefix; - std::string version; - bool disable_auto_update; -}; - -class SafeBrowsingProtocolManagerHelper { - public: - // returns version - static std::string Version(); - - // Composes a URL using |prefix|, |method| (e.g.: gethash, download, report). - // |client_name| and |version|. When not empty, |additional_query| is - // appended to the URL with an additional "&" in the front. - static std::string ComposeUrl(const std::string& prefix, - const std::string& method, - const std::string& client_name, - const std::string& version, - const std::string& additional_query); - - // Similar to above function, and appends "&ext=1" at the end of URL if - // |is_extended_reporting| is true, otherwise, appends "&ext=0". - static std::string ComposeUrl(const std::string& prefix, - const std::string& method, - const std::string& client_name, - const std::string& version, - const std::string& additional_query, - ExtendedReportingLevel reporting_level); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(SafeBrowsingProtocolManagerHelper); -}; - -} // namespace safe_browsing - -#endif // CHROME_BROWSER_SAFE_BROWSING_PROTOCOL_MANAGER_HELPER_H_
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index a391b25..2ecf2d0 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -78,7 +78,6 @@ #include "chrome/browser/safe_browsing/incident_reporting/resource_request_detector.h" #include "chrome/browser/safe_browsing/incident_reporting/variations_seed_signature_analyzer.h" #include "chrome/browser/safe_browsing/protocol_manager.h" -#include "chrome/browser/safe_browsing/protocol_manager_helper.h" #endif using content::BrowserThread; @@ -522,7 +521,7 @@ return V4ProtocolConfig( GetProtocolConfigClientName(), cmdline->HasSwitch(::switches::kDisableBackgroundNetworking), - google_apis::GetAPIKey(), SafeBrowsingProtocolManagerHelper::Version()); + google_apis::GetAPIKey(), ProtocolManagerHelper::Version()); } std::string SafeBrowsingService::GetProtocolConfigClientName() const {
diff --git a/chrome/browser/safe_browsing/test_safe_browsing_service.h b/chrome/browser/safe_browsing/test_safe_browsing_service.h index 533c748..1d8fecef 100644 --- a/chrome/browser/safe_browsing/test_safe_browsing_service.h +++ b/chrome/browser/safe_browsing/test_safe_browsing_service.h
@@ -8,7 +8,6 @@ #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/safe_browsing/protocol_manager.h" -#include "chrome/browser/safe_browsing/protocol_manager_helper.h" #include "chrome/browser/safe_browsing/ui_manager.h" #include "components/safe_browsing_db/v4_protocol_manager_util.h"
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index b50c91c..b06487ea 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -1561,8 +1561,9 @@ deps += [ "//chrome/browser/ui/views", "//components/constrained_window", - "//components/payments:payment_request_impl", - "//components/payments:payment_validation", + "//components/payments/content:payment_request_impl", + "//components/payments/content:payment_validation", + "//components/payments/core", "//services/ui/public/cpp/input_devices", ] allow_circular_includes_from += [ "//chrome/browser/ui/views" ]
diff --git a/chrome/browser/ui/libgtkui/gtk_ui.cc b/chrome/browser/ui/libgtkui/gtk_ui.cc index 3423149..9bdb18c 100644 --- a/chrome/browser/ui/libgtkui/gtk_ui.cc +++ b/chrome/browser/ui/libgtkui/gtk_ui.cc
@@ -116,6 +116,12 @@ border.allocN32Pixels(width, height); border.eraseColor(0); + cairo_surface_t* surface = cairo_image_surface_create_for_data( + static_cast<unsigned char*>(border.getAddr(0, 0)), CAIRO_FORMAT_ARGB32, + width, height, width * 4); + cairo_t* cr = cairo_create(surface); + +#if GTK_MAJOR_VERSION == 2 // Create a temporary GTK button to snapshot GtkWidget* window = gtk_offscreen_window_new(); GtkWidget* button = gtk_toggle_button_new(); @@ -133,12 +139,6 @@ gtk_widget_show_all(window); - cairo_surface_t* surface = cairo_image_surface_create_for_data( - static_cast<unsigned char*>(border.getAddr(0, 0)), CAIRO_FORMAT_ARGB32, - width, height, width * 4); - cairo_t* cr = cairo_create(surface); - -#if GTK_MAJOR_VERSION == 2 if (focus_) GTK_WIDGET_SET_FLAGS(button, GTK_HAS_FOCUS); @@ -161,8 +161,18 @@ g_object_unref(pixbuf); g_object_unref(pixmap); + + gtk_widget_destroy(window); #else - GtkStyleContext* context = gtk_widget_get_style_context(button); + ScopedStyleContext context = GetStyleContextFromCss( + is_blue_ ? "GtkButton#button.default.suggested-action" + : "GtkButton#button"); + GtkStateFlags state_flags = StateToStateFlags(state_); + if (focus_) { + state_flags = + static_cast<GtkStateFlags>(state_flags | GTK_STATE_FLAG_FOCUSED); + } + gtk_style_context_set_state(context, state_flags); gtk_render_background(context, cr, 0, 0, width, height); gtk_render_frame(context, cr, 0, 0, width, height); if (focus_) @@ -172,8 +182,6 @@ cairo_destroy(cr); cairo_surface_destroy(surface); - gtk_widget_destroy(window); - return gfx::ImageSkiaRep(border, scale); } @@ -228,67 +236,6 @@ // The unknown content type. const char* kUnknownContentType = "application/octet-stream"; -// Picks a button tint from a set of background colors. While -// |accent_color| will usually be the same color through a theme, this -// function will get called with the normal GtkLabel |text_color|/GtkWindow -// |background_color| pair and the GtkEntry |text_color|/|background_color| -// pair. While 3/4 of the time the resulting tint will be the same, themes that -// have a dark window background (with light text) and a light text entry (with -// dark text) will get better icons with this separated out. -void PickButtonTintFromColors(SkColor accent_color, - SkColor text_color, - SkColor background_color, - color_utils::HSL* tint) { - color_utils::HSL accent_tint, text_tint, background_tint; - color_utils::SkColorToHSL(accent_color, &accent_tint); - color_utils::SkColorToHSL(text_color, &text_tint); - color_utils::SkColorToHSL(background_color, &background_tint); - - // If the accent color is gray, then our normal HSL tomfoolery will bring out - // whatever color is oddly dominant (for example, in rgb space [125, 128, - // 125] will tint green instead of gray). Slight differences (+/-10 (4%) to - // all color components) should be interpreted as this color being gray and - // we should switch into a special grayscale mode. - int rb_diff = abs(static_cast<int>(SkColorGetR(accent_color)) - - static_cast<int>(SkColorGetB(accent_color))); - int rg_diff = abs(static_cast<int>(SkColorGetR(accent_color)) - - static_cast<int>(SkColorGetG(accent_color))); - int bg_diff = abs(static_cast<int>(SkColorGetB(accent_color)) - - static_cast<int>(SkColorGetG(accent_color))); - if (rb_diff < 10 && rg_diff < 10 && bg_diff < 10) { - // Our accent is white/gray/black. Only the luminance of the accent color - // matters. - tint->h = -1; - - // Use the saturation of the text. - tint->s = text_tint.s; - - // Use the luminance of the accent color UNLESS there isn't enough - // luminance contrast between the accent color and the base color. - if (fabs(accent_tint.l - background_tint.l) > 0.3) - tint->l = accent_tint.l; - else - tint->l = text_tint.l; - } else { - // Our accent is a color. - tint->h = accent_tint.h; - - // Don't modify the saturation; the amount of color doesn't matter. - tint->s = -1; - - // If the text wants us to darken the icon, don't change the luminance (the - // icons are already dark enough). Otherwise, lighten the icon by no more - // than 0.9 since we don't want a pure-white icon even if the text is pure - // white. - if (text_tint.l < 0.5) - tint->l = -1; - else if (text_tint.l <= 0.9) - tint->l = text_tint.l; - else - tint->l = 0.9; - } -} - // Returns a gfx::FontRenderParams corresponding to GTK's configuration. gfx::FontRenderParams GetGtkFontRenderParams() { GtkSettings* gtk_settings = gtk_settings_get_default(); @@ -903,10 +850,14 @@ if (SkColorGetA(location_bar_border)) colors_[ThemeProperties::COLOR_LOCATION_BAR_BORDER] = location_bar_border; - inactive_selection_bg_color_ = - GetSelectedBgColor("GtkTextView#textview.view:backdrop"); + inactive_selection_bg_color_ = GetSelectionBgColor( + GtkVersionCheck(3, 20) ? "GtkTextView#textview.view:backdrop " + "#text:backdrop #selection:backdrop" + : "GtkTextView:selected:backdrop"); inactive_selection_fg_color_ = - GetSelectedTextColor("GtkTextView#textview.view:backdrop"); + GetFgColor(GtkVersionCheck(3, 20) ? "GtkTextView#textview.view:backdrop " + "#text:backdrop #selection:backdrop" + : "GtkTextView:selected:backdrop"); SkColor toolbar_button_border = GetBorderColor("GtkToolbar#toolbar GtkButton#button");
diff --git a/chrome/browser/ui/libgtkui/gtk_util.cc b/chrome/browser/ui/libgtkui/gtk_util.cc index 9463d533..6c10b43 100644 --- a/chrome/browser/ui/libgtkui/gtk_util.cc +++ b/chrome/browser/ui/libgtkui/gtk_util.cc
@@ -278,6 +278,23 @@ return false; } +GtkStateFlags StateToStateFlags(ui::NativeTheme::State state) { + switch (state) { + case ui::NativeTheme::kDisabled: + return GTK_STATE_FLAG_INSENSITIVE; + case ui::NativeTheme::kHovered: + return GTK_STATE_FLAG_PRELIGHT; + case ui::NativeTheme::kNormal: + return GTK_STATE_FLAG_NORMAL; + case ui::NativeTheme::kPressed: + return static_cast<GtkStateFlags>(GTK_STATE_FLAG_PRELIGHT | + GTK_STATE_FLAG_ACTIVE); + default: + NOTREACHED(); + return GTK_STATE_FLAG_NORMAL; + } +} + ScopedStyleContext AppendCssNodeToStyleContext(GtkStyleContext* context, const std::string& css_node) { GtkWidgetPath* path = @@ -492,24 +509,8 @@ return surface.GetAveragePixelValue(true); } -ScopedStyleContext GetSelectedStyleContext(const char* css_selector) { +SkColor GetSelectionBgColor(const char* css_selector) { auto context = GetStyleContextFromCss(css_selector); - if (GtkVersionCheck(3, 20)) { - context = AppendCssNodeToStyleContext(context, "#selection"); - } else { - GtkStateFlags state = gtk_style_context_get_state(context); - state = static_cast<GtkStateFlags>(state | GTK_STATE_FLAG_SELECTED); - gtk_style_context_set_state(context, state); - } - return context; -} - -SkColor GetSelectedTextColor(const char* css_selector) { - return GetFgColorFromStyleContext(GetSelectedStyleContext(css_selector)); -} - -SkColor GetSelectedBgColor(const char* css_selector) { - auto context = GetSelectedStyleContext(css_selector); if (GtkVersionCheck(3, 20)) return GetBgColorFromStyleContext(context); // This is verbatim how Gtk gets the selection color on versions before 3.20.
diff --git a/chrome/browser/ui/libgtkui/gtk_util.h b/chrome/browser/ui/libgtkui/gtk_util.h index 322974a..1598d99 100644 --- a/chrome/browser/ui/libgtkui/gtk_util.h +++ b/chrome/browser/ui/libgtkui/gtk_util.h
@@ -177,6 +177,9 @@ typedef ScopedGObject<GtkStyleContext> ScopedStyleContext; typedef ScopedGObject<GtkCssProvider> ScopedCssProvider; +// Converts ui::NativeTheme::State to GtkStateFlags. +GtkStateFlags StateToStateFlags(ui::NativeTheme::State state); + // If |context| is nullptr, creates a new top-level style context // specified by parsing |css_node|. Otherwise, creates the child // context with |context| as the parent. @@ -217,8 +220,9 @@ // returns the average color. SkColor GetBorderColor(const char* css_selector); -SkColor GetSelectedTextColor(const char* css_selector); -SkColor GetSelectedBgColor(const char* css_selector); +// On Gtk3.20 or later, behaves like GetBgColor. Otherwise, returns +// the background-color property. +SkColor GetSelectionBgColor(const char* css_selector); // Get the color of the GtkSeparator specified by |css_selector|. SkColor GetSeparatorColor(const char* css_selector);
diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk3.cc b/chrome/browser/ui/libgtkui/native_theme_gtk3.cc index 113951a2..af7ea82 100644 --- a/chrome/browser/ui/libgtkui/native_theme_gtk3.cc +++ b/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
@@ -63,23 +63,6 @@ rect.y()); } -GtkStateFlags StateToStateFlags(NativeThemeGtk3::State state) { - switch (state) { - case NativeThemeGtk3::kDisabled: - return GTK_STATE_FLAG_INSENSITIVE; - case NativeThemeGtk3::kHovered: - return GTK_STATE_FLAG_PRELIGHT; - case NativeThemeGtk3::kNormal: - return GTK_STATE_FLAG_NORMAL; - case NativeThemeGtk3::kPressed: - return static_cast<GtkStateFlags>(GTK_STATE_FLAG_PRELIGHT | - GTK_STATE_FLAG_ACTIVE); - default: - NOTREACHED(); - return GTK_STATE_FLAG_NORMAL; - } -} - SkColor SkColorFromColorId(ui::NativeTheme::ColorId color_id) { const SkColor kPositiveTextColor = SkColorSetRGB(0x0b, 0x80, 0x43); const SkColor kNegativeTextColor = SkColorSetRGB(0xc5, 0x39, 0x29); @@ -143,9 +126,11 @@ case ui::NativeTheme::kColorId_LabelDisabledColor: return GetFgColor("GtkLabel:disabled"); case ui::NativeTheme::kColorId_LabelTextSelectionColor: - return GetSelectedTextColor("GtkLabel"); + return GetFgColor(GtkVersionCheck(3, 20) ? "GtkLabel #selection" + : "GtkLabel:selected"); case ui::NativeTheme::kColorId_LabelTextSelectionBackgroundFocused: - return GetSelectedBgColor("GtkLabel"); + return GetSelectionBgColor(GtkVersionCheck(3, 20) ? "GtkLabel #selection" + : "GtkLabel:selected"); // Link case ui::NativeTheme::kColorId_LinkDisabled: @@ -223,17 +208,28 @@ // Textfield case ui::NativeTheme::kColorId_TextfieldDefaultColor: - return GetFgColor("GtkTextView#textview.view"); + return GetFgColor(GtkVersionCheck(3, 20) + ? "GtkTextView#textview.view #text" + : "GtkTextView"); case ui::NativeTheme::kColorId_TextfieldDefaultBackground: - return GetBgColor("GtkTextView#textview.view"); + return GetBgColor(GtkVersionCheck(3, 20) ? "GtkTextView#textview.view" + : "GtkTextView"); case ui::NativeTheme::kColorId_TextfieldReadOnlyColor: - return GetFgColor("GtkTextView#textview.view:disabled"); + return GetFgColor(GtkVersionCheck(3, 20) + ? "GtkTextView#textview.view:disabled #text" + : "GtkTextView:disabled"); case ui::NativeTheme::kColorId_TextfieldReadOnlyBackground: - return GetBgColor("GtkTextView#textview.view:disabled"); + return GetBgColor(GtkVersionCheck(3, 20) + ? "GtkTextView#textview.view:disabled" + : "GtkTextView:disabled"); case ui::NativeTheme::kColorId_TextfieldSelectionColor: - return GetSelectedTextColor("GtkTextView#textview.view"); + return GetFgColor(GtkVersionCheck(3, 20) + ? "GtkTextView#textview.view #text #selection" + : "GtkTextView:selected"); case ui::NativeTheme::kColorId_TextfieldSelectionBackgroundFocused: - return GetSelectedBgColor("GtkTextView#textview.view"); + return GetSelectionBgColor( + GtkVersionCheck(3, 20) ? "GtkTextView#textview.view #text #selection" + : "GtkTextView:selected"); // Tooltips case ui::NativeTheme::kColorId_TooltipBackground:
diff --git a/chrome/browser/ui/startup/startup_tab_provider.cc b/chrome/browser/ui/startup/startup_tab_provider.cc index fdd35dd..a68ea46 100644 --- a/chrome/browser/ui/startup/startup_tab_provider.cc +++ b/chrome/browser/ui/startup/startup_tab_provider.cc
@@ -29,6 +29,21 @@ #include "chrome/browser/shell_integration.h" #endif +namespace { + +// Attempts to find an existing, non-empty tabbed browser for this profile. +bool ProfileHasOtherTabbedBrowser(Profile* profile) { + BrowserList* browser_list = BrowserList::GetInstance(); + auto other_tabbed_browser = std::find_if( + browser_list->begin(), browser_list->end(), [profile](Browser* browser) { + return browser->profile() == profile && browser->is_type_tabbed() && + !browser->tab_strip_model()->empty(); + }); + return other_tabbed_browser != browser_list->end(); +} + +} // namespace + StartupTabs StartupTabProviderImpl::GetOnboardingTabs(Profile* profile) const { // Onboarding content has not been launched on Chrome OS. #if defined(OS_CHROMEOS) @@ -101,26 +116,16 @@ Profile* profile) const { return GetPinnedTabsForState( StartupBrowserCreator::GetSessionStartupPref(command_line, profile), - PinnedTabCodec::ReadPinnedTabs(profile)); + PinnedTabCodec::ReadPinnedTabs(profile), + ProfileHasOtherTabbedBrowser(profile)); } StartupTabs StartupTabProviderImpl::GetPreferencesTabs( const base::CommandLine& command_line, Profile* profile) const { - // Attempt to find an existing, non-empty tabbed browser for this profile. If - // one exists, preferences tabs are not used. - BrowserList* browser_list = BrowserList::GetInstance(); - auto other_tabbed_browser = std::find_if( - browser_list->begin(), browser_list->end(), [profile](Browser* browser) { - return browser->profile() == profile && browser->is_type_tabbed() && - !browser->tab_strip_model()->empty(); - }); - bool profile_has_other_tabbed_browser = - other_tabbed_browser != browser_list->end(); - return GetPreferencesTabsForState( StartupBrowserCreator::GetSessionStartupPref(command_line, profile), - profile_has_other_tabbed_browser); + ProfileHasOtherTabbedBrowser(profile)); } StartupTabs StartupTabProviderImpl::GetNewTabPageTabs( @@ -202,9 +207,12 @@ // static StartupTabs StartupTabProviderImpl::GetPinnedTabsForState( const SessionStartupPref& pref, - const StartupTabs& pinned_tabs) { - return (pref.type == SessionStartupPref::Type::LAST) ? StartupTabs() - : pinned_tabs; + const StartupTabs& pinned_tabs, + bool profile_has_other_tabbed_browser) { + if (pref.type == SessionStartupPref::Type::LAST || + profile_has_other_tabbed_browser) + return StartupTabs(); + return pinned_tabs; } // static
diff --git a/chrome/browser/ui/startup/startup_tab_provider.h b/chrome/browser/ui/startup/startup_tab_provider.h index 181ba44..79bf524 100644 --- a/chrome/browser/ui/startup/startup_tab_provider.h +++ b/chrome/browser/ui/startup/startup_tab_provider.h
@@ -93,8 +93,10 @@ // Determines whether the startup preference requires the contents of // |pinned_tabs| to be shown. This is needed to avoid duplicates, as the // session restore logic will also resurface pinned tabs on its own. - static StartupTabs GetPinnedTabsForState(const SessionStartupPref& pref, - const StartupTabs& pinned_tabs); + static StartupTabs GetPinnedTabsForState( + const SessionStartupPref& pref, + const StartupTabs& pinned_tabs, + bool profile_has_other_tabbed_browser); // Determines whether preferences and window state indicate that // user-specified tabs should be shown as the default new window content, and
diff --git a/chrome/browser/ui/startup/startup_tab_provider_unittest.cc b/chrome/browser/ui/startup/startup_tab_provider_unittest.cc index 068e032b..c03d8cc3 100644 --- a/chrome/browser/ui/startup/startup_tab_provider_unittest.cc +++ b/chrome/browser/ui/startup/startup_tab_provider_unittest.cc
@@ -199,13 +199,14 @@ SessionStartupPref pref_default(SessionStartupPref::Type::DEFAULT); SessionStartupPref pref_urls(SessionStartupPref::Type::URLS); - StartupTabs output = - StartupTabProviderImpl::GetPinnedTabsForState(pref_default, pinned); + StartupTabs output = StartupTabProviderImpl::GetPinnedTabsForState( + pref_default, pinned, false); ASSERT_EQ(1U, output.size()); EXPECT_EQ("www.google.com", output[0].url.host()); - output = StartupTabProviderImpl::GetPinnedTabsForState(pref_urls, pinned); + output = + StartupTabProviderImpl::GetPinnedTabsForState(pref_urls, pinned, false); ASSERT_EQ(1U, output.size()); EXPECT_EQ("www.google.com", output[0].url.host()); @@ -214,9 +215,18 @@ TEST(StartupTabProviderTest, GetPinnedTabsForState_Negative) { StartupTabs pinned = {StartupTab(GURL("https://www.google.com"), true)}; SessionStartupPref pref_last(SessionStartupPref::Type::LAST); + SessionStartupPref pref_default(SessionStartupPref::Type::DEFAULT); + // Session restore preference should block reading pinned tabs. StartupTabs output = - StartupTabProviderImpl::GetPinnedTabsForState(pref_last, pinned); + StartupTabProviderImpl::GetPinnedTabsForState(pref_last, pinned, false); + + ASSERT_TRUE(output.empty()); + + // Pinned tabs are not added when this profile already has a nonempty tabbed + // browser open. + output = + StartupTabProviderImpl::GetPinnedTabsForState(pref_default, pinned, true); ASSERT_TRUE(output.empty()); }
diff --git a/chrome/browser/ui/views/chrome_web_dialog_view.cc b/chrome/browser/ui/views/chrome_web_dialog_view.cc index 93a3eec..14cc279 100644 --- a/chrome/browser/ui/views/chrome_web_dialog_view.cc +++ b/chrome/browser/ui/views/chrome_web_dialog_view.cc
@@ -14,7 +14,6 @@ #include "chrome/browser/ui/ash/ash_util.h" #include "services/ui/public/cpp/property_type_converters.h" #include "services/ui/public/interfaces/window_manager.mojom.h" -#include "ui/aura/mus/mus_util.h" #endif // defined(USE_ASH) namespace chrome { @@ -47,10 +46,6 @@ // NOTE: The |parent| may be null, which will result in the default window // placement on Aura. params.parent = parent; -#if defined(USE_ASH) - if (chrome::IsRunningInMash()) - params.parent_mus = aura::GetMusWindow(parent); -#endif // defined(USE_ASH) return ShowWebDialogWidget(params, view); }
diff --git a/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc b/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc index 52fdd9a..8119abb7 100644 --- a/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc +++ b/chrome/browser/ui/views/frame/immersive_mode_controller_ash.cc
@@ -24,7 +24,6 @@ #include "services/ui/public/interfaces/window_manager.mojom.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/mus/mus_types.h" -#include "ui/aura/mus/mus_util.h" #include "ui/aura/mus/property_converter.h" #include "ui/aura/mus/window_port_mus.h" #include "ui/aura/window.h"
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc index 4fdaea8..98e4af9 100644 --- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc +++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
@@ -21,10 +21,11 @@ #include "components/autofill/core/browser/autofill_type.h" #include "components/autofill/core/browser/credit_card.h" #include "components/autofill/core/browser/field_types.h" +#include "components/autofill/core/browser/personal_data_manager.h" #include "components/autofill/core/browser/validation.h" #include "components/autofill/core/common/autofill_clock.h" #include "components/autofill/core/common/autofill_constants.h" -#include "components/payments/payment_request.h" +#include "components/payments/content/payment_request.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" #include "ui/native_theme/native_theme.h"
diff --git a/chrome/browser/ui/views/payments/editor_view_controller.cc b/chrome/browser/ui/views/payments/editor_view_controller.cc index a13ab0a..9df050e 100644 --- a/chrome/browser/ui/views/payments/editor_view_controller.cc +++ b/chrome/browser/ui/views/payments/editor_view_controller.cc
@@ -15,7 +15,7 @@ #include "chrome/browser/ui/views/payments/validating_combobox.h" #include "chrome/browser/ui/views/payments/validating_textfield.h" #include "chrome/grit/generated_resources.h" -#include "components/payments/payment_request.h" +#include "components/payments/content/payment_request.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" #include "ui/native_theme/native_theme.h"
diff --git a/chrome/browser/ui/views/payments/order_summary_view_controller.cc b/chrome/browser/ui/views/payments/order_summary_view_controller.cc index 8e494381..3589cc3 100644 --- a/chrome/browser/ui/views/payments/order_summary_view_controller.cc +++ b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
@@ -15,8 +15,8 @@ #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" #include "chrome/browser/ui/views/payments/payment_request_views_util.h" #include "chrome/grit/generated_resources.h" -#include "components/payments/currency_formatter.h" -#include "components/payments/payment_request.h" +#include "components/payments/content/payment_request.h" +#include "components/payments/core/currency_formatter.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/font.h"
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller.cc b/chrome/browser/ui/views/payments/payment_method_view_controller.cc index 88bb7db..8a915c0 100644 --- a/chrome/browser/ui/views/payments/payment_method_view_controller.cc +++ b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
@@ -16,7 +16,7 @@ #include "chrome/grit/generated_resources.h" #include "components/autofill/core/browser/autofill_type.h" #include "components/autofill/core/browser/credit_card.h" -#include "components/payments/payment_request.h" +#include "components/payments/content/payment_request.h" #include "components/strings/grit/components_strings.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller_interactive_uitest.cc b/chrome/browser/ui/views/payments/payment_method_view_controller_interactive_uitest.cc index b8d3dea..500d0c8 100644 --- a/chrome/browser/ui/views/payments/payment_method_view_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/payments/payment_method_view_controller_interactive_uitest.cc
@@ -6,7 +6,7 @@ #include "chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h" #include "components/autofill/core/browser/autofill_test_utils.h" #include "components/autofill/core/browser/personal_data_manager.h" -#include "components/payments/payment_request.h" +#include "components/payments/content/payment_request.h" #include "testing/gtest/include/gtest/gtest.h" namespace payments {
diff --git a/chrome/browser/ui/views/payments/payment_request_credit_card_editor_interactive_uitest.cc b/chrome/browser/ui/views/payments/payment_request_credit_card_editor_interactive_uitest.cc index 3b49bd6..209437c 100644 --- a/chrome/browser/ui/views/payments/payment_request_credit_card_editor_interactive_uitest.cc +++ b/chrome/browser/ui/views/payments/payment_request_credit_card_editor_interactive_uitest.cc
@@ -13,7 +13,7 @@ #include "components/autofill/core/browser/field_types.h" #include "components/autofill/core/browser/personal_data_manager.h" #include "components/autofill/core/browser/test_autofill_clock.h" -#include "components/payments/payment_request.h" +#include "components/payments/content/payment_request.h" #include "components/strings/grit/components_strings.h" #include "content/public/test/browser_test_utils.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc index 60b3975..d6a122e5 100644 --- a/chrome/browser/ui/views/payments/payment_request_dialog_view.cc +++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.cc
@@ -14,7 +14,7 @@ #include "chrome/browser/ui/views/payments/payment_sheet_view_controller.h" #include "chrome/browser/ui/views/payments/shipping_list_view_controller.h" #include "components/constrained_window/constrained_window_views.h" -#include "components/payments/payment_request.h" +#include "components/payments/content/payment_request.h" #include "content/public/browser/browser_thread.h" #include "ui/views/layout/fill_layout.h"
diff --git a/chrome/browser/ui/views/payments/payment_request_dialog_view.h b/chrome/browser/ui/views/payments/payment_request_dialog_view.h index 9d70cef9..53b784e8 100644 --- a/chrome/browser/ui/views/payments/payment_request_dialog_view.h +++ b/chrome/browser/ui/views/payments/payment_request_dialog_view.h
@@ -10,7 +10,7 @@ #include "base/macros.h" #include "chrome/browser/ui/views/payments/view_stack.h" -#include "components/payments/payment_request_dialog.h" +#include "components/payments/content/payment_request_dialog.h" #include "ui/views/window/dialog_delegate.h" namespace payments {
diff --git a/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc b/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc index 04e69373..1c707fe2 100644 --- a/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc +++ b/chrome/browser/ui/views/payments/payment_request_interactive_uitest.cc
@@ -10,8 +10,8 @@ #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" #include "chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h" #include "chrome/test/base/ui_test_utils.h" -#include "components/payments/payment_request.h" -#include "components/payments/payment_request_web_contents_manager.h" +#include "components/payments/content/payment_request.h" +#include "components/payments/content/payment_request_web_contents_manager.h" #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "content/public/test/browser_test_utils.h"
diff --git a/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc b/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc index 6e14875..0f03b7b 100644 --- a/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc +++ b/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.cc
@@ -21,8 +21,8 @@ #include "chrome/browser/ui/views/payments/view_stack.h" #include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/ui_test_utils.h" -#include "components/payments/payment_request.h" -#include "components/payments/payment_request_web_contents_manager.h" +#include "components/payments/content/payment_request.h" +#include "components/payments/content/payment_request_web_contents_manager.h" #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h b/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h index 663dd91..cf0149b7 100644 --- a/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h +++ b/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h
@@ -16,7 +16,7 @@ #include "chrome/test/base/in_process_browser_test.h" #include "components/autofill/core/browser/field_types.h" #include "components/autofill/core/browser/personal_data_manager_observer.h" -#include "components/payments/payment_request.mojom.h" +#include "components/payments/content/payment_request.mojom.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "testing/gmock/include/gmock/gmock.h" #include "ui/views/widget/widget_observer.h"
diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc index 01289de..dfcf2a6 100644 --- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc +++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
@@ -23,8 +23,8 @@ #include "components/autofill/core/browser/credit_card.h" #include "components/autofill/core/browser/field_types.h" #include "components/autofill/core/browser/personal_data_manager.h" -#include "components/payments/currency_formatter.h" -#include "components/payments/payment_request.h" +#include "components/payments/content/payment_request.h" +#include "components/payments/core/currency_formatter.h" #include "components/strings/grit/components_strings.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ui/views/payments/shipping_list_view_controller.cc b/chrome/browser/ui/views/payments/shipping_list_view_controller.cc index 5109745f..fee19bf 100644 --- a/chrome/browser/ui/views/payments/shipping_list_view_controller.cc +++ b/chrome/browser/ui/views/payments/shipping_list_view_controller.cc
@@ -10,7 +10,7 @@ #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" #include "chrome/browser/ui/views/payments/payment_request_row_view.h" #include "chrome/browser/ui/views/payments/payment_request_views_util.h" -#include "components/payments/payment_request.h" +#include "components/payments/content/payment_request.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" #include "ui/views/layout/box_layout.h"
diff --git a/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chrome/browser/ui/webui/extensions/extensions_ui.cc index abd1edaf..279aca0 100644 --- a/chrome/browser/ui/webui/extensions/extensions_ui.cc +++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc
@@ -131,6 +131,12 @@ source->AddLocalizedString("itemId", IDS_MD_EXTENSIONS_ITEM_ID); source->AddLocalizedString("itemInspectViews", IDS_MD_EXTENSIONS_ITEM_INSPECT_VIEWS); + // NOTE: This text reads "<n> more". It's possible that it should be using + // a plural string instead. Unfortunately, this is non-trivial since we don't + // expose that capability to JS yet. Since we don't know it's a problem, use + // a simple placeholder for now. + source->AddLocalizedString("itemInspectViewsExtra", + IDS_MD_EXTENSIONS_ITEM_INSPECT_VIEWS_EXTRA); source->AddLocalizedString("itemAllowIncognito", IDS_MD_EXTENSIONS_ITEM_ALLOW_INCOGNITO); source->AddLocalizedString("itemDescriptionLabel", @@ -167,6 +173,7 @@ source->AddLocalizedString("itemCorruptInstall", IDS_EXTENSIONS_CORRUPTED_EXTENSION); source->AddLocalizedString("itemRepair", IDS_EXTENSIONS_REPAIR_CORRUPTED); + source->AddLocalizedString("itemReload", IDS_EXTENSIONS_RELOAD_TERMINATED); source->AddString( "itemSuspiciousInstall", l10n_util::GetStringFUTF16(
diff --git a/chrome/browser/ui/webui/options/chromeos/OWNERS b/chrome/browser/ui/webui/options/chromeos/OWNERS index 5202af7..fff9165 100644 --- a/chrome/browser/ui/webui/options/chromeos/OWNERS +++ b/chrome/browser/ui/webui/options/chromeos/OWNERS
@@ -1,3 +1,4 @@ +# This UI is deprecated. See chrome/browser/ui/webui/settings/chromeos/ instead. achuith@chromium.org stevenjb@chromium.org
diff --git a/chrome/browser/ui/webui/options/manage_profile_handler.cc b/chrome/browser/ui/webui/options/manage_profile_handler.cc index e8403f8..541ee483 100644 --- a/chrome/browser/ui/webui/options/manage_profile_handler.cc +++ b/chrome/browser/ui/webui/options/manage_profile_handler.cc
@@ -40,6 +40,7 @@ #include "components/prefs/scoped_user_pref_update.h" #include "components/signin/core/browser/signin_manager.h" #include "components/signin/core/common/profile_management_switches.h" +#include "components/strings/grit/components_strings.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/web_ui.h"
diff --git a/chrome/browser/update_client/OWNERS b/chrome/browser/update_client/OWNERS index be72ff8..75e2f4d 100644 --- a/chrome/browser/update_client/OWNERS +++ b/chrome/browser/update_client/OWNERS
@@ -2,3 +2,5 @@ cpu@chromium.org sorin@chromium.org waffles@chromium.org + +# COMPONENT: Internals>Installer>Components
diff --git a/chrome/common/extensions/extension_process_policy.cc b/chrome/common/extensions/extension_process_policy.cc index 59fb528e..5b2c8140 100644 --- a/chrome/common/extensions/extension_process_policy.cc +++ b/chrome/common/extensions/extension_process_policy.cc
@@ -79,8 +79,8 @@ const std::string group_name = base::FieldTrialList::FindFullName("SiteIsolationExtensions"); // Use StartsWith() for more flexibility (e.g. multiple Enabled groups). - return base::StartsWith(group_name, "Enabled", - base::CompareCase::INSENSITIVE_ASCII); + return !base::StartsWith(group_name, "Control", + base::CompareCase::INSENSITIVE_ASCII); } } // namespace extensions
diff --git a/chrome/install_static/install_util.cc b/chrome/install_static/install_util.cc index 6101f59e..0def16a 100644 --- a/chrome/install_static/install_util.cc +++ b/chrome/install_static/install_util.cc
@@ -311,6 +311,10 @@ return InstallDetails::Get().system_level(); } +const wchar_t* GetAppGuid() { + return InstallDetails::Get().app_guid(); +} + bool GetCollectStatsConsent() { bool enabled = true;
diff --git a/chrome/install_static/install_util.h b/chrome/install_static/install_util.h index a6f3be8..9dc3be1b 100644 --- a/chrome/install_static/install_util.h +++ b/chrome/install_static/install_util.h
@@ -54,6 +54,11 @@ // Returns true if Chrome is running at system level. bool IsSystemInstall(); +// Returns the app GUID with which Chrome is registered with Google Update, or +// an empty string if this brand does not integrate with Google Update. This is +// a simple convenience wrapper around InstallDetails. +const wchar_t* GetAppGuid(); + // Returns true if usage stats collecting is enabled for this user for the // current executable. bool GetCollectStatsConsent();
diff --git a/chrome/install_static/install_util_unittest.cc b/chrome/install_static/install_util_unittest.cc index 8e8f7b9ff..1f9b1640 100644 --- a/chrome/install_static/install_util_unittest.cc +++ b/chrome/install_static/install_util_unittest.cc
@@ -6,6 +6,7 @@ #include <tuple> +#include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/test/test_reg_util_win.h" #include "chrome/install_static/install_details.h" @@ -16,6 +17,7 @@ #include "testing/gtest/include/gtest/gtest.h" using ::testing::ElementsAre; +using ::testing::StrCaseEq; namespace install_static { @@ -341,6 +343,28 @@ DISALLOW_COPY_AND_ASSIGN(InstallStaticUtilTest); }; +TEST_P(InstallStaticUtilTest, GetAppGuid) { + // For brands that do not integrate with Omaha/Google Update, the app guid is + // an empty string. + if (!kUseGoogleUpdateIntegration) { + EXPECT_STREQ(L"", GetAppGuid()); + return; + } + +#if defined(GOOGLE_CHROME_BUILD) + // The app guids for the brand's install modes; parallel to kInstalLModes. + static constexpr const wchar_t* kAppGuids[] = { + L"{8A69D345-D564-463c-AFF1-A69D9E530F96}", // Google Chrome. + L"{4EA16AC7-FD5A-47C3-875B-DBF4A2008C20}", // Google Chrome SxS (Canary). + }; + static_assert(arraysize(kAppGuids) == NUM_INSTALL_MODES, + "kAppGuids out of date."); + EXPECT_THAT(GetAppGuid(), StrCaseEq(kAppGuids[std::get<0>(GetParam())])); +#else + FAIL() << "Not implemented."; +#endif +} + TEST_P(InstallStaticUtilTest, UsageStatsAbsent) { EXPECT_FALSE(GetCollectStatsConsent()); }
diff --git a/chrome/installer/util/app_registration_data.h b/chrome/installer/util/app_registration_data.h index f438a39e..b19ff80 100644 --- a/chrome/installer/util/app_registration_data.h +++ b/chrome/installer/util/app_registration_data.h
@@ -12,7 +12,6 @@ class AppRegistrationData { public: virtual ~AppRegistrationData() {} - virtual base::string16 GetAppGuid() const = 0; virtual base::string16 GetStateKey() const = 0; virtual base::string16 GetStateMediumKey() const = 0; virtual base::string16 GetVersionKey() const = 0;
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc index c9ff282..6dda8cd 100644 --- a/chrome/installer/util/browser_distribution.cc +++ b/chrome/installer/util/browser_distribution.cc
@@ -92,10 +92,6 @@ return *app_reg_data_; } -base::string16 BrowserDistribution::GetAppGuid() const { - return app_reg_data_->GetAppGuid(); -} - base::string16 BrowserDistribution::GetStateKey() const { return app_reg_data_->GetStateKey(); }
diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h index 7696b54..4a0c40f 100644 --- a/chrome/installer/util/browser_distribution.h +++ b/chrome/installer/util/browser_distribution.h
@@ -42,7 +42,6 @@ // Getter and adaptors for the underlying |app_reg_data_|. const AppRegistrationData& GetAppRegistrationData() const; - base::string16 GetAppGuid() const; base::string16 GetStateKey() const; base::string16 GetStateMediumKey() const; base::string16 GetVersionKey() const;
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc index 510ec78..c4701ed 100644 --- a/chrome/installer/util/google_chrome_distribution.cc +++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -23,6 +23,7 @@ #include "base/win/windows_version.h" #include "chrome/common/chrome_icon_resources_win.h" #include "chrome/common/chrome_paths_internal.h" +#include "chrome/install_static/install_util.h" #include "chrome/installer/util/app_registration_data.h" #include "chrome/installer/util/channel_info.h" #include "chrome/installer/util/google_update_constants.h" @@ -147,7 +148,7 @@ } base::string16 GoogleChromeDistribution::GetActiveSetupGuid() { - return GetAppGuid(); + return install_static::GetAppGuid(); } base::string16 GoogleChromeDistribution::GetBaseAppName() { @@ -203,7 +204,7 @@ base::string16 GoogleChromeDistribution::GetDistributionData(HKEY root_key) { base::string16 sub_key(google_update::kRegPathClientState); sub_key.append(L"\\"); - sub_key.append(GetAppGuid()); + sub_key.append(install_static::GetAppGuid()); base::win::RegKey client_state_key( root_key, sub_key.c_str(), KEY_READ | KEY_WOW64_32KEY); @@ -280,9 +281,10 @@ void GoogleChromeDistribution::UpdateInstallStatus(bool system_install, installer::ArchiveType archive_type, installer::InstallStatus install_status) { - GoogleUpdateSettings::UpdateInstallStatus(system_install, - archive_type, InstallUtil::GetInstallReturnCode(install_status), - GetAppGuid()); + GoogleUpdateSettings::UpdateInstallStatus( + system_install, archive_type, + InstallUtil::GetInstallReturnCode(install_status), + install_static::GetAppGuid()); } bool GoogleChromeDistribution::ShouldSetExperimentLabels() {
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc index ec04bcf..47f07a6 100644 --- a/chrome/installer/util/google_update_settings.cc +++ b/chrome/installer/util/google_update_settings.cc
@@ -22,6 +22,7 @@ #include "base/win/registry.h" #include "base/win/win_util.h" #include "chrome/common/chrome_switches.h" +#include "chrome/install_static/install_util.h" #include "chrome/installer/util/app_registration_data.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/channel_info.h" @@ -552,7 +553,7 @@ } GoogleUpdateSettings::UpdatePolicy GoogleUpdateSettings::GetAppUpdatePolicy( - const base::string16& app_guid, + base::StringPiece16 app_guid, bool* is_overridden) { bool found_override = false; UpdatePolicy update_policy = kDefaultUpdatePolicy; @@ -567,7 +568,7 @@ ERROR_SUCCESS) { DWORD value = 0; base::string16 app_update_override(kUpdateOverrideValuePrefix); - app_update_override.append(app_guid); + app_guid.AppendToString(&app_update_override); // First try to read and comprehend the app-specific override. found_override = (policy_key.ReadValueDW(app_update_override.c_str(), &value) == ERROR_SUCCESS && @@ -603,8 +604,8 @@ return false; } - BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - UpdatePolicy app_policy = GetAppUpdatePolicy(dist->GetAppGuid(), nullptr); + UpdatePolicy app_policy = + GetAppUpdatePolicy(install_static::GetAppGuid(), nullptr); return app_policy == AUTOMATIC_UPDATES || app_policy == AUTO_UPDATES_ONLY; #else // defined(GOOGLE_CHROME_BUILD) // Chromium does not auto update. @@ -634,8 +635,7 @@ // AUTOMATIC_UPDATES is marginally more likely to let a user update and this // code is only called when a stuck user asks for updates. base::string16 app_update_override(kUpdateOverrideValuePrefix); - app_update_override.append( - BrowserDistribution::GetDistribution()->GetAppGuid()); + app_update_override.append(install_static::GetAppGuid()); if (policy_key.ReadValueDW(app_update_override.c_str(), &value) != ERROR_SUCCESS) { automatic_updates_allowed_by_overrides = false; @@ -711,12 +711,9 @@ } void GoogleUpdateSettings::RecordChromeUpdatePolicyHistograms() { - const base::string16 app_guid = - BrowserDistribution::GetDistribution()->GetAppGuid(); - bool is_overridden = false; - const UpdatePolicy update_policy = GetAppUpdatePolicy(app_guid, - &is_overridden); + const UpdatePolicy update_policy = + GetAppUpdatePolicy(install_static::GetAppGuid(), &is_overridden); UMA_HISTOGRAM_BOOLEAN("GoogleUpdate.UpdatePolicyIsOverridden", is_overridden); UMA_HISTOGRAM_ENUMERATION("GoogleUpdate.EffectivePolicy", update_policy, UPDATE_POLICIES_COUNT); @@ -849,9 +846,7 @@ bool GoogleUpdateSettings::GetUpdateDetail(bool system_install, ProductData* data) { - BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - return GetUpdateDetailForApp(system_install, - dist->GetAppGuid().c_str(), + return GetUpdateDetailForApp(system_install, install_static::GetAppGuid(), data); }
diff --git a/chrome/installer/util/google_update_settings.h b/chrome/installer/util/google_update_settings.h index 2f855dfc..d14fb21 100644 --- a/chrome/installer/util/google_update_settings.h +++ b/chrome/installer/util/google_update_settings.h
@@ -13,6 +13,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "base/strings/string16.h" +#include "base/strings/string_piece.h" #include "base/time/time.h" #include "base/version.h" #include "build/build_config.h" @@ -252,7 +253,7 @@ // Returns the effective update policy for |app_guid| as dictated by // Group Policy settings. |is_overridden|, if non-NULL, is populated with // true if an app-specific policy override is in force, or false otherwise. - static UpdatePolicy GetAppUpdatePolicy(const base::string16& app_guid, + static UpdatePolicy GetAppUpdatePolicy(base::StringPiece16 app_guid, bool* is_overridden); // Returns true if Chrome should be updated automatically by Google Update
diff --git a/chrome/installer/util/google_update_settings_unittest.cc b/chrome/installer/util/google_update_settings_unittest.cc index ea59e998..65743b6 100644 --- a/chrome/installer/util/google_update_settings_unittest.cc +++ b/chrome/installer/util/google_update_settings_unittest.cc
@@ -20,6 +20,7 @@ #include "base/win/registry.h" #include "base/win/win_util.h" #include "chrome/common/chrome_constants.h" +#include "chrome/install_static/install_util.h" #include "chrome/install_static/test/scoped_install_details.h" #include "chrome/installer/util/app_registration_data.h" #include "chrome/installer/util/browser_distribution.h" @@ -706,21 +707,19 @@ } TEST_F(GoogleUpdateSettingsTest, PerAppUpdatesDisabledByPolicy) { - BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - EXPECT_TRUE( - SetUpdatePolicyForAppGuid(dist->GetAppGuid(), - GoogleUpdateSettings::UPDATES_DISABLED)); + const wchar_t* app_guid = install_static::GetAppGuid(); + EXPECT_TRUE(SetUpdatePolicyForAppGuid( + app_guid, GoogleUpdateSettings::UPDATES_DISABLED)); bool is_overridden = false; GoogleUpdateSettings::UpdatePolicy update_policy = - GoogleUpdateSettings::GetAppUpdatePolicy(dist->GetAppGuid(), - &is_overridden); + GoogleUpdateSettings::GetAppUpdatePolicy(app_guid, &is_overridden); EXPECT_TRUE(is_overridden); EXPECT_EQ(GoogleUpdateSettings::UPDATES_DISABLED, update_policy); EXPECT_FALSE(GoogleUpdateSettings::AreAutoupdatesEnabled()); EXPECT_TRUE(GoogleUpdateSettings::ReenableAutoupdates()); - update_policy = GoogleUpdateSettings::GetAppUpdatePolicy(dist->GetAppGuid(), - &is_overridden); + update_policy = + GoogleUpdateSettings::GetAppUpdatePolicy(app_guid, &is_overridden); // Should still have a policy but now that policy should explicitly enable // updates. EXPECT_TRUE(is_overridden); @@ -731,10 +730,9 @@ TEST_F(GoogleUpdateSettingsTest, PerAppUpdatesEnabledWithGlobalDisabled) { // Disable updates globally but enable them for Chrome (the app-specific // setting should take precedence). - BrowserDistribution* dist = BrowserDistribution::GetDistribution(); - EXPECT_TRUE( - SetUpdatePolicyForAppGuid(dist->GetAppGuid(), - GoogleUpdateSettings::AUTOMATIC_UPDATES)); + const wchar_t* app_guid = install_static::GetAppGuid(); + EXPECT_TRUE(SetUpdatePolicyForAppGuid( + app_guid, GoogleUpdateSettings::AUTOMATIC_UPDATES)); EXPECT_TRUE(SetGlobalUpdatePolicy(GoogleUpdateSettings::UPDATES_DISABLED)); // Make sure we read this as still having updates enabled. @@ -743,27 +741,26 @@ // Make sure that the reset action returns true and is a no-op. EXPECT_TRUE(GoogleUpdateSettings::ReenableAutoupdates()); EXPECT_EQ(GoogleUpdateSettings::AUTOMATIC_UPDATES, - GetUpdatePolicyForAppGuid(dist->GetAppGuid())); + GetUpdatePolicyForAppGuid(app_guid)); EXPECT_EQ(GoogleUpdateSettings::UPDATES_DISABLED, GetGlobalUpdatePolicy()); } TEST_F(GoogleUpdateSettingsTest, GlobalUpdatesDisabledByPolicy) { - BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + const wchar_t* app_guid = install_static::GetAppGuid(); EXPECT_TRUE(SetGlobalUpdatePolicy(GoogleUpdateSettings::UPDATES_DISABLED)); bool is_overridden = false; // The contract for GetAppUpdatePolicy states that |is_overridden| should be // set to false when updates are disabled on a non-app-specific basis. GoogleUpdateSettings::UpdatePolicy update_policy = - GoogleUpdateSettings::GetAppUpdatePolicy(dist->GetAppGuid(), - &is_overridden); + GoogleUpdateSettings::GetAppUpdatePolicy(app_guid, &is_overridden); EXPECT_FALSE(is_overridden); EXPECT_EQ(GoogleUpdateSettings::UPDATES_DISABLED, update_policy); EXPECT_FALSE(GoogleUpdateSettings::AreAutoupdatesEnabled()); EXPECT_TRUE(GoogleUpdateSettings::ReenableAutoupdates()); - update_policy = GoogleUpdateSettings::GetAppUpdatePolicy(dist->GetAppGuid(), - &is_overridden); + update_policy = + GoogleUpdateSettings::GetAppUpdatePolicy(app_guid, &is_overridden); // Policy should now be to enable updates, |is_overridden| should still be // false. EXPECT_FALSE(is_overridden);
diff --git a/chrome/installer/util/non_updating_app_registration_data.cc b/chrome/installer/util/non_updating_app_registration_data.cc index ba7e629..cfec116 100644 --- a/chrome/installer/util/non_updating_app_registration_data.cc +++ b/chrome/installer/util/non_updating_app_registration_data.cc
@@ -9,10 +9,6 @@ NonUpdatingAppRegistrationData::~NonUpdatingAppRegistrationData() {} -base::string16 NonUpdatingAppRegistrationData::GetAppGuid() const { - return base::string16(); -} - base::string16 NonUpdatingAppRegistrationData::GetStateKey() const { return key_path_; }
diff --git a/chrome/installer/util/non_updating_app_registration_data.h b/chrome/installer/util/non_updating_app_registration_data.h index a25f97a0..d6f4ff8 100644 --- a/chrome/installer/util/non_updating_app_registration_data.h +++ b/chrome/installer/util/non_updating_app_registration_data.h
@@ -15,7 +15,6 @@ public: explicit NonUpdatingAppRegistrationData(const base::string16& key_path); ~NonUpdatingAppRegistrationData() override; - base::string16 GetAppGuid() const override; base::string16 GetStateKey() const override; base::string16 GetStateMediumKey() const override; base::string16 GetVersionKey() const override;
diff --git a/chrome/installer/util/test_app_registration_data.cc b/chrome/installer/util/test_app_registration_data.cc index b370df3..79b9807 100644 --- a/chrome/installer/util/test_app_registration_data.cc +++ b/chrome/installer/util/test_app_registration_data.cc
@@ -10,10 +10,6 @@ TestAppRegistrationData::~TestAppRegistrationData() { } -base::string16 TestAppRegistrationData::GetAppGuid() const { - return L"test_app_guid"; -} - base::string16 TestAppRegistrationData::GetStateKey() const { return L"Software\\Chromium\\ClientState\\test_app_guid"; }
diff --git a/chrome/installer/util/test_app_registration_data.h b/chrome/installer/util/test_app_registration_data.h index 9b5fb86..364f845 100644 --- a/chrome/installer/util/test_app_registration_data.h +++ b/chrome/installer/util/test_app_registration_data.h
@@ -11,7 +11,6 @@ public: TestAppRegistrationData(); ~TestAppRegistrationData() override; - base::string16 GetAppGuid() const override; base::string16 GetStateKey() const override; base::string16 GetStateMediumKey() const override; base::string16 GetVersionKey() const override;
diff --git a/chrome/installer/util/updating_app_registration_data.cc b/chrome/installer/util/updating_app_registration_data.cc index 26315fe7..c9722a24 100644 --- a/chrome/installer/util/updating_app_registration_data.cc +++ b/chrome/installer/util/updating_app_registration_data.cc
@@ -11,10 +11,6 @@ UpdatingAppRegistrationData::~UpdatingAppRegistrationData() {} -base::string16 UpdatingAppRegistrationData::GetAppGuid() const { - return app_guid_; -} - base::string16 UpdatingAppRegistrationData::GetStateKey() const { return base::string16(google_update::kRegPathClientState) .append(1, L'\\')
diff --git a/chrome/installer/util/updating_app_registration_data.h b/chrome/installer/util/updating_app_registration_data.h index d9114b9..e7ac94f 100644 --- a/chrome/installer/util/updating_app_registration_data.h +++ b/chrome/installer/util/updating_app_registration_data.h
@@ -15,7 +15,6 @@ public: explicit UpdatingAppRegistrationData(const base::string16& app_guid); ~UpdatingAppRegistrationData() override; - base::string16 GetAppGuid() const override; base::string16 GetStateKey() const override; base::string16 GetStateMediumKey() const override; base::string16 GetVersionKey() const override;
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index f4601a9..906c382 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -4252,7 +4252,6 @@ if (safe_browsing_mode > 0) { sources += [ "../browser/safe_browsing/certificate_reporting_service_unittest.cc", - "../browser/safe_browsing/ping_manager_unittest.cc", "../browser/safe_browsing/safe_browsing_blocking_page_unittest.cc", "../browser/safe_browsing/threat_details_unittest.cc", "../browser/safe_browsing/ui_manager_unittest.cc", @@ -4333,6 +4332,7 @@ ] deps += [ ":test_proto", + "//components/safe_browsing:base_ping_manager_unittest", "//components/safe_browsing_db:v4_test_util", ]
diff --git a/chrome/test/chromedriver/client/chromedriver.py b/chrome/test/chromedriver/client/chromedriver.py index 0bcfb27..3ef9161 100644 --- a/chrome/test/chromedriver/client/chromedriver.py +++ b/chrome/test/chromedriver/client/chromedriver.py
@@ -2,8 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import sys import platform +import sys +import util import command_executor from command_executor import Command @@ -133,12 +134,13 @@ elif chrome_binary: options['binary'] = chrome_binary - # TODO(samuong): speculative fix for crbug.com/611886 - if (sys.platform.startswith('linux') and - platform.architecture()[0] == '32bit'): + if sys.platform.startswith('linux') and not util.Is64Bit(): if chrome_switches is None: chrome_switches = [] + # Workaround for crbug.com/611886. chrome_switches.append('no-sandbox') + # https://bugs.chromium.org/p/chromedriver/issues/detail?id=1695 + chrome_switches.append('disable-gpu') if chrome_switches: assert type(chrome_switches) is list
diff --git a/chrome/test/chromedriver/test/run_java_tests.py b/chrome/test/chromedriver/test/run_java_tests.py index cdacd01..acfe35c 100755 --- a/chrome/test/chromedriver/test/run_java_tests.py +++ b/chrome/test/chromedriver/test/run_java_tests.py
@@ -102,11 +102,13 @@ 'webdriver.chrome.driver=' + os.path.abspath(chromedriver_path)] if chrome_path: if util.IsLinux() and not util.Is64Bit(): - # Workaround for crbug.com/611886 + # Workaround for crbug.com/611886 and + # https://bugs.chromium.org/p/chromedriver/issues/detail?id=1695 chrome_wrapper_path = os.path.join(test_dir, 'chrome-wrapper-no-sandbox') with open(chrome_wrapper_path, 'w') as f: f.write('#!/bin/sh\n') - f.write('exec %s --no-sandbox "$@"\n' % os.path.abspath(chrome_path)) + f.write('exec %s --no-sandbox --disable-gpu "$@"\n' % + os.path.abspath(chrome_path)) st = os.stat(chrome_wrapper_path) os.chmod(chrome_wrapper_path, st.st_mode | stat.S_IEXEC) else:
diff --git a/chrome/test/data/webui/extensions/extension_item_test.js b/chrome/test/data/webui/extensions/extension_item_test.js index 1abfcc3..8e4dc41b 100644 --- a/chrome/test/data/webui/extensions/extension_item_test.js +++ b/chrome/test/data/webui/extensions/extension_item_test.js
@@ -25,9 +25,9 @@ {selector: '#version', text: extensionData.version}, {selector: '#extension-id', text: 'ID:' + extensionData.id}, {selector: '#inspect-views'}, - {selector: '#inspect-views paper-button', text: 'foo.html'}, - {selector: '#inspect-views paper-button:nth-of-type(0n + 2)', - text: 'bar.html'}, + {selector: '#inspect-views paper-button', text: 'foo.html,'}, + {selector: '#inspect-views paper-button:nth-of-type(2)', + text: '1 more…'}, ]; /** @@ -125,20 +125,29 @@ mockDelegate.testClickingCalls( item.$$('#inspect-views paper-button'), 'inspectItemView', [item.data.id, item.data.views[0]]); - mockDelegate.testClickingCalls( - item.$$('#inspect-views paper-button:nth-of-type(0n + 2)'), - 'inspectItemView', [item.data.id, item.data.views[1]]); - var listener = new extension_test_util.ListenerMock(); - listener.addListener(item, 'extension-item-show-details', + var listener1 = new extension_test_util.ListenerMock(); + listener1.addListener(item, 'extension-item-show-details', {data: item.data}); MockInteractions.tap(item.$$('#details-button')); - listener.verify(); + listener1.verify(); + + var listener2 = new extension_test_util.ListenerMock(); + listener2.addListener(item, 'extension-item-show-details', + {data: item.data}); + MockInteractions.tap( + item.$$('#inspect-views paper-button:nth-of-type(2)')); + listener2.verify(); item.set('data.disableReasons.corruptInstall', true); Polymer.dom.flush(); mockDelegate.testClickingCalls( item.$$('#repair-button'), 'repairItem', [item.data.id]); + + item.set('data.disableReasons.corruptInstall', false); + Polymer.dom.flush(); + mockDelegate.testClickingCalls( + item.$$('#reload-button'), 'reloadItem', [item.data.id]); }); test(assert(TestNames.Warnings), function() {
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js index 792eece..193be25 100644 --- a/chrome/test/data/webui/settings/cr_settings_browsertest.js +++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -861,6 +861,32 @@ mocha.run(); }); +/** + * Test fixture for internet-page. + * @constructor + * @extends {CrSettingsBrowserTest} + */ +function CrSettingsInternetPageTest() {} + +CrSettingsInternetPageTest.prototype = { + __proto__: CrSettingsBrowserTest.prototype, + + /** @override */ + browsePreload: 'chrome://md-settings/internet_page/internet_page.html', + + /** @override */ + extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([ + ROOT_PATH + 'ui/webui/resources/js/assert.js', + '../fake_chrome_event.js', + 'fake_networking_private.js', + 'internet_page_tests.js', + ]), +}; + +TEST_F('CrSettingsInternetPageTest', 'InternetPageTest', function() { + mocha.run(); +}); + GEN('#endif'); /**
diff --git a/chrome/test/data/webui/settings/fake_networking_private.js b/chrome/test/data/webui/settings/fake_networking_private.js new file mode 100644 index 0000000..730962e --- /dev/null +++ b/chrome/test/data/webui/settings/fake_networking_private.js
@@ -0,0 +1,156 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview Fake implementation of chrome.networkingPrivate for testing. + */ +cr.define('settings', function() { + /** + * @constructor + * @implements {NetworkingPrivate} + */ + function FakeNetworkingPrivate() { + /** @type {!Object<chrome.networkingPrivate.DeviceStateProperties>} */ + this.deviceStates_ = {}; + + /** @type {!Array<!CrOnc.NetworkStateProperties>} */ + this.networkStates_ = []; + + /** @type {!{chrome.networkingPrivate.GlobalPolicy}} */ + this.globalPolicy_ = {}; + + this.resetForTest(); + } + + FakeNetworkingPrivate.prototype = { + resetForTest() { + this.deviceStates_ = { + Ethernet: {Type: 'Ethernet', State: 'Enabled'}, + WiFi: {Type: 'WiFi', State: ''}, + Cellular: {Type: 'Cellular', State: ''}, + WiMAX: {Type: 'WiMAX', State: ''}, + }; + + this.networkStates_ = [ + {GUID: 'eth0_guid', Type: 'Ethernet'}, + ]; + + this.globalPolicy_ = {}; + }, + + /** @param {!Array<!CrOnc.NetworkStateProperties>} network */ + addNetworksForTest: function(networks) { + this.networkStates_ = this.networkStates_.concat(networks); + }, + + /** + * @param {string} type + * @return {?chrome.networkingPrivate.DeviceStateProperties} + */ + getDeviceStateForTest: function(type) { + return this.deviceStates_[type] || null; + }, + + /** @override */ + getProperties: assertNotReached, + + /** @override */ + getManagedProperties: assertNotReached, + + /** @override */ + getState: assertNotReached, + + /** @override */ + setProperties: assertNotReached, + + /** @override */ + createNetwork: assertNotReached, + + /** @override */ + forgetNetwork: assertNotReached, + + /** @override */ + getNetworks: function(filter, callback) { + callback(this.networkStates_); + }, + + /** @override */ + getDeviceStates: function(callback) { + var devices = []; + Object.keys(this.deviceStates_).forEach(function(type) { + var state = this.deviceStates_[type]; + if (state.State != '') + devices.push(state); + }.bind(this)); + callback(devices); + }, + + /** @override */ + enableNetworkType: function(type) { + this.deviceStates_[type].State = 'Enabled'; + this.onDeviceStateListChanged.callListeners(); + }, + + /** @override */ + disableNetworkType: function(type) { + this.deviceStates_[type].State = 'Disabled'; + this.onDeviceStateListChanged.callListeners(); + }, + + /** @override */ + requestNetworkScan: function() {}, + + /** @override */ + startConnect: assertNotReached, + + /** @override */ + startDisconnect: assertNotReached, + + /** @override */ + startActivate: assertNotReached, + + /** @override */ + verifyDestination: assertNotReached, + + /** @override */ + verifyAndEncryptCredentials: assertNotReached, + + /** @override */ + verifyAndEncryptData: assertNotReached, + + /** @override */ + setWifiTDLSEnabledState: assertNotReached, + + /** @override */ + getWifiTDLSStatus: assertNotReached, + + /** @override */ + getCaptivePortalStatus: assertNotReached, + + /** @override */ + unlockCellularSim: assertNotReached, + + /** @override */ + setCellularSimState: assertNotReached, + + /** @override */ + getGlobalPolicy: function(callback) { + callback(this.globalPolicy_); + }, + + /** @type {!FakeChromeEvent} */ + onNetworksChanged: new FakeChromeEvent(), + + /** @type {!FakeChromeEvent} */ + onNetworkListChanged: new FakeChromeEvent(), + + /** @type {!FakeChromeEvent} */ + onDeviceStateListChanged: new FakeChromeEvent(), + + /** @type {!FakeChromeEvent} */ + onPortalDetectionCompleted: new FakeChromeEvent(), + }; + + return {FakeNetworkingPrivate: FakeNetworkingPrivate}; +});
diff --git a/chrome/test/data/webui/settings/import_data_dialog_test.js b/chrome/test/data/webui/settings/import_data_dialog_test.js index d053879..595b67a0 100644 --- a/chrome/test/data/webui/settings/import_data_dialog_test.js +++ b/chrome/test/data/webui/settings/import_data_dialog_test.js
@@ -74,17 +74,6 @@ }; } - var prefs = {}; - [ - 'import_history', - 'import_bookmarks', - 'import_saved_passwords', - 'import_search_engine', - 'import_autofill_form_data', - ].forEach(function(name) { - prefs[name] = createBooleanPref(name); - }); - var dialog = null; setup(function() { @@ -93,7 +82,6 @@ settings.ImportDataBrowserProxyImpl.instance_ = browserProxy; PolymerTest.clearBody(); dialog = document.createElement('settings-import-data-dialog'); - dialog.set('prefs', prefs); document.body.appendChild(dialog); return browserProxy.whenCalled('initializeImportDialog').then(function() { assertTrue(dialog.$.dialog.open); @@ -118,21 +106,28 @@ test('ImportButton', function() { assertFalse(dialog.$.import.disabled); - // Flip all prefs to false. - Object.keys(prefs).forEach(function(prefName) { - dialog.set('prefs.' + prefName + '.value', false); + var checkboxes = dialog.shadowRoot.querySelectorAll('paper-checkbox'); + assertEquals(5, checkboxes.length); + + checkboxes.forEach(function(checkbox) { + checkbox.checked = false; }); + checkboxes[0].fire('change'); assertTrue(dialog.$.import.disabled); // Change browser selection to "Import from Bookmarks HTML file". simulateBrowserProfileChange(1); assertTrue(dialog.$.import.disabled); - // Ensure everything except |import_bookmarks| is ignored. - dialog.set('prefs.import_history.value', true); + // Ensure everything except |favorites| is ignored. + var history = dialog.$$('#history'); + history.checked = true; + history.fire('change'); assertTrue(dialog.$.import.disabled); - dialog.set('prefs.import_bookmarks.value', true); + var favorites = dialog.$$('#favorites'); + favorites.checked = true; + favorites.fire('change'); assertFalse(dialog.$.import.disabled); }); @@ -175,7 +170,7 @@ }); test('ImportFromBrowserProfile', function() { - dialog.set('prefs.import_bookmarks.value', false); + dialog.$.favorites.checked = false; var expectedIndex = 0; simulateBrowserProfileChange(expectedIndex);
diff --git a/chrome/test/data/webui/settings/internet_page_tests.js b/chrome/test/data/webui/settings/internet_page_tests.js new file mode 100644 index 0000000..7ef4f5e2 --- /dev/null +++ b/chrome/test/data/webui/settings/internet_page_tests.js
@@ -0,0 +1,112 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +suite('Internet', function() { + /** @type {InternetPageElement} */ + var internetPage = null; + + /** @type {NetworkSummaryElement} */ + var networkSummary_ = null; + + /** @type {NetworkingPrivate} */ + var networkingPrivateApi_; + + suiteSetup(function() { + loadTimeData.overrideValues({ + internetAddConnection: 'internetAddConnection', + internetAddConnectionExpandA11yLabel: + 'internetAddConnectionExpandA11yLabel', + internetAddConnectionNotAllowed: 'internetAddConnectionNotAllowed', + internetAddThirdPartyVPN: 'internetAddThirdPartyVPN', + internetAddVPN: 'internetAddVPN', + internetAddWiFi: 'internetAddWiFi', + internetDetailPageTitle: 'internetDetailPageTitle', + internetKnownNetworksPageTitle: 'internetKnownNetworksPageTitle', + }); + + CrOncStrings = { + OncTypeCellular: 'OncTypeCellular', + OncTypeEthernet: 'OncTypeEthernet', + OncTypeVPN: 'OncTypeVPN', + OncTypeWiFi: 'OncTypeWiFi', + OncTypeWiMAX: 'OncTypeWiMAX', + networkDisabled: 'networkDisabled', + networkListItemConnected: 'networkListItemConnected', + networkListItemConnecting: 'networkListItemConnecting', + networkListItemConnectingTo: 'networkListItemConnectingTo', + networkListItemNotConnected: 'networkListItemNotConnected', + vpnNameTemplate: 'vpnNameTemplate', + }; + + networkingPrivateApi_ = new settings.FakeNetworkingPrivate(); + + // Disable animations so sub-pages open within one event loop. + testing.Test.disableAnimationsAndTransitions(); + }); + + suite('MainPage', function() { + setup(function() { + PolymerTest.clearBody(); + internetPage = document.createElement('settings-internet-page'); + assertTrue(!!internetPage); + networkingPrivateApi_.resetForTest(); + internetPage.networkingPrivate = networkingPrivateApi_; + document.body.appendChild(internetPage); + networkSummary_ = internetPage.$$('network-summary'); + assertTrue(!!networkSummary_); + Polymer.dom.flush(); + }); + + teardown(function() { + internetPage.remove(); + }); + + test('Ethernet', function() { + // Default fake device state is Ethernet enabled only. + var ethernet = networkSummary_.$$('#Ethernet'); + assertTrue(!!ethernet); + assertEquals(1, ethernet.networkStateList.length); + assertEquals(null, networkSummary_.$$('#Cellular')); + assertEquals(null, networkSummary_.$$('#VPN')); + assertEquals(null, networkSummary_.$$('#WiMAX')); + assertEquals(null, networkSummary_.$$('#WiFi')); + }); + + test('WiFi', function() { + networkingPrivateApi_.addNetworksForTest([ + {GUID: 'wifi1_guid', Name: 'wifi1', Type: 'WiFi'}, + {GUID: 'wifi12_guid', Name: 'wifi2', Type: 'WiFi'}, + ]); + networkingPrivateApi_.enableNetworkType('WiFi'); + Polymer.dom.flush(); + var wifi = networkSummary_.$$('#WiFi'); + assertTrue(!!wifi); + assertEquals(2, wifi.networkStateList.length); + }); + + test('WiFiToggle', function() { + var api = networkingPrivateApi_; + + // Make WiFi an available but disabled technology. + api.disableNetworkType('WiFi'); + Polymer.dom.flush(); + var wifi = networkSummary_.$$('#WiFi'); + assertTrue(!!wifi); + + // Ensure that the initial state is disabled and the toggle is + // enabled but unchecked. + assertEquals('Disabled', api.getDeviceStateForTest('WiFi').State); + var toggle = wifi.$$('#deviceEnabledButton'); + assertTrue(!!toggle); + assertTrue(toggle.enabled); + assertFalse(toggle.checked); + + // Tap the enable toggle button and ensure the state becomes enabled. + MockInteractions.tap(toggle); + Polymer.dom.flush(); + assertTrue(toggle.checked); + assertEquals('Enabled', api.getDeviceStateForTest('WiFi').State); + }); + }); +});
diff --git a/components/BUILD.gn b/components/BUILD.gn index 5b3a0231..61a73bb5 100644 --- a/components/BUILD.gn +++ b/components/BUILD.gn
@@ -115,7 +115,7 @@ "//components/password_manager/core/browser:unit_tests", "//components/password_manager/core/common:unit_tests", "//components/password_manager/sync/browser:unit_tests", - "//components/payments:unit_tests", + "//components/payments/core:unit_tests", "//components/physical_web/data_source:unit_tests", "//components/precache/core:unit_tests", "//components/prefs:unit_tests", @@ -201,6 +201,7 @@ "//components/offline_pages/content/background_loader:unit_tests", "//components/packed_ct_ev_whitelist:unit_tests", "//components/password_manager/content/browser:unit_tests", + "//components/payments/content:unit_tests", "//components/policy/core/browser:unit_tests", "//components/policy/core/common:unit_tests", "//components/precache/content:unit_tests",
diff --git a/components/component_updater/OWNERS b/components/component_updater/OWNERS index e40d439..2780b5b1 100644 --- a/components/component_updater/OWNERS +++ b/components/component_updater/OWNERS
@@ -3,3 +3,5 @@ mal@chromium.org sorin@chromium.org waffles@chromium.org + +# COMPONENT: Internals>Installer>Components
diff --git a/components/components_strings.grd b/components/components_strings.grd index 0e7cb30..16ca124 100644 --- a/components/components_strings.grd +++ b/components/components_strings.grd
@@ -232,6 +232,12 @@ <message name="IDS_OK" desc="Used for OK on buttons"> OK </message> + <message name="IDS_ADD" desc="Used for Add on buttons"> + Add + </message> + <message name="IDS_SAVE" desc="Used on a button to save information you are editing."> + Save + </message> <message name="IDS_NO_THANKS" desc="Used to dismiss various prompts."> No thanks </message>
diff --git a/components/crash/OWNERS b/components/crash/OWNERS index b76a417..15476a2 100644 --- a/components/crash/OWNERS +++ b/components/crash/OWNERS
@@ -4,3 +4,5 @@ rsesek@chromium.org scottmg@chromium.org thestig@chromium.org + +# COMPONENT: Internals>CrashReporting
diff --git a/components/guest_view/renderer/guest_view_request.cc b/components/guest_view/renderer/guest_view_request.cc index abc7e3a7..1d26c3f4 100644 --- a/components/guest_view/renderer/guest_view_request.cc +++ b/components/guest_view/renderer/guest_view_request.cc
@@ -97,7 +97,8 @@ if (frame->isWebLocalFrame()) { window = frame->mainWorldScriptContext()->Global(); } else { - window = frame->toWebRemoteFrame()->globalProxy(); + window = + frame->toWebRemoteFrame()->deprecatedMainWorldScriptContext()->Global(); } const int argc = 1;
diff --git a/components/net_log/resources/net_export.js b/components/net_log/resources/net_export.js index 43a637d0..b13b90d 100644 --- a/components/net_log/resources/net_export.js +++ b/components/net_log/resources/net_export.js
@@ -105,7 +105,7 @@ $('export-view-send-data').disabled = false; if (!exportNetLogInfo.logCaptureModeKnown) { $('export-view-send-old-log-text').hidden = false; - } else if (exportNetLogInfo.captureMode == 'NORMAL') { + } else if (exportNetLogInfo.captureMode != 'STRIP_PRIVATE_DATA') { $('export-view-private-data-text').hidden = false; } }
diff --git a/components/new_or_sad_tab_strings.grdp b/components/new_or_sad_tab_strings.grdp index a88f6663..b140dcd 100644 --- a/components/new_or_sad_tab_strings.grdp +++ b/components/new_or_sad_tab_strings.grdp
@@ -65,4 +65,23 @@ Undo </message> + <!-- Incognito Tab redesign strings --> + <!-- TODO(msramek): Merge with the above section once this is fully launched. --> + + <message name="IDS_NEW_TAB_OTR_TITLE" desc="Title of the Incognito new tab page." formatter_data="android_java"> + You’ve gone incognito + </message> + <message name="IDS_NEW_TAB_OTR_SUBTITLE" desc="Subtitle of the Incognito new tab page, explaining to the user that the Incognito mode hides their browsing activity from other people using the device." formatter_data="android_java"> + Now you can browse in private, and other people who use this device won’t see your activity. + </message> + <message name="IDS_NEW_TAB_OTR_DISCLAIMER" desc="A disclaimer on the Incognito new tab page, explaining to the user that downloaded files and added bookmarks will be persisted even after the Incognito session is closed." formatter_data="android_java"> + Downloaded files and bookmarks will be kept. + </message> + <message name="IDS_NEW_TAB_OTR_NOT_SAVED_BULLET_POINTS" desc="Bullet points listing data that are not saved in the Incognito mode. The '#' character in this text represents a bullet point. Please keep it unchanged and do not add additional spaces around it. The text between the pair of '|' characters will be highlighted." formatter_data="android_java"> + This information |won’t be saved|:#Your browsing history#Your searches#Cookie data + </message> + <message name="IDS_NEW_TAB_OTR_VISIBLE" desc="Bullet points listing entities that might be able to see the user's Incognito activity. The '#' character in this text represents a bullet point. Please keep it unchanged and do not add additional spaces around it. The text between the pair of '|' characters will be highlighted." formatter_data="android_java"> + Your activity |might still be visible| to:#Websites you visit#Your employer#Your internet service provider + </message> + </grit-part>
diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/offline_pages/core/offline_page_feature.cc index ef2b4700..9f28312 100644 --- a/components/offline_pages/core/offline_page_feature.cc +++ b/components/offline_pages/core/offline_page_feature.cc
@@ -6,8 +6,19 @@ #include <string> +#include "base/command_line.h" #include "base/feature_list.h" +namespace switches { + +// This flag significantly shortens the delay between WebContentsObserver events +// and SnapshotController's StartSnapshot calls. The purpose is to speed up +// integration tests. +const char kOfflinePagesUseTestingSnapshotDelay[] = + "short-offline-page-snapshot-delay-for-test"; + +} // namespace switches + namespace offline_pages { const base::Feature kOfflineBookmarksFeature{"OfflineBookmarks", @@ -68,4 +79,9 @@ return base::FeatureList::IsEnabled(kNewBackgroundLoaderFeature); } +bool ShouldUseTestingSnapshotDelay() { + base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); + return cl->HasSwitch(switches::kOfflinePagesUseTestingSnapshotDelay); +} + } // namespace offline_pages
diff --git a/components/offline_pages/core/offline_page_feature.h b/components/offline_pages/core/offline_page_feature.h index 3210afb..fdd42e6 100644 --- a/components/offline_pages/core/offline_page_feature.h +++ b/components/offline_pages/core/offline_page_feature.h
@@ -45,6 +45,10 @@ // to offline pages. bool ShouldUseNewBackgroundLoader(); +// Returns true if a command line for test has been set that shortens the +// snapshot delay. +bool ShouldUseTestingSnapshotDelay(); + } // namespace offline_pages #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_FEATURE_H_
diff --git a/components/offline_pages/core/snapshot_controller.cc b/components/offline_pages/core/snapshot_controller.cc index 4f7d337..c683a1a9 100644 --- a/components/offline_pages/core/snapshot_controller.cc +++ b/components/offline_pages/core/snapshot_controller.cc
@@ -8,16 +8,20 @@ #include "base/location.h" #include "base/logging.h" #include "base/time/time.h" +#include "components/offline_pages/core/offline_page_feature.h" namespace { // Default delay, in milliseconds, between the main document parsed event and // snapshot. Note: this snapshot might not occur if the OnLoad event and // OnLoad delay elapses first to trigger a final snapshot. -const size_t kDefaultDelayAfterDocumentAvailableMs = 7000; +const int64_t kDefaultDelayAfterDocumentAvailableMs = 7000; // Default delay, in milliseconds, between the main document OnLoad event and // snapshot. -const size_t kDelayAfterDocumentOnLoadCompletedMs = 1000; +const int64_t kDelayAfterDocumentOnLoadCompletedMs = 1000; + +// Delay for testing to keep polling times reasonable. +const int64_t kDelayForTests = 0; } // namespace @@ -26,26 +30,28 @@ SnapshotController::SnapshotController( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, SnapshotController::Client* client) - : task_runner_(task_runner), - client_(client), - state_(State::READY), - delay_after_document_available_ms_(kDefaultDelayAfterDocumentAvailableMs), - delay_after_document_on_load_completed_ms_( - kDelayAfterDocumentOnLoadCompletedMs), - weak_ptr_factory_(this) {} + : SnapshotController(task_runner, + client, + kDefaultDelayAfterDocumentAvailableMs, + kDelayAfterDocumentOnLoadCompletedMs) {} SnapshotController::SnapshotController( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, SnapshotController::Client* client, - size_t delay_after_document_available_ms, - size_t delay_after_document_on_load_completed_ms) + int64_t delay_after_document_available_ms, + int64_t delay_after_document_on_load_completed_ms) : task_runner_(task_runner), client_(client), state_(State::READY), delay_after_document_available_ms_(delay_after_document_available_ms), delay_after_document_on_load_completed_ms_( delay_after_document_on_load_completed_ms), - weak_ptr_factory_(this) {} + weak_ptr_factory_(this) { + if (offline_pages::ShouldUseTestingSnapshotDelay()) { + delay_after_document_available_ms_ = kDelayForTests; + delay_after_document_on_load_completed_ms_ = kDelayForTests; + } +} SnapshotController::~SnapshotController() {} @@ -101,11 +107,11 @@ Stop(); } -size_t SnapshotController::GetDelayAfterDocumentAvailableForTest() { +int64_t SnapshotController::GetDelayAfterDocumentAvailableForTest() { return delay_after_document_available_ms_; } -size_t SnapshotController::GetDelayAfterDocumentOnLoadCompletedForTest() { +int64_t SnapshotController::GetDelayAfterDocumentOnLoadCompletedForTest() { return delay_after_document_on_load_completed_ms_; }
diff --git a/components/offline_pages/core/snapshot_controller.h b/components/offline_pages/core/snapshot_controller.h index dd0ca01..36e1680a 100644 --- a/components/offline_pages/core/snapshot_controller.h +++ b/components/offline_pages/core/snapshot_controller.h
@@ -66,8 +66,8 @@ SnapshotController( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, SnapshotController::Client* client, - size_t delay_after_document_available_ms, - size_t delay_after_document_on_load_completed_ms); + int64_t delay_after_document_available_ms, + int64_t delay_after_document_on_load_completed_ms); virtual ~SnapshotController(); // Resets the 'session', returning controller to initial state. @@ -88,8 +88,8 @@ // Invoked from WebContentObserver::DocumentOnLoadCompletedInMainFrame void DocumentOnLoadCompletedInMainFrame(); - size_t GetDelayAfterDocumentAvailableForTest(); - size_t GetDelayAfterDocumentOnLoadCompletedForTest(); + int64_t GetDelayAfterDocumentAvailableForTest(); + int64_t GetDelayAfterDocumentOnLoadCompletedForTest(); PageQuality current_page_quality() const { return current_page_quality_; } @@ -101,8 +101,8 @@ // Client owns this class. SnapshotController::Client* client_; SnapshotController::State state_; - size_t delay_after_document_available_ms_; - size_t delay_after_document_on_load_completed_ms_; + int64_t delay_after_document_available_ms_; + int64_t delay_after_document_on_load_completed_ms_; // The expected quality of a snapshot taken at the moment this value is // queried.
diff --git a/components/offline_pages/core/snapshot_controller_unittest.cc b/components/offline_pages/core/snapshot_controller_unittest.cc index 390a96e..a57c2da 100644 --- a/components/offline_pages/core/snapshot_controller_unittest.cc +++ b/components/offline_pages/core/snapshot_controller_unittest.cc
@@ -84,7 +84,7 @@ } TEST_F(SnapshotControllerTest, OnDocumentAvailable) { - EXPECT_GT(controller()->GetDelayAfterDocumentAvailableForTest(), 0UL); + EXPECT_GT(controller()->GetDelayAfterDocumentAvailableForTest(), 0LL); // OnDOM should make snapshot after a delay. controller()->DocumentAvailableInMainFrame(); PumpLoop();
diff --git a/components/payments/BUILD.gn b/components/payments/BUILD.gn deleted file mode 100644 index 46f08096..0000000 --- a/components/payments/BUILD.gn +++ /dev/null
@@ -1,96 +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("//mojo/public/tools/bindings/mojom.gni") - -mojom("payment_request") { - sources = [ - "payment_request.mojom", - ] - - public_deps = [ - "//mojo/common:common_custom_types", - ] -} - -mojom("payment_app") { - sources = [ - "payment_app.mojom", - ] - - public_deps = [ - ":payment_request", - "//mojo/common:common_custom_types", - "//url/mojo:url_mojom_gurl", - ] -} - -# TODO(crbug.com/679381): Create a layered component to that we can remove the -# iOS check here (iOS strict DEPS checker doesn't like the //content dependency -# below). -if (!is_ios) { - static_library("payment_request_impl") { - sources = [ - "payment_request.cc", - "payment_request.h", - "payment_request_delegate.h", - "payment_request_dialog.h", - "payment_request_web_contents_manager.cc", - "payment_request_web_contents_manager.h", - ] - - deps = [ - ":payment_request", - ":payment_validation", - "//components/autofill/core/browser", - "//content/public/browser", - "//mojo/public/cpp/bindings", - ] - } -} - -static_library("payment_validation") { - sources = [ - "address_normalizer.cc", - "address_normalizer.h", - "currency_formatter.cc", - "currency_formatter.h", - "payment_details_validation.cc", - "payment_details_validation.h", - "payments_validators.cc", - "payments_validators.h", - ] - - deps = [ - ":payment_request", - "//base", - "//components/autofill/core/browser", - "//third_party/re2:re2", - "//url:url", - ] - - public_deps = [ - "//third_party/icu:icu", - "//third_party/libaddressinput", - ] -} - -source_set("unit_tests") { - testonly = true - sources = [ - "address_normalizer_unittest.cc", - "currency_formatter_unittest.cc", - "payments_validators_test.cc", - ] - - deps = [ - ":payment_validation", - "//base", - "//base/test:test_support", - "//components/autofill/core/browser", - "//testing/gtest", - "//third_party/icu:icu", - "//third_party/libaddressinput:test_support", - ] -}
diff --git a/components/payments/DEPS b/components/payments/DEPS deleted file mode 100644 index 002344e1..0000000 --- a/components/payments/DEPS +++ /dev/null
@@ -1,9 +0,0 @@ -include_rules = [ - "+components/autofill", - # TODO(crbug.com/679381): Move this to components/payments/content. - "+content/public/browser", - - "+mojo/public/cpp", - "+third_party/libaddressinput", # For address i18n. - "+third_party/re2", -]
diff --git a/components/payments/OWNERS b/components/payments/OWNERS index 0ae9d75..2ff5e3b3 100644 --- a/components/payments/OWNERS +++ b/components/payments/OWNERS
@@ -1,7 +1,4 @@ mathp@chromium.org rouslan@chromium.org -per-file *.mojom=set noparent -per-file *.mojom=file://ipc/SECURITY_OWNERS - # COMPONENT: UI>Browser>Autofill>Payments
diff --git a/components/payments/android/payments_jni_registrar.h b/components/payments/android/payments_jni_registrar.h deleted file mode 100644 index 7726c97..0000000 --- a/components/payments/android/payments_jni_registrar.h +++ /dev/null
@@ -1,12 +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 COMPONENTS_PAYMENTS_ANDROID_PAYMENTS_JNI_REGISTRAR_H_ -#define COMPONENTS_PAYMENTS_ANDROID_PAYMENTS_JNI_REGISTRAR_H_ - -#include <jni.h> - -bool RegisterPaymentValidator(JNIEnv* env); - -#endif // COMPONENTS_PAYMENTS_ANDROID_PAYMENTS_JNI_REGISTRAR_H_
diff --git a/components/payments/content/BUILD.gn b/components/payments/content/BUILD.gn new file mode 100644 index 0000000..a6f75fe --- /dev/null +++ b/components/payments/content/BUILD.gn
@@ -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. + +import("//mojo/public/tools/bindings/mojom.gni") + +mojom("payment_request") { + sources = [ + "payment_request.mojom", + ] + + public_deps = [ + "//mojo/common:common_custom_types", + ] +} + +mojom("payment_app") { + sources = [ + "payment_app.mojom", + ] + + public_deps = [ + ":payment_request", + "//mojo/common:common_custom_types", + "//url/mojo:url_mojom_gurl", + ] +} + +static_library("payment_request_impl") { + sources = [ + "payment_request.cc", + "payment_request.h", + "payment_request_delegate.h", + "payment_request_dialog.h", + "payment_request_web_contents_manager.cc", + "payment_request_web_contents_manager.h", + ] + + deps = [ + ":payment_request", + ":payment_validation", + "//components/autofill/core/browser", + "//components/payments/core", + "//content/public/browser", + "//mojo/public/cpp/bindings", + ] +} + +static_library("payment_validation") { + sources = [ + "payment_details_validation.cc", + "payment_details_validation.h", + "payments_validators.cc", + "payments_validators.h", + ] + + deps = [ + ":payment_request", + "//base", + "//components/autofill/core/browser", + "//components/payments/core", + "//third_party/re2", + "//url", + ] + + public_deps = [ + "//third_party/icu", + "//third_party/libaddressinput", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "payments_validators_test.cc", + ] + + deps = [ + ":payment_validation", + "//base", + "//base/test:test_support", + "//components/autofill/core/browser", + "//testing/gtest", + "//third_party/icu", + "//third_party/libaddressinput:test_support", + ] +}
diff --git a/components/payments/content/DEPS b/components/payments/content/DEPS new file mode 100644 index 0000000..ec8a116 --- /dev/null +++ b/components/payments/content/DEPS
@@ -0,0 +1,6 @@ +include_rules = [ + "+components/autofill", + "+content/public/browser", + "+mojo/public/cpp", + "+third_party/re2", +]
diff --git a/components/payments/content/OWNERS b/components/payments/content/OWNERS new file mode 100644 index 0000000..82559c92 --- /dev/null +++ b/components/payments/content/OWNERS
@@ -0,0 +1,4 @@ +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS + +# COMPONENT: UI>Browser>Autofill>Payments
diff --git a/components/payments/android/BUILD.gn b/components/payments/content/android/BUILD.gn similarity index 71% rename from components/payments/android/BUILD.gn rename to components/payments/content/android/BUILD.gn index a1949e5..8dafb9b 100644 --- a/components/payments/android/BUILD.gn +++ b/components/payments/content/android/BUILD.gn
@@ -5,17 +5,19 @@ import("//build/config/android/config.gni") import("//build/config/android/rules.gni") -static_library("payments_jni") { +static_library("android") { sources = [ "currency_formatter_android.cc", "currency_formatter_android.h", - "payments_jni_registrar.cc", + "payment_details_validation_android.cc", + "payment_details_validation_android.h", ] deps = [ ":jni_headers", "//base", - "//components/payments:payment_request", - "//components/payments:payment_validation", + "//components/payments/content:payment_request", + "//components/payments/content:payment_validation", + "//components/payments/core", ] }
diff --git a/components/payments/android/DEPS b/components/payments/content/android/DEPS similarity index 100% rename from components/payments/android/DEPS rename to components/payments/content/android/DEPS
diff --git a/components/payments/android/currency_formatter_android.cc b/components/payments/content/android/currency_formatter_android.cc similarity index 89% rename from components/payments/android/currency_formatter_android.cc rename to components/payments/content/android/currency_formatter_android.cc index e1ea023..0ea0f91 100644 --- a/components/payments/android/currency_formatter_android.cc +++ b/components/payments/content/android/currency_formatter_android.cc
@@ -2,18 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/payments/android/currency_formatter_android.h" +#include "components/payments/content/android/currency_formatter_android.h" #include "base/android/jni_string.h" -#include "base/optional.h" #include "base/strings/string16.h" -#include "components/payments/currency_formatter.h" +#include "components/payments/core/currency_formatter.h" #include "jni/CurrencyFormatter_jni.h" -using base::android::JavaParamRef; -using base::android::ConvertJavaStringToUTF8; - namespace payments { +namespace { + +using ::base::android::JavaParamRef; +using ::base::android::ConvertJavaStringToUTF8; + +} // namespace CurrencyFormatterAndroid::CurrencyFormatterAndroid( JNIEnv* env,
diff --git a/components/payments/android/currency_formatter_android.h b/components/payments/content/android/currency_formatter_android.h similarity index 84% rename from components/payments/android/currency_formatter_android.h rename to components/payments/content/android/currency_formatter_android.h index f6e6b33e2..9693c20 100644 --- a/components/payments/android/currency_formatter_android.h +++ b/components/payments/content/android/currency_formatter_android.h
@@ -2,17 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_PAYMENTS_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ -#define COMPONENTS_PAYMENTS_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ +#ifndef COMPONENTS_PAYMENTS_CONTENT_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ +#define COMPONENTS_PAYMENTS_CONTENT_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ +#include <jni.h> #include <memory> #include "base/android/scoped_java_ref.h" #include "base/macros.h" -#include "components/payments/currency_formatter.h" namespace payments { +class CurrencyFormatter; + // Forwarding calls to payments::CurrencyFormatter. class CurrencyFormatterAndroid { public: @@ -48,4 +50,4 @@ } // namespace payments -#endif // COMPONENTS_PAYMENTS_ANDROID_CURRENCY_FORMATTER_ANDROID_H_ +#endif // COMPONENTS_PAYMENTS_CONTENT_ANDROID_CURRENCY_FORMATTER_ANDROID_H_
diff --git a/components/payments/android/payments_jni_registrar.cc b/components/payments/content/android/payment_details_validation_android.cc similarity index 81% rename from components/payments/android/payments_jni_registrar.cc rename to components/payments/content/android/payment_details_validation_android.cc index 1a80ed1..072dda08 100644 --- a/components/payments/android/payments_jni_registrar.cc +++ b/components/payments/content/android/payment_details_validation_android.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/payments/android/payments_jni_registrar.h" +#include "components/payments/content/android/payment_details_validation_android.h" #include <string> #include <utility> -#include "components/payments/payment_details_validation.h" -#include "components/payments/payment_request.mojom.h" +#include "components/payments/content/payment_details_validation.h" +#include "components/payments/content/payment_request.mojom.h" #include "jni/PaymentValidator_jni.h" namespace payments {
diff --git a/components/payments/content/android/payment_details_validation_android.h b/components/payments/content/android/payment_details_validation_android.h new file mode 100644 index 0000000..88367ae1e --- /dev/null +++ b/components/payments/content/android/payment_details_validation_android.h
@@ -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. + +#ifndef COMPONENTS_PAYMENTS_CONTENT_ANDROID_PAYMENT_DETAILS_VALIDATION_ANDROID_H_ +#define COMPONENTS_PAYMENTS_CONTENT_ANDROID_PAYMENT_DETAILS_VALIDATION_ANDROID_H_ + +#include <jni.h> + +bool RegisterPaymentValidator(JNIEnv* env); + +#endif // COMPONENTS_PAYMENTS_CONTENT_ANDROID_PAYMENT_DETAILS_VALIDATION_ANDROID_H_
diff --git a/components/payments/payment_app.mojom b/components/payments/content/payment_app.mojom similarity index 93% rename from components/payments/payment_app.mojom rename to components/payments/content/payment_app.mojom index 4bcc3e7..0d9f7c6 100644 --- a/components/payments/payment_app.mojom +++ b/components/payments/content/payment_app.mojom
@@ -4,7 +4,7 @@ module payments.mojom; -import "components/payments/payment_request.mojom"; +import "components/payments/content/payment_request.mojom"; import "url/mojo/url.mojom"; enum PaymentAppManifestError {
diff --git a/components/payments/payment_details_validation.cc b/components/payments/content/payment_details_validation.cc similarity index 96% rename from components/payments/payment_details_validation.cc rename to components/payments/content/payment_details_validation.cc index 5fce52fe..3933c1c 100644 --- a/components/payments/payment_details_validation.cc +++ b/components/payments/content/payment_details_validation.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 "components/payments/payment_details_validation.h" +#include "components/payments/content/payment_details_validation.h" #include <set> #include <vector> -#include "components/payments/payment_request.mojom.h" -#include "components/payments/payments_validators.h" +#include "components/payments/content/payment_request.mojom.h" +#include "components/payments/content/payments_validators.h" +namespace payments { namespace { // Validates ShippingOption or PaymentItem, which happen to have identical @@ -139,8 +140,6 @@ } // namespace -namespace payments { - bool validatePaymentDetails(const mojom::PaymentDetailsPtr& details, std::string* error_message) { if (details->total.is_null()) {
diff --git a/components/payments/content/payment_details_validation.h b/components/payments/content/payment_details_validation.h new file mode 100644 index 0000000..e623087 --- /dev/null +++ b/components/payments/content/payment_details_validation.h
@@ -0,0 +1,19 @@ +// 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_PAYMENTS_CONTENT_PAYMENT_DETAILS_VALIDATION_H_ +#define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_DETAILS_VALIDATION_H_ + +#include <string> + +#include "components/payments/content/payment_request.mojom.h" + +namespace payments { + +bool validatePaymentDetails(const mojom::PaymentDetailsPtr& details, + std::string* error_message); + +} // namespace payments + +#endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_DETAILS_VALIDATION_H_
diff --git a/components/payments/payment_request.cc b/components/payments/content/payment_request.cc similarity index 93% rename from components/payments/payment_request.cc rename to components/payments/content/payment_request.cc index 7dda081..0a83cf2 100644 --- a/components/payments/payment_request.cc +++ b/components/payments/content/payment_request.cc
@@ -2,25 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/payments/payment_request.h" +#include "components/payments/content/payment_request.h" + +#include <unordered_map> +#include <utility> #include "base/memory/ptr_util.h" -#include "components/payments/payment_details_validation.h" -#include "components/payments/payment_request_web_contents_manager.h" +#include "components/autofill/core/browser/personal_data_manager.h" +#include "components/payments/content/payment_details_validation.h" +#include "components/payments/content/payment_request_web_contents_manager.h" +#include "components/payments/core/currency_formatter.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/web_contents.h" -using payments::mojom::BasicCardNetwork; - namespace payments { -namespace { - -// Identifier for the basic card payment method in the PaymentMethodData. -const char* const kBasicCardMethodName = "basic-card"; - -} // namespace - PaymentRequest::PaymentRequest( content::WebContents* web_contents, std::unique_ptr<PaymentRequestDelegate> delegate, @@ -40,7 +36,6 @@ // set_connection_error_with_reason_handler with Binding::CloseWithReason. binding_.set_connection_error_handler(base::Bind( &PaymentRequest::OnConnectionTerminated, base::Unretained(this))); - } PaymentRequest::~PaymentRequest() {} @@ -120,12 +115,12 @@ } const std::vector<autofill::AutofillProfile*>& - PaymentRequest::shipping_profiles() { +PaymentRequest::shipping_profiles() { return shipping_profiles_; } const std::vector<autofill::AutofillProfile*>& - PaymentRequest::contact_profiles() { +PaymentRequest::contact_profiles() { return contact_profiles_; } @@ -180,6 +175,8 @@ return; } + // Identifier for the basic card payment method in the PaymentMethodData. + const char* const kBasicCardMethodName = "basic-card"; std::set<std::string> card_networks{"amex", "diners", "discover", "jcb", "mastercard", "mir", "unionpay", "visa"}; @@ -218,6 +215,7 @@ } else { // The merchant has specified a few basic card supported networks. Use // the mapping to transform to known basic-card types. + using ::payments::mojom::BasicCardNetwork; std::unordered_map<BasicCardNetwork, std::string> networks = { {BasicCardNetwork::AMEX, "amex"}, {BasicCardNetwork::DINERS, "diners"},
diff --git a/components/payments/payment_request.h b/components/payments/content/payment_request.h similarity index 93% rename from components/payments/payment_request.h rename to components/payments/content/payment_request.h index 551d8ffe..cdecff31 100644 --- a/components/payments/payment_request.h +++ b/components/payments/content/payment_request.h
@@ -2,22 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ -#define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ +#ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_H_ +#define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_H_ #include <memory> #include <string> #include <vector> -#include "components/autofill/core/browser/personal_data_manager.h" -#include "components/payments/currency_formatter.h" -#include "components/payments/payment_request.mojom.h" -#include "components/payments/payment_request_delegate.h" +#include "base/macros.h" +#include "components/payments/content/payment_request.mojom.h" +#include "components/payments/content/payment_request_delegate.h" #include "mojo/public/cpp/bindings/binding.h" namespace autofill { class AutofillProfile; class CreditCard; +class PersonalDataManager; } namespace content { @@ -26,6 +26,7 @@ namespace payments { +class CurrencyFormatter; class PaymentRequestWebContentsManager; class PaymentRequest : payments::mojom::PaymentRequest { @@ -155,4 +156,4 @@ } // namespace payments -#endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_H_ +#endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_H_
diff --git a/components/payments/payment_request.mojom b/components/payments/content/payment_request.mojom similarity index 100% rename from components/payments/payment_request.mojom rename to components/payments/content/payment_request.mojom
diff --git a/components/payments/payment_request_delegate.h b/components/payments/content/payment_request_delegate.h similarity index 80% rename from components/payments/payment_request_delegate.h rename to components/payments/content/payment_request_delegate.h index 65e56af..f797530c 100644 --- a/components/payments/payment_request_delegate.h +++ b/components/payments/content/payment_request_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_PAYMENTS_PAYMENT_REQUEST_DELEGATE_H_ -#define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_DELEGATE_H_ +#ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ +#define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ namespace autofill { class PersonalDataManager; @@ -31,4 +31,4 @@ } // namespace payments -#endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_DELEGATE_H_ +#endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_
diff --git a/components/payments/payment_request_dialog.h b/components/payments/content/payment_request_dialog.h similarity index 69% rename from components/payments/payment_request_dialog.h rename to components/payments/content/payment_request_dialog.h index 3141b1dd..5befff8 100644 --- a/components/payments/payment_request_dialog.h +++ b/components/payments/content/payment_request_dialog.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_PAYMENTS_PAYMENT_REQUEST_DIALOG_H_ -#define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_DIALOG_H_ +#ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DIALOG_H_ +#define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DIALOG_H_ namespace payments { @@ -19,4 +19,4 @@ } // namespace payments -#endif // COMPONENTS_PAYMENTS_PAYMENT_REQUEST_DIALOG_H_ +#endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DIALOG_H_
diff --git a/components/payments/payment_request_web_contents_manager.cc b/components/payments/content/payment_request_web_contents_manager.cc similarity index 80% rename from components/payments/payment_request_web_contents_manager.cc rename to components/payments/content/payment_request_web_contents_manager.cc index ca89372..db68134 100644 --- a/components/payments/payment_request_web_contents_manager.cc +++ b/components/payments/content/payment_request_web_contents_manager.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 "components/payments/payment_request_web_contents_manager.h" +#include "components/payments/content/payment_request_web_contents_manager.h" -#include <memory> #include <utility> #include "base/logging.h" -#include "components/payments/payment_request_delegate.h" +#include "base/memory/ptr_util.h" +#include "components/payments/content/payment_request.h" +#include "components/payments/content/payment_request_delegate.h" +#include "content/public/browser/web_contents.h" DEFINE_WEB_CONTENTS_USER_DATA_KEY(payments::PaymentRequestWebContentsManager); @@ -29,8 +31,8 @@ content::WebContents* web_contents, std::unique_ptr<PaymentRequestDelegate> delegate, mojo::InterfaceRequest<payments::mojom::PaymentRequest> request) { - std::unique_ptr<PaymentRequest> new_request(new PaymentRequest( - web_contents, std::move(delegate), this, std::move(request))); + auto new_request = base::MakeUnique<PaymentRequest>( + web_contents, std::move(delegate), this, std::move(request)); PaymentRequest* request_ptr = new_request.get(); payment_requests_.insert(std::make_pair(request_ptr, std::move(new_request))); }
diff --git a/components/payments/payment_request_web_contents_manager.h b/components/payments/content/payment_request_web_contents_manager.h similarity index 91% rename from components/payments/payment_request_web_contents_manager.h rename to components/payments/content/payment_request_web_contents_manager.h index 42e26f4..5232314 100644 --- a/components/payments/payment_request_web_contents_manager.h +++ b/components/payments/content/payment_request_web_contents_manager.h
@@ -5,15 +5,21 @@ #ifndef COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_ #define COMPONENTS_PAYMENTS_PAYMENT_REQUEST_WEB_CONTENTS_MANAGER_H_ +#include <memory> #include <unordered_map> -#include "components/payments/payment_request.h" -#include "components/payments/payment_request.mojom.h" +#include "base/macros.h" +#include "components/payments/content/payment_request.mojom.h" #include "content/public/browser/web_contents_user_data.h" #include "mojo/public/cpp/bindings/binding.h" +namespace content { +class WebContents; +} + namespace payments { +class PaymentRequest; class PaymentRequestDelegate; // This class owns the PaymentRequest associated with a given WebContents. @@ -54,6 +60,8 @@ // the requests themselves call DestroyRequest(). std::unordered_map<PaymentRequest*, std::unique_ptr<PaymentRequest>> payment_requests_; + + DISALLOW_COPY_AND_ASSIGN(PaymentRequestWebContentsManager); }; } // namespace payments
diff --git a/components/payments/content/payments_validators.cc b/components/payments/content/payments_validators.cc new file mode 100644 index 0000000..ed2b448c2 --- /dev/null +++ b/components/payments/content/payments_validators.cc
@@ -0,0 +1,140 @@ +// 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/payments/content/payments_validators.h" + +#include "third_party/re2/src/re2/re2.h" +#include "url/gurl.h" + +namespace payments { + +// We limit the maximum length of string to 2048 bytes for security reasons. +static const int maximumStringLength = 2048; + +bool PaymentsValidators::isValidCurrencyCodeFormat( + const std::string& code, + const std::string& system, + std::string* optional_error_message) { + if (system == "urn:iso:std:iso:4217") { + if (RE2::FullMatch(code, "[A-Z]{3}")) + return true; + + if (optional_error_message) + *optional_error_message = + "'" + code + + "' is not a valid ISO 4217 currency code, should " + "be 3 upper case letters [A-Z]"; + + return false; + } + + if (code.size() > maximumStringLength) { + if (optional_error_message) + *optional_error_message = + "The currency code should be at most 2048 characters long"; + return false; + } + if (!GURL(system).is_valid()) { + if (optional_error_message) + *optional_error_message = "The system should be a valid URL"; + return false; + } + return true; +} + +bool PaymentsValidators::isValidAmountFormat( + const std::string& amount, + std::string* optional_error_message) { + if (RE2::FullMatch(amount, "-?[0-9]+(\\.[0-9]+)?")) + return true; + + if (optional_error_message) + *optional_error_message = "'" + amount + "' is not a valid amount format"; + + return false; +} + +bool PaymentsValidators::isValidCountryCodeFormat( + const std::string& code, + std::string* optional_error_message) { + if (RE2::FullMatch(code, "[A-Z]{2}")) + return true; + + if (optional_error_message) + *optional_error_message = "'" + code + + "' is not a valid CLDR country code, should be 2 " + "upper case letters [A-Z]"; + + return false; +} + +bool PaymentsValidators::isValidLanguageCodeFormat( + const std::string& code, + std::string* optional_error_message) { + if (RE2::FullMatch(code, "([a-z]{2,3})?")) + return true; + + if (optional_error_message) + *optional_error_message = + "'" + code + + "' is not a valid BCP-47 language code, should be " + "2-3 lower case letters [a-z]"; + + return false; +} + +bool PaymentsValidators::isValidScriptCodeFormat( + const std::string& code, + std::string* optional_error_message) { + if (RE2::FullMatch(code, "([A-Z][a-z]{3})?")) + return true; + + if (optional_error_message) + *optional_error_message = + "'" + code + + "' is not a valid ISO 15924 script code, should be " + "an upper case letter [A-Z] followed by 3 lower " + "case letters [a-z]"; + + return false; +} + +bool PaymentsValidators::isValidShippingAddress( + const mojom::PaymentAddressPtr& address, + std::string* optional_error_message) { + if (!isValidCountryCodeFormat(address->country, optional_error_message)) + return false; + + if (!isValidLanguageCodeFormat(address->language_code, + optional_error_message)) + return false; + + if (!isValidScriptCodeFormat(address->script_code, optional_error_message)) + return false; + + if (address->language_code.empty() && !address->script_code.empty()) { + if (optional_error_message) + *optional_error_message = + "If language code is empty, then script code should also be empty"; + + return false; + } + + return true; +} + +bool PaymentsValidators::isValidErrorMsgFormat( + const std::string& error, + std::string* optional_error_message) { + if (error.length() <= maximumStringLength) + return true; + + if (optional_error_message) + *optional_error_message = + "Error message should be at most 2048 characters long"; + + return false; +} + +} // namespace payments
diff --git a/components/payments/payments_validators.h b/components/payments/content/payments_validators.h similarity index 68% rename from components/payments/payments_validators.h rename to components/payments/content/payments_validators.h index 133eecb7..135074cc 100644 --- a/components/payments/payments_validators.h +++ b/components/payments/content/payments_validators.h
@@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_PAYMENTS_PAYMENTS_VALIDATORS_H_ -#define COMPONENTS_PAYMENTS_PAYMENTS_VALIDATORS_H_ +#ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENTS_VALIDATORS_H_ +#define COMPONENTS_PAYMENTS_CONTENT_PAYMENTS_VALIDATORS_H_ #include <string> -#include "components/payments/payment_request.mojom.h" +#include "base/macros.h" +#include "components/payments/content/payment_request.mojom.h" namespace payments { @@ -22,38 +23,41 @@ // false if currency |code| is too long (greater than 2048). static bool isValidCurrencyCodeFormat(const std::string& code, const std::string& system, - std::string* optionalErrorMessage); + std::string* optional_error_message); // Returns true if |amount| is a valid currency code as defined in ISO 20022 // CurrencyAnd30Amount. static bool isValidAmountFormat(const std::string& amount, - std::string* optionalErrorMessage); + std::string* optional_error_message); // Returns true if |code| is a valid ISO 3166 country code. static bool isValidCountryCodeFormat(const std::string& code, - std::string* optionalErrorMessage); + std::string* optional_error_message); // Returns true if |code| is a valid ISO 639 language code. static bool isValidLanguageCodeFormat(const std::string& code, - std::string* optionalErrorMessage); + std::string* optional_error_message); // Returns true if |code| is a valid ISO 15924 script code. static bool isValidScriptCodeFormat(const std::string& code, - std::string* optionalErrorMessage); + std::string* optional_error_message); // Returns true if the payment address is valid: // - Has a valid region code // - Has a valid language code, if any. // - Has a valid script code, if any. // A script code should be present only if language code is present. - static bool isValidShippingAddress(const mojom::PaymentAddressPtr&, - std::string* optionalErrorMessage); + static bool isValidShippingAddress(const mojom::PaymentAddressPtr& address, + std::string* optional_error_message); // Returns false if |error| is too long (greater than 2048). static bool isValidErrorMsgFormat(const std::string& code, - std::string* optionalErrorMessage); + std::string* optional_error_message); + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(PaymentsValidators); }; } // namespace payments -#endif // COMPONENTS_PAYMENTS_PAYMENTS_VALIDATORS_H_ +#endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENTS_VALIDATORS_H_
diff --git a/components/payments/payments_validators_test.cc b/components/payments/content/payments_validators_test.cc similarity index 99% rename from components/payments/payments_validators_test.cc rename to components/payments/content/payments_validators_test.cc index 16fedd0..8214ce14 100644 --- a/components/payments/payments_validators_test.cc +++ b/components/payments/content/payments_validators_test.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 "components/payments/payments_validators.h" +#include "components/payments/content/payments_validators.h" -#include "testing/gtest/include/gtest/gtest.h" #include <ostream> // NOLINT +#include "testing/gtest/include/gtest/gtest.h" namespace payments { namespace {
diff --git a/components/payments/core/BUILD.gn b/components/payments/core/BUILD.gn new file mode 100644 index 0000000..e0a51dfc1 --- /dev/null +++ b/components/payments/core/BUILD.gn
@@ -0,0 +1,39 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +static_library("core") { + sources = [ + "address_normalizer.cc", + "address_normalizer.h", + "currency_formatter.cc", + "currency_formatter.h", + ] + + deps = [ + "//base", + "//components/autofill/core/browser", + ] + + public_deps = [ + "//third_party/icu", + "//third_party/libaddressinput", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "address_normalizer_unittest.cc", + "currency_formatter_unittest.cc", + ] + + deps = [ + ":core", + "//base", + "//base/test:test_support", + "//components/autofill/core/browser", + "//testing/gtest", + "//third_party/libaddressinput:test_support", + ] +}
diff --git a/components/payments/core/DEPS b/components/payments/core/DEPS new file mode 100644 index 0000000..7798128 --- /dev/null +++ b/components/payments/core/DEPS
@@ -0,0 +1,5 @@ +include_rules = [ + "-content", + "+components/autofill/core", + "+third_party/libaddressinput", +]
diff --git a/components/payments/address_normalizer.cc b/components/payments/core/address_normalizer.cc similarity index 94% rename from components/payments/address_normalizer.cc rename to components/payments/core/address_normalizer.cc index 48866dd..3114c5a 100644 --- a/components/payments/address_normalizer.cc +++ b/components/payments/core/address_normalizer.cc
@@ -2,29 +2,33 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/payments/address_normalizer.h" +#include "components/payments/core/address_normalizer.h" -#include <memory> +#include <stddef.h> #include <utility> +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/cancelable_callback.h" +#include "base/location.h" +#include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/sequenced_task_runner_handle.h" +#include "base/time/time.h" #include "components/autofill/core/browser/address_i18n.h" +#include "components/autofill/core/browser/autofill_profile.h" #include "third_party/libaddressinput/chromium/chrome_address_validator.h" #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_data.h" #include "third_party/libaddressinput/src/cpp/include/libaddressinput/source.h" #include "third_party/libaddressinput/src/cpp/include/libaddressinput/storage.h" +namespace payments { namespace { + +using ::autofill::AutofillProfile; using ::i18n::addressinput::Source; using ::i18n::addressinput::Storage; -} // namespace - -namespace payments { - -namespace { class AddressNormalizationRequest : public AddressNormalizer::Request { public:
diff --git a/components/payments/address_normalizer.h b/components/payments/core/address_normalizer.h similarity index 88% rename from components/payments/address_normalizer.h rename to components/payments/core/address_normalizer.h index 34cac3c..0280d82 100644 --- a/components/payments/address_normalizer.h +++ b/components/payments/core/address_normalizer.h
@@ -2,14 +2,27 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_PAYMENTS_ADDRESS_NORMALIZER_H_ -#define COMPONENTS_PAYMENTS_ADDRESS_NORMALIZER_H_ +#ifndef COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_H_ +#define COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_H_ + +#include <map> +#include <memory> +#include <string> +#include <vector> #include "base/macros.h" -#include "components/autofill/core/browser/autofill_profile.h" #include "third_party/libaddressinput/chromium/chrome_address_validator.h" -using autofill::AutofillProfile; +namespace autofill { +class AutofillProfile; +} + +namespace i18n { +namespace libadderssinput { +class Source; +class Storage; +} +} namespace payments { @@ -78,4 +91,4 @@ } // namespace payments -#endif // COMPONENTS_PAYMENTS_ADDRESS_NORMALIZER_H_ +#endif // COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_H_
diff --git a/components/payments/address_normalizer_unittest.cc b/components/payments/core/address_normalizer_unittest.cc similarity index 95% rename from components/payments/address_normalizer_unittest.cc rename to components/payments/core/address_normalizer_unittest.cc index 58c268b4..0d2f3fa 100644 --- a/components/payments/address_normalizer_unittest.cc +++ b/components/payments/core/address_normalizer_unittest.cc
@@ -2,9 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/payments/address_normalizer.h" +#include "components/payments/core/address_normalizer.h" -#include "base/macros.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_task_scheduler.h" @@ -18,6 +17,7 @@ namespace payments { namespace { +using ::autofill::AutofillProfile; using ::i18n::addressinput::NullStorage; using ::i18n::addressinput::Source; using ::i18n::addressinput::Storage; @@ -47,6 +47,8 @@ private: bool normalized_called_; bool not_normalized_called_; + + DISALLOW_COPY_AND_ASSIGN(NormalizationDelegate); }; // Used to load region rules for this test. @@ -64,6 +66,9 @@ "{\"id\":\"data/US\",\"key\":\"US\",\"name\":\"UNITED " "STATES\",\"lang\":\"en\",\"languages\":\"en\"}}")); } + + private: + DISALLOW_COPY_AND_ASSIGN(ChromiumTestdataSource); }; // A test subclass of the AddressNormalizer. Used to simulate rules not being @@ -89,6 +94,8 @@ private: bool should_load_rules_; + + DISALLOW_COPY_AND_ASSIGN(TestAddressNormalizer); }; } // namespace
diff --git a/components/payments/currency_formatter.cc b/components/payments/core/currency_formatter.cc similarity index 97% rename from components/payments/currency_formatter.cc rename to components/payments/core/currency_formatter.cc index 1dc2c10..4eb4f74e 100644 --- a/components/payments/currency_formatter.cc +++ b/components/payments/core/currency_formatter.cc
@@ -2,16 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/payments/currency_formatter.h" +#include "components/payments/core/currency_formatter.h" -#include <memory> - +#include "base/logging.h" #include "base/numerics/safe_conversions.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "third_party/icu/source/common/unicode/stringpiece.h" #include "third_party/icu/source/common/unicode/uchar.h" -#include "third_party/icu/source/common/unicode/unistr.h" #include "third_party/icu/source/common/unicode/utypes.h" namespace payments {
diff --git a/components/payments/currency_formatter.h b/components/payments/core/currency_formatter.h similarity index 86% rename from components/payments/currency_formatter.h rename to components/payments/core/currency_formatter.h index 1995476..eec9d66 100644 --- a/components/payments/currency_formatter.h +++ b/components/payments/core/currency_formatter.h
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_PAYMENTS_CURRENCY_FORMATTER_H_ -#define COMPONENTS_PAYMENTS_CURRENCY_FORMATTER_H_ +#ifndef COMPONENTS_PAYMENTS_CORE_CURRENCY_FORMATTER_H_ +#define COMPONENTS_PAYMENTS_CORE_CURRENCY_FORMATTER_H_ #include <memory> #include <string> #include "base/macros.h" -#include "base/optional.h" #include "base/strings/string16.h" #include "third_party/icu/source/common/unicode/locid.h" +#include "third_party/icu/source/common/unicode/unistr.h" #include "third_party/icu/source/i18n/unicode/numfmt.h" namespace payments { @@ -43,7 +43,9 @@ // Returns the formatted currency code (<= 6 characters including ellipsis if // applicable). - std::string formatted_currency_code() { return formatted_currency_code_; } + const std::string& formatted_currency_code() const { + return formatted_currency_code_; + } private: const icu::Locale locale_; @@ -56,4 +58,4 @@ } // namespace payments -#endif // COMPONENTS_PAYMENTS_CURRENCY_FORMATTER_H_ +#endif // COMPONENTS_PAYMENTS_CORE_CURRENCY_FORMATTER_H_
diff --git a/components/payments/currency_formatter_unittest.cc b/components/payments/core/currency_formatter_unittest.cc similarity index 98% rename from components/payments/currency_formatter_unittest.cc rename to components/payments/core/currency_formatter_unittest.cc index 35788e7..e55a2fe 100644 --- a/components/payments/currency_formatter_unittest.cc +++ b/components/payments/core/currency_formatter_unittest.cc
@@ -2,10 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/payments/currency_formatter.h" +#include "components/payments/core/currency_formatter.h" -#include "base/optional.h" -#include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/payments/payment_details_validation.h b/components/payments/payment_details_validation.h deleted file mode 100644 index 804602c0..0000000 --- a/components/payments/payment_details_validation.h +++ /dev/null
@@ -1,19 +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 COMPONENTS_PAYMENTS_PAYMENT_DETAILS_VALIDATION_H_ -#define COMPONENTS_PAYMENTS_PAYMENT_DETAILS_VALIDATION_H_ - -#include <string> - -#include "components/payments/payment_request.mojom.h" - -namespace payments { - -bool validatePaymentDetails(const mojom::PaymentDetailsPtr& details, - std::string* error_message); - -} // namespace payments - -#endif // COMPONENTS_PAYMENTS_PAYMENT_DETAILS_VALIDATION_H_
diff --git a/components/payments/payments_validators.cc b/components/payments/payments_validators.cc deleted file mode 100644 index 1d83c23..0000000 --- a/components/payments/payments_validators.cc +++ /dev/null
@@ -1,137 +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 "components/payments/payments_validators.h" - -#include "third_party/re2/src/re2/re2.h" -#include "url/gurl.h" - -namespace payments { - -// We limit the maximum length of string to 2048 bytes for security reasons. -static const int maximumStringLength = 2048; - -bool PaymentsValidators::isValidCurrencyCodeFormat( - const std::string& code, - const std::string& system, - std::string* optionalErrorMessage) { - if (system == "urn:iso:std:iso:4217") { - if (RE2::FullMatch(code, "[A-Z]{3}")) - return true; - - if (optionalErrorMessage) - *optionalErrorMessage = "'" + code + - "' is not a valid ISO 4217 currency code, should " - "be 3 upper case letters [A-Z]"; - - return false; - } - - if (code.size() > maximumStringLength) { - if (optionalErrorMessage) - *optionalErrorMessage = - "The currency code should be at most 2048 characters long"; - return false; - } - if (!GURL(system).is_valid()) { - if (optionalErrorMessage) - *optionalErrorMessage = - "The system should be a valid URL"; - return false; - } - return true; -} - -bool PaymentsValidators::isValidAmountFormat( - const std::string& amount, - std::string* optionalErrorMessage) { - if (RE2::FullMatch(amount, "-?[0-9]+(\\.[0-9]+)?")) - return true; - - if (optionalErrorMessage) - *optionalErrorMessage = "'" + amount + "' is not a valid amount format"; - - return false; -} - -bool PaymentsValidators::isValidCountryCodeFormat( - const std::string& code, - std::string* optionalErrorMessage) { - if (RE2::FullMatch(code, "[A-Z]{2}")) - return true; - - if (optionalErrorMessage) - *optionalErrorMessage = "'" + code + - "' is not a valid CLDR country code, should be 2 " - "upper case letters [A-Z]"; - - return false; -} - -bool PaymentsValidators::isValidLanguageCodeFormat( - const std::string& code, - std::string* optionalErrorMessage) { - if (RE2::FullMatch(code, "([a-z]{2,3})?")) - return true; - - if (optionalErrorMessage) - *optionalErrorMessage = "'" + code + - "' is not a valid BCP-47 language code, should be " - "2-3 lower case letters [a-z]"; - - return false; -} - -bool PaymentsValidators::isValidScriptCodeFormat( - const std::string& code, - std::string* optionalErrorMessage) { - if (RE2::FullMatch(code, "([A-Z][a-z]{3})?")) - return true; - - if (optionalErrorMessage) - *optionalErrorMessage = "'" + code + - "' is not a valid ISO 15924 script code, should be " - "an upper case letter [A-Z] followed by 3 lower " - "case letters [a-z]"; - - return false; -} - -bool PaymentsValidators::isValidShippingAddress( - const mojom::PaymentAddressPtr& address, - std::string* optionalErrorMessage) { - if (!isValidCountryCodeFormat(address->country, optionalErrorMessage)) - return false; - - if (!isValidLanguageCodeFormat(address->language_code, optionalErrorMessage)) - return false; - - if (!isValidScriptCodeFormat(address->script_code, optionalErrorMessage)) - return false; - - if (address->language_code.empty() && !address->script_code.empty()) { - if (optionalErrorMessage) - *optionalErrorMessage = - "If language code is empty, then script code should also be empty"; - - return false; - } - - return true; -} - -bool PaymentsValidators::isValidErrorMsgFormat( - const std::string& error, - std::string* optionalErrorMessage) { - if (error.length() <= maximumStringLength) - return true; - - if (optionalErrorMessage) - *optionalErrorMessage = - "Error message should be at most 2048 characters long"; - - return false; -} - -} // namespace payments
diff --git a/components/rlz/OWNERS b/components/rlz/OWNERS index d1986d9..bee2d9df 100644 --- a/components/rlz/OWNERS +++ b/components/rlz/OWNERS
@@ -2,3 +2,4 @@ gwilson@chromium.org rogerta@chromium.org +# COMPONENT: Internals>Core
diff --git a/components/safe_browsing/BUILD.gn b/components/safe_browsing/BUILD.gn index f8d0549..ca81666 100644 --- a/components/safe_browsing/BUILD.gn +++ b/components/safe_browsing/BUILD.gn
@@ -13,6 +13,7 @@ ] deps = [ + ":base_ping_manager", "//base:base", "//base:i18n", "//components/safe_browsing_db:database_manager", @@ -25,3 +26,38 @@ "//net:net", ] } + +static_library("base_ping_manager") { + sources = [ + "base_ping_manager.cc", + "base_ping_manager.h", + ] + + public_deps = [ + "//google_apis:google_apis", + ] + + deps = [ + "//base:base", + "//components/data_use_measurement/core:core", + "//components/safe_browsing_db:hit_report", + "//components/safe_browsing_db:util", + "//content/public/browser:browser", + "//net:net", + ] +} + +source_set("base_ping_manager_unittest") { + testonly = true + sources = [ + "base_ping_manager_unittest.cc", + ] + + deps = [ + ":base_ping_manager", + "//base:base", + "//net:net", + "//net:test_support", + "//testing/gtest", + ] +}
diff --git a/components/safe_browsing/DEPS b/components/safe_browsing/DEPS index 7576045..ac3d8bb 100644 --- a/components/safe_browsing/DEPS +++ b/components/safe_browsing/DEPS
@@ -1,11 +1,14 @@ include_rules = [ + "+components/data_use_measurement/core", "+components/safe_browsing_db", "+components/security_interstitials/content", "+components/security_interstitials/core", "+components/subresource_filter/content/browser", "+content/public/browser", "+content/public/common", + "+google_apis", "+net/base", "+net/log", "+net/url_request", + "+testing/gtest", ]
diff --git a/components/safe_browsing/base_ping_manager.cc b/components/safe_browsing/base_ping_manager.cc new file mode 100644 index 0000000..ed54971a --- /dev/null +++ b/components/safe_browsing/base_ping_manager.cc
@@ -0,0 +1,254 @@ +// Copyright (c) 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/safe_browsing/base_ping_manager.h" + +#include <utility> + +#include "base/base64.h" +#include "base/logging.h" +#include "base/memory/ptr_util.h" +#include "base/strings/string_util.h" +#include "base/strings/stringprintf.h" +#include "base/values.h" +#include "components/data_use_measurement/core/data_use_user_data.h" +#include "content/public/browser/browser_thread.h" +#include "google_apis/google_api_keys.h" +#include "net/base/escape.h" +#include "net/base/load_flags.h" +#include "net/log/net_log_source_type.h" +#include "net/url_request/url_fetcher.h" +#include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" +#include "net/url_request/url_request_status.h" +#include "url/gurl.h" + +using content::BrowserThread; + +namespace { +// Returns a dictionary with "url"=|url-spec| and "data"=|payload| for +// netlogging the start phase of a ping. +std::unique_ptr<base::Value> NetLogPingStartCallback( + const net::NetLogWithSource& net_log, + const GURL& url, + const std::string& payload, + net::NetLogCaptureMode) { + std::unique_ptr<base::DictionaryValue> event_params( + new base::DictionaryValue()); + event_params->SetString("url", url.spec()); + event_params->SetString("payload", payload); + net_log.source().AddToEventParameters(event_params.get()); + return std::move(event_params); +} + +// Returns a dictionary with "url"=|url-spec|, "status"=|status| and +// "error"=|error| for netlogging the end phase of a ping. +std::unique_ptr<base::Value> NetLogPingEndCallback( + const net::NetLogWithSource& net_log, + const net::URLRequestStatus& status, + net::NetLogCaptureMode) { + std::unique_ptr<base::DictionaryValue> event_params( + new base::DictionaryValue()); + event_params->SetInteger("status", status.status()); + event_params->SetInteger("error", status.error()); + net_log.source().AddToEventParameters(event_params.get()); + return std::move(event_params); +} + +} // namespace + +namespace safe_browsing { + +// SafeBrowsingPingManager implementation ---------------------------------- + +// static +std::unique_ptr<BasePingManager> BasePingManager::Create( + net::URLRequestContextGetter* request_context_getter, + const SafeBrowsingProtocolConfig& config) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + return base::WrapUnique(new BasePingManager(request_context_getter, config)); +} + +BasePingManager::BasePingManager( + net::URLRequestContextGetter* request_context_getter, + const SafeBrowsingProtocolConfig& config) + : client_name_(config.client_name), + request_context_getter_(request_context_getter), + url_prefix_(config.url_prefix) { + DCHECK(!url_prefix_.empty()); + + if (request_context_getter) { + net_log_ = net::NetLogWithSource::Make( + request_context_getter->GetURLRequestContext()->net_log(), + net::NetLogSourceType::SAFE_BROWSING); + } + + version_ = ProtocolManagerHelper::Version(); +} + +BasePingManager::~BasePingManager() {} + +// net::URLFetcherDelegate implementation ---------------------------------- + +// All SafeBrowsing request responses are handled here. +void BasePingManager::OnURLFetchComplete(const net::URLFetcher* source) { + net_log_.EndEvent( + net::NetLogEventType::SAFE_BROWSING_PING, + base::Bind(&NetLogPingEndCallback, net_log_, source->GetStatus())); + auto it = + std::find_if(safebrowsing_reports_.begin(), safebrowsing_reports_.end(), + [source](const std::unique_ptr<net::URLFetcher>& ptr) { + return ptr.get() == source; + }); + DCHECK(it != safebrowsing_reports_.end()); + safebrowsing_reports_.erase(it); +} + +// Sends a SafeBrowsing "hit" report. +void BasePingManager::ReportSafeBrowsingHit( + const safe_browsing::HitReport& hit_report) { + GURL report_url = SafeBrowsingHitUrl(hit_report); + std::unique_ptr<net::URLFetcher> report_ptr = net::URLFetcher::Create( + report_url, + hit_report.post_data.empty() ? net::URLFetcher::GET + : net::URLFetcher::POST, + this); + net::URLFetcher* report = report_ptr.get(); + data_use_measurement::DataUseUserData::AttachToFetcher( + report, data_use_measurement::DataUseUserData::SAFE_BROWSING); + report_ptr->SetLoadFlags(net::LOAD_DISABLE_CACHE); + report_ptr->SetRequestContext(request_context_getter_.get()); + std::string post_data_base64; + if (!hit_report.post_data.empty()) { + report_ptr->SetUploadData("text/plain", hit_report.post_data); + base::Base64Encode(hit_report.post_data, &post_data_base64); + } + + net_log_.BeginEvent( + net::NetLogEventType::SAFE_BROWSING_PING, + base::Bind(&NetLogPingStartCallback, net_log_, + report_ptr->GetOriginalURL(), post_data_base64)); + + report->Start(); + safebrowsing_reports_.insert(std::move(report_ptr)); +} + +// Sends threat details for users who opt-in. +void BasePingManager::ReportThreatDetails(const std::string& report) { + GURL report_url = ThreatDetailsUrl(); + std::unique_ptr<net::URLFetcher> fetcher = + net::URLFetcher::Create(report_url, net::URLFetcher::POST, this); + data_use_measurement::DataUseUserData::AttachToFetcher( + fetcher.get(), data_use_measurement::DataUseUserData::SAFE_BROWSING); + fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE); + fetcher->SetRequestContext(request_context_getter_.get()); + fetcher->SetUploadData("application/octet-stream", report); + // Don't try too hard to send reports on failures. + fetcher->SetAutomaticallyRetryOn5xx(false); + + std::string report_base64; + base::Base64Encode(report, &report_base64); + net_log_.BeginEvent(net::NetLogEventType::SAFE_BROWSING_PING, + base::Bind(&NetLogPingStartCallback, net_log_, + fetcher->GetOriginalURL(), report_base64)); + + fetcher->Start(); + safebrowsing_reports_.insert(std::move(fetcher)); +} + +GURL BasePingManager::SafeBrowsingHitUrl( + const safe_browsing::HitReport& hit_report) const { + DCHECK(hit_report.threat_type == SB_THREAT_TYPE_URL_MALWARE || + hit_report.threat_type == SB_THREAT_TYPE_URL_PHISHING || + hit_report.threat_type == SB_THREAT_TYPE_URL_UNWANTED || + hit_report.threat_type == SB_THREAT_TYPE_BINARY_MALWARE_URL || + hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL || + hit_report.threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL); + std::string url = ProtocolManagerHelper::ComposeUrl( + url_prefix_, "report", client_name_, version_, std::string(), + hit_report.extended_reporting_level); + + std::string threat_list = "none"; + switch (hit_report.threat_type) { + case SB_THREAT_TYPE_URL_MALWARE: + threat_list = "malblhit"; + break; + case SB_THREAT_TYPE_URL_PHISHING: + threat_list = "phishblhit"; + break; + case SB_THREAT_TYPE_URL_UNWANTED: + threat_list = "uwsblhit"; + break; + case SB_THREAT_TYPE_BINARY_MALWARE_URL: + threat_list = "binurlhit"; + break; + case SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL: + threat_list = "phishcsdhit"; + break; + case SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL: + threat_list = "malcsdhit"; + break; + default: + NOTREACHED(); + } + + std::string threat_source = "none"; + switch (hit_report.threat_source) { + case safe_browsing::ThreatSource::DATA_SAVER: + threat_source = "ds"; + break; + case safe_browsing::ThreatSource::REMOTE: + threat_source = "rem"; + break; + case safe_browsing::ThreatSource::LOCAL_PVER3: + threat_source = "l3"; + break; + case safe_browsing::ThreatSource::LOCAL_PVER4: + threat_source = "l4"; + break; + case safe_browsing::ThreatSource::CLIENT_SIDE_DETECTION: + threat_source = "csd"; + break; + case safe_browsing::ThreatSource::UNKNOWN: + NOTREACHED(); + } + + // Add user_population component only if it's not empty. + std::string user_population_comp; + if (!hit_report.population_id.empty()) { + // Population_id should be URL-safe, but escape it and size-limit it + // anyway since it came from outside Chrome. + std::string up_str = + net::EscapeQueryParamValue(hit_report.population_id, true); + if (up_str.size() > 512) { + DCHECK(false) << "population_id is too long: " << up_str; + up_str = "UP_STRING_TOO_LONG"; + } + + user_population_comp = "&up=" + up_str; + } + + return GURL(base::StringPrintf( + "%s&evts=%s&evtd=%s&evtr=%s&evhr=%s&evtb=%d&src=%s&m=%d%s", url.c_str(), + threat_list.c_str(), + net::EscapeQueryParamValue(hit_report.malicious_url.spec(), true).c_str(), + net::EscapeQueryParamValue(hit_report.page_url.spec(), true).c_str(), + net::EscapeQueryParamValue(hit_report.referrer_url.spec(), true).c_str(), + hit_report.is_subresource, threat_source.c_str(), + hit_report.is_metrics_reporting_active, user_population_comp.c_str())); +} + +GURL BasePingManager::ThreatDetailsUrl() const { + std::string url = base::StringPrintf( + "%s/clientreport/malware?client=%s&appver=%s&pver=1.0", + url_prefix_.c_str(), client_name_.c_str(), version_.c_str()); + std::string api_key = google_apis::GetAPIKey(); + if (!api_key.empty()) { + base::StringAppendF(&url, "&key=%s", + net::EscapeQueryParamValue(api_key, true).c_str()); + } + return GURL(url); +} + +} // namespace safe_browsing
diff --git a/components/safe_browsing/base_ping_manager.h b/components/safe_browsing/base_ping_manager.h new file mode 100644 index 0000000..562ab710 --- /dev/null +++ b/components/safe_browsing/base_ping_manager.h
@@ -0,0 +1,97 @@ +// Copyright (c) 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_SAFE_BROWSING_BASE_PING_MANAGER_H_ +#define COMPONENTS_SAFE_BROWSING_BASE_PING_MANAGER_H_ + +// A class that reports basic safebrowsing statistics to Google's SafeBrowsing +// servers. +#include <memory> +#include <set> +#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" +#include "content/public/browser/permission_type.h" +#include "net/log/net_log_with_source.h" +#include "net/url_request/url_fetcher_delegate.h" +#include "url/gurl.h" + +namespace net { +class URLRequestContextGetter; +} // namespace net + +namespace safe_browsing { + +class BasePingManager : public net::URLFetcherDelegate { + public: + ~BasePingManager() override; + + // Create an instance of the safe browsing ping manager. + static std::unique_ptr<BasePingManager> Create( + net::URLRequestContextGetter* request_context_getter, + const SafeBrowsingProtocolConfig& config); + + // net::URLFetcherDelegate interface. + void OnURLFetchComplete(const net::URLFetcher* source) override; + + // Report to Google when a SafeBrowsing warning is shown to the user. + // |hit_report.threat_type| should be one of the types known by + // SafeBrowsingtHitUrl. + void ReportSafeBrowsingHit(const safe_browsing::HitReport& hit_report); + + // Users can opt-in on the SafeBrowsing interstitial to send detailed + // threat reports. |report| is the serialized report. + void ReportThreatDetails(const std::string& report); + + protected: + friend class BasePingManagerTest; + // Constructs a BasePingManager that issues network requests + // using |request_context_getter|. + BasePingManager(net::URLRequestContextGetter* request_context_getter, + const SafeBrowsingProtocolConfig& config); + + private: + FRIEND_TEST_ALL_PREFIXES(BasePingManagerTest, TestSafeBrowsingHitUrl); + FRIEND_TEST_ALL_PREFIXES(BasePingManagerTest, TestThreatDetailsUrl); + FRIEND_TEST_ALL_PREFIXES(BasePingManagerTest, TestReportThreatDetails); + FRIEND_TEST_ALL_PREFIXES(BasePingManagerTest, TestReportSafeBrowsingHit); + + typedef std::set<std::unique_ptr<net::URLFetcher>> Reports; + + // Generates URL for reporting safe browsing hits. + GURL SafeBrowsingHitUrl(const safe_browsing::HitReport& hit_report) const; + + // Generates URL for reporting threat details for users who opt-in. + GURL ThreatDetailsUrl() const; + + // Current product version sent in each request. + std::string version_; + + // The safe browsing client name sent in each request. + std::string client_name_; + + // The context we use to issue network requests. + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; + + // URL prefix where browser reports hits to the safebrowsing list and + // sends detaild threat reports for UMA users. + std::string url_prefix_; + + // Track outstanding SafeBrowsing report fetchers for clean up. + // We add both "hit" and "detail" fetchers in this set. + Reports safebrowsing_reports_; + + net::NetLogWithSource net_log_; + + DISALLOW_COPY_AND_ASSIGN(BasePingManager); +}; + +} // namespace safe_browsing + +#endif // COMPONENTS_SAFE_BROWSING_BASE_PING_MANAGER_H_
diff --git a/chrome/browser/safe_browsing/ping_manager_unittest.cc b/components/safe_browsing/base_ping_manager_unittest.cc similarity index 90% rename from chrome/browser/safe_browsing/ping_manager_unittest.cc rename to components/safe_browsing/base_ping_manager_unittest.cc index ecae781..467611af 100644 --- a/chrome/browser/safe_browsing/ping_manager_unittest.cc +++ b/components/safe_browsing/base_ping_manager_unittest.cc
@@ -1,15 +1,15 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // +#include "components/safe_browsing/base_ping_manager.h" #include "base/base64.h" #include "base/logging.h" #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" #include "base/values.h" -#include "chrome/browser/safe_browsing/ping_manager.h" #include "google_apis/google_api_keys.h" #include "net/base/escape.h" #include "net/log/net_log.h" @@ -31,10 +31,9 @@ namespace safe_browsing { -class SafeBrowsingPingManagerTest : public testing::Test { +class BasePingManagerTest : public testing::Test { public: - SafeBrowsingPingManagerTest() - : net_log_(new net::TestNetLog()) { + BasePingManagerTest() : net_log_(new net::TestNetLog()) { net_log_with_source_ = net::NetLogWithSource::Make( net_log_.get(), net::NetLogSourceType::SAFE_BROWSING); } @@ -44,30 +43,27 @@ std::string key = google_apis::GetAPIKey(); if (!key.empty()) { key_param_ = base::StringPrintf( - "&key=%s", - net::EscapeQueryParamValue(key, true).c_str()); + "&key=%s", net::EscapeQueryParamValue(key, true).c_str()); } SafeBrowsingProtocolConfig config; config.client_name = kClient; config.url_prefix = kUrlPrefix; - ping_manager_.reset(new SafeBrowsingPingManager(NULL, config)); + ping_manager_.reset(new BasePingManager(NULL, config)); ping_manager_->version_ = kAppVer; ping_manager_->net_log_ = net_log_with_source_; } - SafeBrowsingPingManager* ping_manager() { - return ping_manager_.get(); - } + BasePingManager* ping_manager() { return ping_manager_.get(); } std::string key_param_; std::unique_ptr<net::TestNetLog> net_log_; net::NetLogWithSource net_log_with_source_; net::TestURLFetcherFactory fetcher_factory_; - std::unique_ptr<SafeBrowsingPingManager> ping_manager_; + std::unique_ptr<BasePingManager> ping_manager_; }; -TEST_F(SafeBrowsingPingManagerTest, TestSafeBrowsingHitUrl) { +TEST_F(BasePingManagerTest, TestSafeBrowsingHitUrl) { HitReport base_hp; base_hp.malicious_url = GURL("http://malicious.url.com"); base_hp.page_url = GURL("http://page.url.com"); @@ -202,18 +198,20 @@ } } -TEST_F(SafeBrowsingPingManagerTest, TestThreatDetailsUrl) { - EXPECT_EQ("https://prefix.com/foo/clientreport/malware?" - "client=unittest&appver=1.0&pver=1.0" + key_param_, - ping_manager()->ThreatDetailsUrl().spec()); +TEST_F(BasePingManagerTest, TestThreatDetailsUrl) { + EXPECT_EQ( + "https://prefix.com/foo/clientreport/malware?" + "client=unittest&appver=1.0&pver=1.0" + + key_param_, + ping_manager()->ThreatDetailsUrl().spec()); } -TEST_F(SafeBrowsingPingManagerTest, TestReportThreatDetails) { +TEST_F(BasePingManagerTest, TestReportThreatDetails) { const std::string kThreatDetailsReportString = "Threat Details Report String"; std::string encoded_threat_report = ""; base::Base64Encode(kThreatDetailsReportString, &encoded_threat_report); - std::string expected_threat_details_url = ping_manager()->ThreatDetailsUrl() - .spec(); + std::string expected_threat_details_url = + ping_manager()->ThreatDetailsUrl().spec(); const int kRequestErrorCode = -123; // Start the report. @@ -263,7 +261,7 @@ EXPECT_TRUE(end_entry.params->HasKey("source_dependency")); } -TEST_F(SafeBrowsingPingManagerTest, TestReportSafeBrowsingHit) { +TEST_F(BasePingManagerTest, TestReportSafeBrowsingHit) { const std::string kHitReportPostData = "Hit Report POST Data"; std::string encoded_post_data = ""; base::Base64Encode(kHitReportPostData, &encoded_post_data); @@ -279,8 +277,8 @@ hp.is_subresource = true; hp.population_id = "foo bar"; hp.post_data = kHitReportPostData; - std::string expected_hit_report_url = ping_manager()->SafeBrowsingHitUrl(hp) - .spec(); + std::string expected_hit_report_url = + ping_manager()->SafeBrowsingHitUrl(hp).spec(); const int kRequestErrorCode = -321; // Start the report.
diff --git a/components/safe_browsing_db/BUILD.gn b/components/safe_browsing_db/BUILD.gn index 5d08673..68a841c 100644 --- a/components/safe_browsing_db/BUILD.gn +++ b/components/safe_browsing_db/BUILD.gn
@@ -181,11 +181,14 @@ "util.h", ] public_deps = [ + ":safe_browsing_prefs", ":v4_protocol_manager_util", ] deps = [ "//base", + "//components/version_info:version_info", "//crypto", + "//google_apis:google_apis", "//net", "//url", ]
diff --git a/components/safe_browsing_db/DEPS b/components/safe_browsing_db/DEPS index e6985f92..7fafc80 100644 --- a/components/safe_browsing_db/DEPS +++ b/components/safe_browsing_db/DEPS
@@ -2,10 +2,12 @@ "+components/data_use_measurement/core", "+components/prefs", "+components/variations", + "+components/version_info", "+content/public/browser", "+content/public/common", "+content/public/test", "+crypto", + "+google_apis/google_api_keys.h", "+jni", "+third_party/protobuf/src/google", "+net",
diff --git a/components/safe_browsing_db/util.cc b/components/safe_browsing_db/util.cc index 0f38dee..b59573c0 100644 --- a/components/safe_browsing_db/util.cc +++ b/components/safe_browsing_db/util.cc
@@ -6,9 +6,19 @@ #include <stddef.h> +#ifndef NDEBUG +#include "base/base64.h" +#endif +#include "base/environment.h" +#include "base/logging.h" #include "base/macros.h" +#include "base/stl_util.h" +#include "base/strings/string_util.h" +#include "base/strings/stringprintf.h" #include "base/trace_event/trace_event.h" +#include "components/version_info/version_info.h" #include "crypto/sha2.h" +#include "google_apis/google_api_keys.h" #include "net/base/escape.h" #include "url/gurl.h" @@ -204,4 +214,58 @@ } } +SafeBrowsingProtocolConfig::SafeBrowsingProtocolConfig() + : disable_auto_update(false) {} + +SafeBrowsingProtocolConfig::SafeBrowsingProtocolConfig( + const SafeBrowsingProtocolConfig& other) = default; + +SafeBrowsingProtocolConfig::~SafeBrowsingProtocolConfig() {} + +namespace ProtocolManagerHelper { + +std::string Version() { + if (version_info::GetVersionNumber().empty()) + return "0.1"; + else + return version_info::GetVersionNumber(); +} + +std::string ComposeUrl(const std::string& prefix, + const std::string& method, + const std::string& client_name, + const std::string& version, + const std::string& additional_query) { + DCHECK(!prefix.empty() && !method.empty() && !client_name.empty() && + !version.empty()); + std::string url = + base::StringPrintf("%s/%s?client=%s&appver=%s&pver=3.0", prefix.c_str(), + method.c_str(), client_name.c_str(), version.c_str()); + std::string api_key = google_apis::GetAPIKey(); + if (!api_key.empty()) { + base::StringAppendF(&url, "&key=%s", + net::EscapeQueryParamValue(api_key, true).c_str()); + } + if (!additional_query.empty()) { + DCHECK(url.find("?") != std::string::npos); + url.append("&"); + url.append(additional_query); + } + return url; +} + +std::string ComposeUrl(const std::string& prefix, + const std::string& method, + const std::string& client_name, + const std::string& version, + const std::string& additional_query, + ExtendedReportingLevel reporting_level) { + std::string url = + ComposeUrl(prefix, method, client_name, version, additional_query); + url.append(base::StringPrintf("&ext=%d", reporting_level)); + return url; +} + +} // namespace ProtocolManagerHelper + } // namespace safe_browsing
diff --git a/components/safe_browsing_db/util.h b/components/safe_browsing_db/util.h index 0d805a01..ad6f4e82 100644 --- a/components/safe_browsing_db/util.h +++ b/components/safe_browsing_db/util.h
@@ -16,6 +16,7 @@ #include "base/strings/string_piece.h" #include "base/time/time.h" +#include "components/safe_browsing_db/safe_browsing_prefs.h" #include "components/safe_browsing_db/v4_protocol_manager_util.h" class GURL; @@ -166,6 +167,45 @@ // other lists. We'll also always add a pattern for the empty path. void UrlToFullHashes(const GURL& url, bool include_whitelist_hashes, std::vector<SBFullHash>* full_hashes); + +struct SafeBrowsingProtocolConfig { + SafeBrowsingProtocolConfig(); + SafeBrowsingProtocolConfig(const SafeBrowsingProtocolConfig& other); + ~SafeBrowsingProtocolConfig(); + std::string client_name; + std::string url_prefix; + std::string backup_connect_error_url_prefix; + std::string backup_http_error_url_prefix; + std::string backup_network_error_url_prefix; + std::string version; + bool disable_auto_update; +}; + +namespace ProtocolManagerHelper { + +// returns chrome version. +std::string Version(); + +// Composes a URL using |prefix|, |method| (e.g.: gethash, download, report). +// |client_name| and |version|. When not empty, |additional_query| is +// appended to the URL with an additional "&" in the front. +std::string ComposeUrl(const std::string& prefix, + const std::string& method, + const std::string& client_name, + const std::string& version, + const std::string& additional_query); + +// Similar to above function, and appends "&ext=1" at the end of URL if +// |is_extended_reporting| is true, otherwise, appends "&ext=0". +std::string ComposeUrl(const std::string& prefix, + const std::string& method, + const std::string& client_name, + const std::string& version, + const std::string& additional_query, + ExtendedReportingLevel reporting_level); + +} // namespace ProtocolManagerHelper + } // namespace safe_browsing #endif // COMPONENTS_SAFE_BROWSING_DB_UTIL_H_
diff --git a/components/test/data/update_client/OWNERS b/components/test/data/update_client/OWNERS index e40d439..2780b5b1 100644 --- a/components/test/data/update_client/OWNERS +++ b/components/test/data/update_client/OWNERS
@@ -3,3 +3,5 @@ mal@chromium.org sorin@chromium.org waffles@chromium.org + +# COMPONENT: Internals>Installer>Components
diff --git a/components/update_client/OWNERS b/components/update_client/OWNERS index be72ff8..75e2f4d 100644 --- a/components/update_client/OWNERS +++ b/components/update_client/OWNERS
@@ -2,3 +2,5 @@ cpu@chromium.org sorin@chromium.org waffles@chromium.org + +# COMPONENT: Internals>Installer>Components
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 5b5af15..ef3ab69 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -43,7 +43,7 @@ "//components/leveldb:lib", "//components/link_header_util", "//components/mime_util", - "//components/payments:payment_app", + "//components/payments/content:payment_app", "//components/rappor", "//components/tracing", "//components/tracing:startup_tracing",
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc index 9195f118..ae93eee 100644 --- a/content/browser/frame_host/navigation_handle_impl.cc +++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -6,7 +6,6 @@ #include <iterator> -#include "base/debug/dump_without_crashing.h" #include "base/logging.h" #include "content/browser/appcache/appcache_navigation_handle.h" #include "content/browser/appcache/appcache_service_impl.h" @@ -808,9 +807,6 @@ if (!render_frame_host_->is_active()) { // This will cause the deletion of this NavigationHandle and the // cancellation of the navigation. - // TODO(clamy): Remove the logging code once we understand better how we can - // get there. - base::debug::DumpWithoutCrashing(); render_frame_host_->SetNavigationHandle(nullptr); return false; }
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 069f5b5..f541c6b 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1669,7 +1669,9 @@ JavaScriptDialogType dialog_type, IPC::Message* reply_msg) { if (!is_active()) { - JavaScriptDialogClosed(reply_msg, true, base::string16(), true); + JavaScriptDialogClosed(reply_msg, true, base::string16(), + /*is_before_unload_dialog=*/false, + /*dialog_was_suppressed=*/true); return; } @@ -2605,9 +2607,10 @@ IPC::Message* reply_msg, bool success, const base::string16& user_input, + bool is_before_unload_dialog, bool dialog_was_suppressed) { GetProcess()->SetIgnoreInputEvents(false); - bool is_waiting = is_waiting_for_beforeunload_ack_ || IsWaitingForUnloadACK(); + bool is_waiting = is_before_unload_dialog || IsWaitingForUnloadACK(); // If we are executing as part of (before)unload event handling, we don't // want to use the regular hung_renderer_delay_ms_ if the user has agreed to @@ -2617,7 +2620,7 @@ RendererUnresponsiveType type = RendererUnresponsiveType::RENDERER_UNRESPONSIVE_DIALOG_CLOSED; if (success) { - type = is_waiting_for_beforeunload_ack_ + type = is_before_unload_dialog ? RendererUnresponsiveType::RENDERER_UNRESPONSIVE_BEFORE_UNLOAD : RendererUnresponsiveType::RENDERER_UNRESPONSIVE_UNLOAD; }
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h index 103a23ed..d21b1da 100644 --- a/content/browser/frame_host/render_frame_host_impl.h +++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -466,6 +466,7 @@ void JavaScriptDialogClosed(IPC::Message* reply_msg, bool success, const base::string16& user_input, + bool is_before_unload_dialog, bool dialog_was_suppressed); // Get the accessibility mode from the delegate and Send a message to the
diff --git a/content/browser/payments/payment_app_browsertest.cc b/content/browser/payments/payment_app_browsertest.cc index 23ddafb..6810dd38 100644 --- a/content/browser/payments/payment_app_browsertest.cc +++ b/content/browser/payments/payment_app_browsertest.cc
@@ -5,7 +5,7 @@ #include "base/command_line.h" #include "base/macros.h" #include "base/run_loop.h" -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/public/browser/payment_app_provider.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_switches.h"
diff --git a/content/browser/payments/payment_app_content_unittest_base.h b/content/browser/payments/payment_app_content_unittest_base.h index bcb4e109..d7a5255 100644 --- a/content/browser/payments/payment_app_content_unittest_base.h +++ b/content/browser/payments/payment_app_content_unittest_base.h
@@ -11,7 +11,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/browser/payments/payment_app_manager.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h"
diff --git a/content/browser/payments/payment_app_context_impl.h b/content/browser/payments/payment_app_context_impl.h index 4b9ba42..b09d8f1 100644 --- a/content/browser/payments/payment_app_context_impl.h +++ b/content/browser/payments/payment_app_context_impl.h
@@ -10,7 +10,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/browser/payments/payment_app_database.h" #include "content/common/content_export.h"
diff --git a/content/browser/payments/payment_app_database.h b/content/browser/payments/payment_app_database.h index faeab1f..8e83b60 100644 --- a/content/browser/payments/payment_app_database.h +++ b/content/browser/payments/payment_app_database.h
@@ -10,7 +10,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_registration.h" #include "content/common/content_export.h"
diff --git a/content/browser/payments/payment_app_manager.h b/content/browser/payments/payment_app_manager.h index d5149b59..784ed19 100644 --- a/content/browser/payments/payment_app_manager.h +++ b/content/browser/payments/payment_app_manager.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/common/content_export.h" #include "mojo/public/cpp/bindings/binding.h" #include "url/gurl.h"
diff --git a/content/browser/payments/payment_app_manager_unittest.cc b/content/browser/payments/payment_app_manager_unittest.cc index 3880f48..1bdc4a8 100644 --- a/content/browser/payments/payment_app_manager_unittest.cc +++ b/content/browser/payments/payment_app_manager_unittest.cc
@@ -5,7 +5,7 @@ #include <utility> #include "base/macros.h" -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/browser/payments/payment_app_content_unittest_base.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h"
diff --git a/content/browser/payments/payment_app_provider_impl.h b/content/browser/payments/payment_app_provider_impl.h index 1c7fc494..83223aa 100644 --- a/content/browser/payments/payment_app_provider_impl.h +++ b/content/browser/payments/payment_app_provider_impl.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "base/memory/singleton.h" -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/common/content_export.h" #include "content/public/browser/payment_app_provider.h"
diff --git a/content/browser/payments/payment_app_provider_impl_unittest.cc b/content/browser/payments/payment_app_provider_impl_unittest.cc index 37290830..b7c6d996 100644 --- a/content/browser/payments/payment_app_provider_impl_unittest.cc +++ b/content/browser/payments/payment_app_provider_impl_unittest.cc
@@ -8,7 +8,7 @@ #include "base/macros.h" #include "base/run_loop.h" -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/browser/payments/payment_app_content_unittest_base.h" #include "content/browser/payments/payment_app_provider_impl.h" #include "testing/gtest/include/gtest/gtest.h"
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 bf8d780..53c758f 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -447,8 +447,8 @@ if (using_browser_compositor_) { cc::FrameSinkId frame_sink_id = host_->AllocateFrameSinkId(false /* is_guest_view_hack */); - delegated_frame_host_.reset(new ui::DelegatedFrameHostAndroid( - &view_, cached_background_color_, this, frame_sink_id)); + delegated_frame_host_.reset( + new ui::DelegatedFrameHostAndroid(&view_, this, frame_sink_id)); } host_->SetView(this); @@ -515,9 +515,6 @@ } void RenderWidgetHostViewAndroid::WasResized() { - if (delegated_frame_host_ && content_view_core_) - delegated_frame_host_->UpdateContainerSizeinDIP( - content_view_core_->GetViewportSizeDip()); host_->WasResized(); } @@ -787,9 +784,6 @@ cached_background_color_ = color; - if (delegated_frame_host_) - delegated_frame_host_->UpdateBackgroundColor(color); - view_.OnBackgroundColorChanged(color); }
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 307e3fc..48ca4f7 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -160,7 +160,6 @@ #if defined(USE_AURA) #include "content/public/common/service_manager_connection.h" -#include "ui/aura/mus/mus_util.h" #endif #if BUILDFLAG(ENABLE_PLUGINS) @@ -4213,7 +4212,9 @@ delegate_->ShouldSuppressDialogs(this) || !delegate_->GetJavaScriptDialogManager(this); if (suppress_this_message) { - rfhi->JavaScriptDialogClosed(reply_msg, true, base::string16(), true); + rfhi->JavaScriptDialogClosed(reply_msg, true, base::string16(), + /*is_before_unload_dialog=*/true, + /*dialog_was_suppressed=*/true); return; } @@ -4886,6 +4887,14 @@ if (!GetRenderViewHost() || !GetRenderViewHost()->IsRenderViewLive()) return; + // If a page is marked as ignoring input events, it is in a known state of + // unresponsiveness. In that case, showing a hung renderer dialog is + // inappropriate and shouldn't be happening. http://crbug.com/669881 + if (render_widget_host->ShouldDropInputEvents()) { + base::debug::DumpWithoutCrashing(); + NOTREACHED(); + } + if (delegate_) { WebContentsUnresponsiveState unresponsive_state; unresponsive_state.reason = type; @@ -5143,15 +5152,17 @@ observer.BeforeUnloadDialogCancelled(); } - is_showing_javascript_dialog_ = false; - is_showing_before_unload_dialog_ = false; if (rfh) { rfh->JavaScriptDialogClosed(reply_msg, success, user_input, + is_showing_before_unload_dialog_, dialog_was_suppressed); } else { // Don't leak the sync IPC reply if the RFH or process is gone. delete reply_msg; } + + is_showing_javascript_dialog_ = false; + is_showing_before_unload_dialog_ = false; } void WebContentsImpl::SetEncoding(const std::string& encoding) {
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index d55b7cd..0eacf97 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn
@@ -605,7 +605,7 @@ public_deps = [ "//components/leveldb/public/interfaces", - "//components/payments:payment_app", + "//components/payments/content:payment_app", "//content/public/common:interfaces", # TODO(mcasas): remove the following dep after https://crbug.com/653994
diff --git a/content/common/service_worker/service_worker_event_dispatcher.mojom b/content/common/service_worker/service_worker_event_dispatcher.mojom index ad8d7ebe..e47c085 100644 --- a/content/common/service_worker/service_worker_event_dispatcher.mojom +++ b/content/common/service_worker/service_worker_event_dispatcher.mojom
@@ -4,7 +4,7 @@ module content.mojom; -import "components/payments/payment_app.mojom"; +import "components/payments/content/payment_app.mojom"; import "content/common/url_loader.mojom"; import "mojo/common/string16.mojom"; import "mojo/common/time.mojom";
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn index abbbbfa..5c76e94b 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn
@@ -423,7 +423,7 @@ "//cc/surfaces:surface_id", "//cc/surfaces:surfaces", "//components/discardable_memory/client", - "//components/payments:payment_app", + "//components/payments/content:payment_app", "//components/url_formatter", "//content:resources", "//content/child",
diff --git a/content/renderer/service_worker/service_worker_context_client.h b/content/renderer/service_worker/service_worker_context_client.h index 1798c6d..ba76461 100644 --- a/content/renderer/service_worker/service_worker_context_client.h +++ b/content/renderer/service_worker/service_worker_context_client.h
@@ -19,7 +19,7 @@ #include "base/memory/ref_counted.h" #include "base/strings/string16.h" #include "base/time/time.h" -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/child/webmessageportchannel_impl.h" #include "content/common/service_worker/service_worker_event_dispatcher.mojom.h" #include "content/common/service_worker/service_worker_status_code.h"
diff --git a/content/renderer/service_worker/service_worker_type_converters.h b/content/renderer/service_worker/service_worker_type_converters.h index d992d2f6..905af61 100644 --- a/content/renderer/service_worker/service_worker_type_converters.h +++ b/content/renderer/service_worker/service_worker_type_converters.h
@@ -5,7 +5,7 @@ #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_TYPE_CONVERTERS_H_ #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_TYPE_CONVERTERS_H_ -#include "components/payments/payment_app.mojom.h" +#include "components/payments/content/payment_app.mojom.h" #include "content/common/service_worker/service_worker_status_code.h" #include "third_party/WebKit/public/platform/modules/payments/WebPaymentAppRequest.h" #include "third_party/WebKit/public/platform/modules/serviceworker/service_worker_event_status.mojom.h"
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index ee8ec0b..cc9b1f8 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -237,7 +237,7 @@ "//cc/surfaces", "//components/display_compositor", "//components/leveldb/public/interfaces", - "//components/payments:payment_app", + "//components/payments/content:payment_app", "//content/app:both_for_content_tests", "//content/browser:for_content_tests", "//content/browser/speech/proto", @@ -698,7 +698,7 @@ "//components/discardable_memory/client", "//components/discardable_memory/common", "//components/discardable_memory/service", - "//components/payments:payment_app", + "//components/payments/content:payment_app", "//content:resources", "//content/app:both_for_content_tests", "//content/browser:for_content_tests", @@ -1443,8 +1443,8 @@ "//cc/surfaces", "//components/display_compositor", "//components/leveldb/public/cpp", - "//components/payments:payment_app", - "//components/payments:payment_request", + "//components/payments/content:payment_app", + "//components/payments/content:payment_request", "//components/rappor:test_support", "//content:resources", "//content/app:both_for_content_tests",
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py index 9a8258a..01dfca46 100644 --- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py +++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -812,6 +812,9 @@ self.Fail('deqp/functional/gles3/shadertexturefunction/' + 'texelfetchoffset.html', ['linux', 'amd'], bug=483282) + self.Fail('deqp/functional/gles3/vertexarrays/' + + 'single_attribute.first.html', + ['linux', 'amd'], bug=694877) self.Fail('deqp/functional/gles3/negativetextureapi.html', ['linux', 'amd'], bug=483282)
diff --git a/docs/chrome_settings.md b/docs/chrome_settings.md index 97e0b27d..5628d56 100644 --- a/docs/chrome_settings.md +++ b/docs/chrome_settings.md
@@ -1,4 +1,24 @@ -# What is chrome://settings? +# Deprecation + +This doc refers to "options", the soon-to-be-deprecated version of +chrome://settings being replaced by Material Design Settings. + +**Any new features and bug fixes should be contributed to MD Settings, found in +the /settings/ directories (as opposed to the /options/ directories).** + +See: https://www.chromium.org/developers/updating-webui-for-material-design + +Note: As the soft launch begins, chrome://settings may start surfacing the +Material Design settings page. The deprecated "options" page will be available +during this time at chrome://settings-frame, but will eventually be removed. + +# Outdated + +The remainder of this doc has not been substantially updated in some time, but +is generally correct. Contact /options/ OWNERS if you have questions, but see +the deprecation notice above. + +## What is chrome://settings? Chrome (version 10 and above) uses WebUI settings by default for all platforms. Access it via the wrench menu ("Preferences" on Mac and Linux; "Options" on
diff --git a/extensions/browser/guest_view/extension_view/whitelist/OWNERS b/extensions/browser/guest_view/extension_view/whitelist/OWNERS index 4b00898..1be42c1 100644 --- a/extensions/browser/guest_view/extension_view/whitelist/OWNERS +++ b/extensions/browser/guest_view/extension_view/whitelist/OWNERS
@@ -8,4 +8,7 @@ darin@chromium.org dglazkov@chromium.org jam@chromium.org -jochen@chromium.org \ No newline at end of file +jochen@chromium.org + +# TEAM: extensions-dev@chromium.org +# COMPONENT: Platform>Extensions
diff --git a/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc b/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc index d6b9e6d..77bc51f 100644 --- a/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc +++ b/extensions/renderer/guest_view/guest_view_internal_custom_bindings.cc
@@ -347,7 +347,8 @@ if (frame->isWebLocalFrame()) { window = frame->mainWorldScriptContext()->Global(); } else { - window = frame->toWebRemoteFrame()->globalProxy(); + window = + frame->toWebRemoteFrame()->deprecatedMainWorldScriptContext()->Global(); } args.GetReturnValue().Set(window); }
diff --git a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc index 811e3ca..bb13920f 100644 --- a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc +++ b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc
@@ -242,7 +242,9 @@ guest_proxy_window = guest_proxy_frame->mainWorldScriptContext()->Global(); } else { - guest_proxy_window = guest_proxy_frame->toWebRemoteFrame()->globalProxy(); + guest_proxy_window = guest_proxy_frame->toWebRemoteFrame() + ->deprecatedMainWorldScriptContext() + ->Global(); } gin::Dictionary window_object(isolate, guest_proxy_window); v8::Local<v8::Function> post_message;
diff --git a/gpu/config/software_rendering_list_json.cc b/gpu/config/software_rendering_list_json.cc index a61563ad..ad2f9731f 100644 --- a/gpu/config/software_rendering_list_json.cc +++ b/gpu/config/software_rendering_list_json.cc
@@ -18,7 +18,7 @@ { "name": "software rendering list", // Please update the version number whenever you change this file. - "version": "12.16", + "version": "12.18", "entries": [ { "id": 1, @@ -1246,6 +1246,10 @@ "exceptions": [ { "vendor_id": "0x10de", + "pixel_shader_version": { + "op": ">=", + "value": "5.0" + }, "device_id": ["0x1340", "0x1341", "0x1344", "0x1346", "0x1347", "0x1348", "0x1349", "0x134d", "0x134e", "0x134f", "0x137a", "0x137d", "0x1380", "0x1381", "0x1382", @@ -1268,13 +1272,6 @@ }, { - "os": { - "type": "win", - "version": { - "op": ">=", - "value": "8.1" - } - }, "vendor_id": "0x8086", "pixel_shader_version": { "op": ">=", @@ -1282,14 +1279,11 @@ } }, { - "os": { - "type": "win", - "version": { - "op": ">=", - "value": "8.1" - } - }, "vendor_id": "0x1002", + "pixel_shader_version": { + "op": ">=", + "value": "5.0" + }, "device_id": ["0x1309", "0x130a", "0x130b", "0x130c", "0x130d", "0x130e", "0x130f", "0x1313", "0x1315", "0x1316", "0x1318", "0x131b", "0x131c", "0x131d", "0x6600", @@ -1376,17 +1370,6 @@ ] }, { - "id": 128, - "description": "WebGL 2 is not yet ready on Android", - "cr_bugs": [295792, 641635], - "os": { - "type": "android" - }, - "features": [ - "webgl2" - ] - }, - { "id":129, "description": "Intel drivers are buggy on Linux 2.x", "cr_bugs": [662909],
diff --git a/ios/chrome/browser/DEPS b/ios/chrome/browser/DEPS index 872fde97..0c9a0dc70 100644 --- a/ios/chrome/browser/DEPS +++ b/ios/chrome/browser/DEPS
@@ -48,7 +48,7 @@ "+components/password_manager/core/browser", "+components/password_manager/core/common", "+components/password_manager/sync/browser", - "+components/payments", + "+components/payments/core", "+components/physical_web/data_source", "+components/physical_web/webui", "+components/pref_registry",
diff --git a/ios/chrome/browser/payments/BUILD.gn b/ios/chrome/browser/payments/BUILD.gn index 01040da..07d0054 100644 --- a/ios/chrome/browser/payments/BUILD.gn +++ b/ios/chrome/browser/payments/BUILD.gn
@@ -57,7 +57,7 @@ "//base", "//components/autofill/core/browser", "//components/autofill/ios/browser", - "//components/payments:payment_validation", + "//components/payments/core", "//components/strings", "//ios/chrome/app/strings", "//ios/chrome/app/theme", @@ -106,7 +106,7 @@ "//base/test:test_support", "//components/autofill/core/browser", "//components/autofill/core/browser:test_support", - "//components/payments:payment_validation", + "//components/payments/core", "//components/strings", "//ios/chrome/app/strings", "//ios/chrome/browser",
diff --git a/ios/chrome/browser/payments/payment_items_display_view_controller.mm b/ios/chrome/browser/payments/payment_items_display_view_controller.mm index 3d8dc1b..9cb4bee 100644 --- a/ios/chrome/browser/payments/payment_items_display_view_controller.mm +++ b/ios/chrome/browser/payments/payment_items_display_view_controller.mm
@@ -8,7 +8,7 @@ #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/credit_card.h" -#include "components/payments/currency_formatter.h" +#include "components/payments/core/currency_formatter.h" #include "components/strings/grit/components_strings.h" #import "ios/chrome/browser/payments/cells/price_item.h" #import "ios/chrome/browser/payments/payment_items_display_view_controller_actions.h"
diff --git a/ios/chrome/browser/payments/payment_request.mm b/ios/chrome/browser/payments/payment_request.mm index e61c810..fe3bdee 100644 --- a/ios/chrome/browser/payments/payment_request.mm +++ b/ios/chrome/browser/payments/payment_request.mm
@@ -11,7 +11,7 @@ #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" -#include "components/payments/currency_formatter.h" +#include "components/payments/core/currency_formatter.h" #include "ios/chrome/browser/application_context.h" #include "ios/web/public/payments/payment_request.h"
diff --git a/ios/chrome/browser/payments/payment_request_unittest.mm b/ios/chrome/browser/payments/payment_request_unittest.mm index 8bcf4948..3e3470f 100644 --- a/ios/chrome/browser/payments/payment_request_unittest.mm +++ b/ios/chrome/browser/payments/payment_request_unittest.mm
@@ -6,7 +6,7 @@ #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/test_personal_data_manager.h" -#include "components/payments/currency_formatter.h" +#include "components/payments/core/currency_formatter.h" #include "ios/chrome/browser/application_context.h" #include "ios/web/public/payments/payment_request.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/ios/chrome/browser/payments/payment_request_view_controller.mm b/ios/chrome/browser/payments/payment_request_view_controller.mm index 07125fc6..3f442cf 100644 --- a/ios/chrome/browser/payments/payment_request_view_controller.mm +++ b/ios/chrome/browser/payments/payment_request_view_controller.mm
@@ -13,7 +13,7 @@ #include "components/autofill/core/browser/credit_card.h" #include "components/autofill/core/browser/field_types.h" #include "components/autofill/core/browser/personal_data_manager.h" -#include "components/payments/currency_formatter.h" +#include "components/payments/core/currency_formatter.h" #include "components/strings/grit/components_strings.h" #import "ios/chrome/browser/payments/cells/page_info_item.h" #import "ios/chrome/browser/payments/cells/payment_method_item.h"
diff --git a/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm b/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm index 69fefff5..73b317b 100644 --- a/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm +++ b/ios/chrome/browser/payments/shipping_option_selection_view_controller.mm
@@ -7,7 +7,7 @@ #include "base/mac/foundation_util.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" -#include "components/payments/currency_formatter.h" +#include "components/payments/core/currency_formatter.h" #include "components/strings/grit/components_strings.h" #import "ios/chrome/browser/payments/cells/payments_text_item.h" #include "ios/chrome/browser/payments/payment_request.h"
diff --git a/ios/chrome/browser/update_client/OWNERS b/ios/chrome/browser/update_client/OWNERS index be72ff8..75e2f4d 100644 --- a/ios/chrome/browser/update_client/OWNERS +++ b/ios/chrome/browser/update_client/OWNERS
@@ -2,3 +2,5 @@ cpu@chromium.org sorin@chromium.org waffles@chromium.org + +# COMPONENT: Internals>Installer>Components
diff --git a/net/cert/ev_root_ca_metadata.cc b/net/cert/ev_root_ca_metadata.cc index a7e85ec..c513f66a6 100644 --- a/net/cert/ev_root_ca_metadata.cc +++ b/net/cert/ev_root_ca_metadata.cc
@@ -281,6 +281,13 @@ 0x8d, 0xe8, 0x1e, 0x57, 0xef, 0xbb, 0x93, 0x22, 0x72, 0xd4}}, {"2.16.840.1.114028.10.1.2", ""}, }, + // Entrust Root Certification Authority – EC1 + // https://validec.entrust.net + { + {{0x20, 0xd8, 0x06, 0x40, 0xdf, 0x9b, 0x25, 0xf5, 0x12, 0x25, + 0x3a, 0x11, 0xea, 0xf7, 0x59, 0x8a, 0xeb, 0x14, 0xb5, 0x47}}, + {"2.16.840.1.114028.10.1.2", ""}, + }, // Equifax Secure Certificate Authority (GeoTrust) // https://www.geotrust.com/ {
diff --git a/net/spdy/hpack/hpack_decoder.cc b/net/spdy/hpack/hpack_decoder.cc index 0b6c4fc..5f76762 100644 --- a/net/spdy/hpack/hpack_decoder.cc +++ b/net/spdy/hpack/hpack_decoder.cc
@@ -26,7 +26,6 @@ size_updates_allowed_(true), incremental_decode_(false) {} - HpackDecoder::~HpackDecoder() {} void HpackDecoder::ApplyHeaderTableSizeSetting(size_t size_setting) {
diff --git a/net/spdy/hpack/hpack_entry.cc b/net/spdy/hpack/hpack_entry.cc index 1c0eebe..8c5d3d4 100644 --- a/net/spdy/hpack/hpack_entry.cc +++ b/net/spdy/hpack/hpack_entry.cc
@@ -27,14 +27,17 @@ time_added_(0) {} HpackEntry::HpackEntry(StringPiece name, StringPiece value) - : name_ref_(name), value_ref_(value), insertion_index_(0), type_(LOOKUP), + : name_ref_(name), + value_ref_(value), + insertion_index_(0), + type_(LOOKUP), time_added_(0) {} -HpackEntry::HpackEntry() - : insertion_index_(0), type_(LOOKUP), time_added_(0) {} +HpackEntry::HpackEntry() : insertion_index_(0), type_(LOOKUP), time_added_(0) {} HpackEntry::HpackEntry(const HpackEntry& other) - : insertion_index_(other.insertion_index_), type_(other.type_), + : insertion_index_(other.insertion_index_), + type_(other.type_), time_added_(0) { if (type_ == LOOKUP) { name_ref_ = other.name_ref_;
diff --git a/printing/print_settings_initializer_win.cc b/printing/print_settings_initializer_win.cc index 95d2fced..685c8fd6 100644 --- a/printing/print_settings_initializer_win.cc +++ b/printing/print_settings_initializer_win.cc
@@ -12,7 +12,7 @@ namespace { -bool HasEscapeSupprt(HDC hdc, DWORD escape) { +bool HasEscapeSupport(HDC hdc, DWORD escape) { const char* ptr = reinterpret_cast<const char*>(&escape); return ExtEscape(hdc, QUERYESCSUPPORT, sizeof(escape), ptr, 0, nullptr) > 0; } @@ -21,18 +21,7 @@ if (::GetDeviceCaps(hdc, TECHNOLOGY) != DT_RASPRINTER) return false; - // If postscript, try to query Postscript Identify and then set to - // postscript mode before calling any more ExtEscape functions. Otherwise, - // PSLEVEL query will not work. - if (strcmp(technology, "PostScript") == 0 && - HasEscapeSupprt(hdc, POSTSCRIPT_IDENTIFY)) { - DWORD mode = PSIDENT_PSCENTRIC; - const char* ptr = reinterpret_cast<const char*>(&mode); - ExtEscape(hdc, POSTSCRIPT_IDENTIFY, sizeof(DWORD), ptr, 0, nullptr); - return true; - } - - if (!HasEscapeSupprt(hdc, GETTECHNOLOGY)) + if (!HasEscapeSupport(hdc, GETTECHNOLOGY)) return false; char buf[256]; @@ -42,36 +31,59 @@ return strcmp(buf, technology) == 0; } +void SetPrinterToGdiMode(HDC hdc) { + // Try to set to GDI centric mode + DWORD mode = PSIDENT_GDICENTRIC; + const char* ptr = reinterpret_cast<const char*>(&mode); + ExtEscape(hdc, POSTSCRIPT_IDENTIFY, sizeof(DWORD), ptr, 0, nullptr); +} + +int GetPrinterPostScriptLevel(HDC hdc) { + constexpr int param = FEATURESETTING_PSLEVEL; + const char* param_char_ptr = reinterpret_cast<const char*>(¶m); + int param_out = 0; + char* param_out_char_ptr = reinterpret_cast<char*>(¶m_out); + if (ExtEscape(hdc, GET_PS_FEATURESETTING, sizeof(param), param_char_ptr, + sizeof(param_out), param_out_char_ptr) > 0) { + return param_out; + } + return 0; +} + bool IsPrinterPostScript(HDC hdc, int* level) { static constexpr char kPostScriptDriver[] = "PostScript"; - if (!IsTechnology(hdc, kPostScriptDriver)) { - return false; - } - // Query the PS Level if possible. - if (HasEscapeSupprt(hdc, GET_PS_FEATURESETTING)) { - constexpr int param = FEATURESETTING_PSLEVEL; - const char* param_char_ptr = reinterpret_cast<const char*>(¶m); - int param_out = -1; - char* param_out_char_ptr = reinterpret_cast<char*>(¶m_out); - if (ExtEscape(hdc, GET_PS_FEATURESETTING, sizeof(param), param_char_ptr, - sizeof(param_out), param_out_char_ptr) > 0) { - if (param_out < 2 || param_out > 3) - return false; - - *level = param_out; - return true; + // If printer does not support POSTSCRIPT_IDENTIFY, it cannot be set to GDI + // mode to check the language level supported. See if it looks like a + // postscript printer and supports the postscript functions that are + // supported in compatability mode. If so set to level 2 postscript. + if (!HasEscapeSupport(hdc, POSTSCRIPT_IDENTIFY)) { + if (!IsTechnology(hdc, kPostScriptDriver)) + return false; + if (!HasEscapeSupport(hdc, POSTSCRIPT_PASSTHROUGH) || + !HasEscapeSupport(hdc, POSTSCRIPT_DATA)) { + return false; } - } - - // If it looks like a PS printer. - if (HasEscapeSupprt(hdc, POSTSCRIPT_PASSTHROUGH) && - HasEscapeSupprt(hdc, POSTSCRIPT_DATA)) { *level = 2; return true; } - return false; + // Printer supports POSTSCRIPT_IDENTIFY so we can assume it has a postscript + // driver. Set the printer to GDI mode in order to query the postscript + // level. Use GDI mode instead of PostScript mode so that if level detection + // fails or returns language level < 2 we can fall back to normal printing. + // Note: This escape must be called before other escapes. + SetPrinterToGdiMode(hdc); + if (!HasEscapeSupport(hdc, GET_PS_FEATURESETTING)) { + // Can't query the level, use level 2 to be safe + *level = 2; + return true; + } + + // Get the language level. If invalid or < 2, return false to set printer to + // normal printing mode. + *level = GetPrinterPostScriptLevel(hdc); + return *level == 2 || *level == 3; } bool IsPrinterXPS(HDC hdc) {
diff --git a/remoting/protocol/connection_unittest.cc b/remoting/protocol/connection_unittest.cc index 9aecebd..1794f2fd 100644 --- a/remoting/protocol/connection_unittest.cc +++ b/remoting/protocol/connection_unittest.cc
@@ -234,12 +234,14 @@ ++right; } } + + const int kMaxErrorHz = 50; int left_hz = (left * kAudioSampleRate / (num_samples - skipped_samples)); - EXPECT_LE(kTestAudioSignalFrequencyLeftHz - 50, left_hz); - EXPECT_GE(kTestAudioSignalFrequencyLeftHz + 50, left_hz); + EXPECT_LE(kTestAudioSignalFrequencyLeftHz - kMaxErrorHz, left_hz); + EXPECT_GE(kTestAudioSignalFrequencyLeftHz + kMaxErrorHz, left_hz); int right_hz = (right * kAudioSampleRate / (num_samples - skipped_samples)); - EXPECT_LE(kTestAudioSignalFrequencyRightHz - 50, right_hz); - EXPECT_GE(kTestAudioSignalFrequencyRightHz + 50, right_hz); + EXPECT_LE(kTestAudioSignalFrequencyRightHz - kMaxErrorHz, right_hz); + EXPECT_GE(kTestAudioSignalFrequencyRightHz + kMaxErrorHz, right_hz); } base::WeakPtr<AudioStub> GetWeakPtr() { return weak_factory_.GetWeakPtr(); } @@ -622,10 +624,6 @@ EXPECT_LE(stats.client_stats.time_rendered, finish_time); } -// Flaky on Linux/ChromeOS, crbug.com/685910. -// Note: Apparently it's not possible to use the common MAYBE_ prefix with -// TEST_P, so ifdef it out completely. -#if !defined(OS_LINUX) && !defined(OS_CHROMEOS) TEST_P(ConnectionTest, Audio) { Connect(); @@ -636,7 +634,6 @@ client_audio_player_.WaitForSamples(kAudioSampleRate * 2); client_audio_player_.Verify(); } -#endif TEST_P(ConnectionTest, FirstCaptureFailed) { Connect();
diff --git a/remoting/protocol/webrtc_transport.cc b/remoting/protocol/webrtc_transport.cc index 468bf0f4..693521c38 100644 --- a/remoting/protocol/webrtc_transport.cc +++ b/remoting/protocol/webrtc_transport.cc
@@ -81,10 +81,10 @@ } } - // Update SDP format to use stereo for opus codec. + // Update SDP format to use 160kbps stereo for opus codec. if (sdp_message->has_audio() && !sdp_message->AddCodecParameter("opus", - "stereo=1; x-google-min-bitrate=160")) { + "stereo=1; maxaveragebitrate=163840")) { if (incoming) { LOG(WARNING) << "Opus not found in an incoming SDP."; } else {
diff --git a/sandbox/OWNERS b/sandbox/OWNERS index 5d3f6ff..d61d158 100644 --- a/sandbox/OWNERS +++ b/sandbox/OWNERS
@@ -1,3 +1,6 @@ cpu@chromium.org jln@chromium.org jschuh@chromium.org + +# TEAM: security-dev@chromium.org +# COMPONENT: Internals>Sandbox
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 index 9632f9d7..54cbe6b 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -1617,20 +1617,10 @@ Bug(none) fast/table/edge-offsets.html [ Failure ] # Some work remains to fully support composited animation and scrolling. -crbug.com/674317 virtual/threaded/animations/KeyframeEffectReadOnly-composited-animation.html [ Timeout ] -crbug.com/674317 virtual/threaded/animations/composited-animations-rotate-zero-degrees.html [ Timeout ] -crbug.com/674317 virtual/threaded/animations/composited-animations-simple.html [ Timeout ] -crbug.com/674317 virtual/threaded/animations/composited-animations-timing-function.html [ Timeout ] -crbug.com/674317 virtual/threaded/animations/composited-animations-translate-rotate-scale.html [ Timeout ] crbug.com/674317 virtual/threaded/animations/composited-filter-webkit-filter.html [ Failure ] crbug.com/674317 virtual/threaded/animations/compositor-independent-transform-cancel.html [ Failure ] -crbug.com/674317 virtual/threaded/animations/compositor-start-event-timing.html [ Timeout ] -crbug.com/674317 virtual/threaded/animations/element-animate-positive-delay.html [ Timeout ] -crbug.com/674317 virtual/threaded/animations/img-element-transform.html [ Timeout ] -crbug.com/674317 virtual/threaded/animations/inline-block-transform.html [ Timeout ] -crbug.com/674317 virtual/threaded/animations/sample-on-last-keyframe.html [ Timeout ] +crbug.com/692310 virtual/threaded/animations/sample-on-last-keyframe.html [ Timeout ] crbug.com/674317 virtual/threaded/animations/skew-notsequential-compositor.html [ Failure ] -crbug.com/674317 virtual/threaded/animations/transitions-retarget.html [ Timeout ] crbug.com/674317 virtual/threaded/animations/zoom-responsive-transform-animation.html [ Timeout ] crbug.com/674317 virtual/threaded/fast/scroll-behavior/first-scroll-runs-on-compositor.html [ Timeout ] crbug.com/674317 virtual/threaded/fast/scroll-behavior/smooth-scroll/fixed-background-in-iframe.html [ Crash Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 49eb5d9a..4a53bdd2 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1414,6 +1414,7 @@ crbug.com/613672 [ Mac ] fast/events/pointerevents/pointer-event-in-slop-region.html [ Skip ] crbug.com/613672 [ Mac ] external/wpt/pointerevents/pointerlock/pointerevent_movementxy-manual.html [ Skip ] crbug.com/613672 [ Mac ] external/wpt/pointerevents/compat/pointerevent_touch-action_two-finger_interaction-manual.html [ Skip ] +crbug.com/613672 [ Mac ] external/wpt/pointerevents/pointerevent_disabled_form_control-manual.html [ Skip ] crbug.com/613672 [ Mac ] external/wpt/pointerevents/pointerevent_sequence_at_implicit_release_on_drag-manual.html [ Skip ] crbug.com/613672 [ Mac ] external/wpt/pointerevents/pointerevent_sequence_at_implicit_release_on_click-manual.html [ Skip ] crbug.com/613672 [ Mac ] external/wpt/pointerevents/pointerevent_boundary_events_in_capturing-manual.html [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/animations/compositor-start-event-timing.html b/third_party/WebKit/LayoutTests/animations/compositor-start-event-timing.html index 15a425cc..e12b8b7 100644 --- a/third_party/WebKit/LayoutTests/animations/compositor-start-event-timing.html +++ b/third_party/WebKit/LayoutTests/animations/compositor-start-event-timing.html
@@ -15,7 +15,7 @@ } } </style> -<body> +<body>x <script> 'use strict'; async_test(function(t) {
diff --git a/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js b/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js index 3b5fc00..c542583f 100644 --- a/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js +++ b/third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js
@@ -34,6 +34,8 @@ createStaticElements() { this.error = document.createElement('span'); this.error.style.color = 'red'; + // The element must have some painted content in order to be composited. + this.error.textContent = 'x'; document.body.appendChild(this.error); this.wrapper = document.createElement('div');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json b/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json index d370ed2..4363658 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/wpt/MANIFEST.json
@@ -379,6 +379,12 @@ {} ] ], + "pointerevents/pointerevent_disabled_form_control-manual.html": [ + [ + "/pointerevents/pointerevent_disabled_form_control-manual.html", + {} + ] + ], "pointerevents/pointerevent_element_haspointercapture-manual.html": [ [ "/pointerevents/pointerevent_element_haspointercapture-manual.html", @@ -76129,6 +76135,10 @@ "0b247d3b7dfd047c217a78c59652a3c32df0fcfa", "testharness" ], + "pointerevents/pointerevent_disabled_form_control-manual.html": [ + "3f243b91d34f5ea8124a0ac78bf464ba67c75456", + "manual" + ], "pointerevents/pointerevent_element_haspointercapture-manual.html": [ "fd7ceeb1f55491c3082a0171951a9bc1489500cc", "manual"
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation-manual.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation-manual.html index 4bf8f5b..0fa9de7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation-manual.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation-manual.html
@@ -1,7 +1,7 @@ <html> <head> <style> - iframe { width: 400px; height: 200px;} + iframe { width: 400px; height: 300px;} </style> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/support/iframe-that-performs-top-navigation.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/support/iframe-that-performs-top-navigation.html index 74c7a1ee2..c855ca3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/support/iframe-that-performs-top-navigation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-iframe-element/support/iframe-that-performs-top-navigation.html
@@ -13,7 +13,7 @@ </head> <body onload="performTest();"> <p>This doc tried to navigate the top page when loaded, which should fail since it's not trigged by user activation while in a sandboxed frame with 'allow-top-navigtaion-by-user-activation'. <br> <br> - If you click the button below, the top navigation should succeed with the new page saying "PASSED: Navigation succeeded.". + Click the button below, the top navigation should succeed with a new page saying "PASSED: Navigation succeeded." in browsers supporting the 'allow-top-navigtaion-by-user-activation' iframe@sandbox keyword (eg., Chrome v58+); Otherwise, the top navigation should fail. </p> <button id="b" onclick="performTest();">Navigate the top page</button> </body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerevent_disabled_form_control-manual.html b/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerevent_disabled_form_control-manual.html new file mode 100644 index 0000000..20e07a9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/pointerevents/pointerevent_disabled_form_control-manual.html
@@ -0,0 +1,66 @@ +<!doctype html> +<html> + <head> + <title>Pointer Events properties tests</title> + <meta name="viewport" content="width=device-width"> + <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <!-- Additional helper script for common checks across event types --> + <script type="text/javascript" src="pointerevent_support.js"></script> + <script> + var detected_pointertypes = {}; + var detected_eventTypes = {}; + var eventList = ['pointerout', 'pointerover', 'pointerenter', 'pointermove', 'pointerdown', 'pointerup', 'pointerleave']; + + function resetTestState() { + detected_eventTypes = {}; + } + function run() { + var test_pointerEvent = setup_pointerevent_test("pointerevent attributes", ALL_POINTERS); + var target = document.getElementById("target0"); + + eventList.forEach(function(eventName) { + on_event(target, eventName, function (event) { + detected_eventTypes[event.type] = true; + detected_pointertypes[event.pointerType] = true; + + if (Object.keys(detected_eventTypes).length == eventList.length) { + test_pointerEvent.done(); + } + }); + }); + on_event(target, "click", function (event) { + assert_unreached("click should not fire on disabled element"); + }); + } + </script> + <style> + #target0 { + background: purple; + border: 1px solid orange; + touch-action: none; + width: 200px; + height: 100px; + } + </style> + </head> + <body onload="run()"> + <h1> Pointer Event: pointerevents fire to disabled form controls</h1> + <h2 id="pointerTypeDescription"></h2> + <h4> + Test Description: + Pointerevents are dispatched to disabled form controls. + </h4> + <div id="instructions"> + Use the mouse or pen to press on the purple button. Or with touch, tap on the purple box. + </div> + <button id="target0" disabled>Disabled button</button> + <div id="complete-notice"> + <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p> + <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p> + <p>Refresh the page to run the tests again with a different pointer type.</p> + </div> + <div id="log"></div> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/uievents/constructors/inputevent-constructor.html b/third_party/WebKit/LayoutTests/external/wpt/uievents/constructors/inputevent-constructor.html index f1f5641..9ade36d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/uievents/constructors/inputevent-constructor.html +++ b/third_party/WebKit/LayoutTests/external/wpt/uievents/constructors/inputevent-constructor.html
@@ -22,4 +22,14 @@ test(function() { assert_equals(new InputEvent('type', { data: 'data' }).data, 'data'); }, 'InputEvent construtor with InputEventInit where data is non empty string'); + +test(function() { + const range = new StaticRange(); + range.setEnd(document, 1); + const resultRange = new InputEvent('type', { targetRanges: [range] }).getTargetRanges()[0]; + assert_equals(resultRange.startContainer, document); + assert_equals(resultRange.startOffset, 0); + assert_equals(resultRange.endContainer, document); + assert_equals(resultRange.endOffset, 1); +}, 'InputEvent construtor with InputEventInit where targetRanges is non empty list'); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerevent_disabled_form_control-manual-automation.js b/third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerevent_disabled_form_control-manual-automation.js new file mode 100644 index 0000000..80c2b1dc --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerevent_disabled_form_control-manual-automation.js
@@ -0,0 +1,13 @@ +importAutomationScript('/pointerevents/pointerevent_common_input.js'); + +function inject_input() { + return mouseClickInTarget('#target0').then(function() { + return mouseMoveToDocument(); + }).then(function() { + return pointerDragInTarget('touch', '#target0', 'right'); + }).then(function() { + return penClickInTarget('#target0'); + }).then(function() { + return penMoveToDocument(); + }); +}
diff --git a/third_party/WebKit/LayoutTests/external/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.txt b/third_party/WebKit/LayoutTests/external/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.txt deleted file mode 100644 index 421376d..0000000 --- a/third_party/WebKit/LayoutTests/external/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.txt +++ /dev/null
@@ -1 +0,0 @@ -dummy
diff --git a/third_party/WebKit/LayoutTests/fast/frames/sandboxed-iframe-close-top-noclose-expected.txt b/third_party/WebKit/LayoutTests/fast/frames/sandboxed-iframe-close-top-noclose-expected.txt index 0555cbc..6cf259cf 100644 --- a/third_party/WebKit/LayoutTests/fast/frames/sandboxed-iframe-close-top-noclose-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/frames/sandboxed-iframe-close-top-noclose-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: line 2: Unsafe JavaScript attempt to initiate navigation for frame with URL 'close-top.html'. The frame attempting navigation of the top-level window is sandboxed, but the 'allow-top-navigation' flag is not set. +CONSOLE ERROR: line 2: Unsafe JavaScript attempt to initiate navigation for frame with URL 'close-top.html'. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set. This test verifies that a sandboxed IFrame can close a top-level frame with allow-top-navigation.
diff --git a/third_party/WebKit/LayoutTests/fast/frames/sandboxed-iframe-navigation-top-denied-expected.txt b/third_party/WebKit/LayoutTests/fast/frames/sandboxed-iframe-navigation-top-denied-expected.txt index 03950835..4e422ce 100644 --- a/third_party/WebKit/LayoutTests/fast/frames/sandboxed-iframe-navigation-top-denied-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/frames/sandboxed-iframe-navigation-top-denied-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: line 2: Unsafe JavaScript attempt to initiate navigation for frame with URL 'navigate-top-to-fail.html'. The frame attempting navigation of the top-level window is sandboxed, but the 'allow-top-navigation' flag is not set. +CONSOLE ERROR: line 2: Unsafe JavaScript attempt to initiate navigation for frame with URL 'navigate-top-to-fail.html'. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set. CONSOLE ERROR: line 2: Uncaught SecurityError: Failed to set the 'location' property on 'Window': The current window does not have permission to navigate the target frame to 'fail-and-notify-done.html'. This test verifies that a sandboxed IFrame cannot navigate the top-level frame without allow-top-navigation. This test passes if the navigation does not occur.
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/new-window-sandboxed-iframe-expected.txt b/third_party/WebKit/LayoutTests/http/tests/navigation/new-window-sandboxed-iframe-expected.txt index 76a4fbb..7be64ba 100644 --- a/third_party/WebKit/LayoutTests/http/tests/navigation/new-window-sandboxed-iframe-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/navigation/new-window-sandboxed-iframe-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: line 3: Unsafe JavaScript attempt to initiate navigation for frame with URL 'http://127.0.0.1:8000/navigation/resources/new-window-sandboxed-iframe-destination.html' from frame with URL 'http://127.0.0.1:8000/navigation/resources/new-window-sandboxed-iframe-destination-iframe.html'. The frame attempting navigation of the top-level window is sandboxed, but the 'allow-top-navigation' flag is not set. +CONSOLE ERROR: line 3: Unsafe JavaScript attempt to initiate navigation for frame with URL 'http://127.0.0.1:8000/navigation/resources/new-window-sandboxed-iframe-destination.html' from frame with URL 'http://127.0.0.1:8000/navigation/resources/new-window-sandboxed-iframe-destination-iframe.html'. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-top-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-top-expected.txt index 6fafdd6..007894b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-top-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/no-popup-from-sandbox-top-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: line 1: Unsafe JavaScript attempt to initiate navigation for frame with URL 'http://127.0.0.1:8000/security/no-popup-from-sandbox-top.html' from frame with URL 'data:text/html, <script> var win = window.open('about:blank', '_top'); console.log(win ? 'FAIL' : 'PASS'); </script>'. The frame attempting navigation of the top-level window is sandboxed, but the 'allow-top-navigation' flag is not set. +CONSOLE ERROR: line 1: Unsafe JavaScript attempt to initiate navigation for frame with URL 'http://127.0.0.1:8000/security/no-popup-from-sandbox-top.html' from frame with URL 'data:text/html, <script> var win = window.open('about:blank', '_top'); console.log(win ? 'FAIL' : 'PASS'); </script>'. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set. CONSOLE MESSAGE: line 1: PASS To run this test outside of DumpRenderTree, please disable your popup blocker!
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/sandboxed-iframe-form-top-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/sandboxed-iframe-form-top-expected.txt index 2e2e7adc..befb4d7b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/security/sandboxed-iframe-form-top-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/security/sandboxed-iframe-form-top-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: line 8: Unsafe JavaScript attempt to initiate navigation for frame with URL 'http://127.0.0.1:8000/security/sandboxed-iframe-form-top.html' from frame with URL 'http://127.0.0.1:8000/security/resources/sandboxed-iframe-form-top.html'. The frame attempting navigation of the top-level window is sandboxed, but the 'allow-top-navigation' flag is not set. +CONSOLE ERROR: line 8: Unsafe JavaScript attempt to initiate navigation for frame with URL 'http://127.0.0.1:8000/security/sandboxed-iframe-form-top.html' from frame with URL 'http://127.0.0.1:8000/security/resources/sandboxed-iframe-form-top.html'. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set. This tests passes if the sandboxed frame cannot navigate the top frame.
diff --git a/third_party/WebKit/LayoutTests/payments/resources/payment-request-mock.js b/third_party/WebKit/LayoutTests/payments/resources/payment-request-mock.js index 5d96e2d..dce8a0a 100644 --- a/third_party/WebKit/LayoutTests/payments/resources/payment-request-mock.js +++ b/third_party/WebKit/LayoutTests/payments/resources/payment-request-mock.js
@@ -6,7 +6,7 @@ let paymentRequestMock = loadMojoModules( 'paymentRequestMock', - ['components/payments/payment_request.mojom', + ['components/payments/content/payment_request.mojom', 'mojo/public/js/bindings', ]).then(mojo => { let [paymentRequest, bindings] = mojo.modules;
diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/animations/KeyframeEffectReadOnly-composited-animation.html b/third_party/WebKit/LayoutTests/virtual/threaded/animations/KeyframeEffectReadOnly-composited-animation.html index db97975..dc9d1bb 100644 --- a/third_party/WebKit/LayoutTests/virtual/threaded/animations/KeyframeEffectReadOnly-composited-animation.html +++ b/third_party/WebKit/LayoutTests/virtual/threaded/animations/KeyframeEffectReadOnly-composited-animation.html
@@ -4,8 +4,8 @@ <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> <body> -<div id="target"></div> -<div id="targetRO"></div> +<div id="target">x</div> +<div id="targetRO">x</div> <script> "use strict";
diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/animations/element-animate-positive-delay.html b/third_party/WebKit/LayoutTests/virtual/threaded/animations/element-animate-positive-delay.html index 43503086..c58def4 100644 --- a/third_party/WebKit/LayoutTests/virtual/threaded/animations/element-animate-positive-delay.html +++ b/third_party/WebKit/LayoutTests/virtual/threaded/animations/element-animate-positive-delay.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> -<div id="target"></div> +<div id="target">x</div> <script> promise_test(function() { var animation = target.animate({
diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/animations/img-element-transform.html b/third_party/WebKit/LayoutTests/virtual/threaded/animations/img-element-transform.html index 2b26f8c..8a84b4ae 100644 --- a/third_party/WebKit/LayoutTests/virtual/threaded/animations/img-element-transform.html +++ b/third_party/WebKit/LayoutTests/virtual/threaded/animations/img-element-transform.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> -<img id="target"> +<img id="target" src="../../../animations/resources/green-100.png"> <script> promise_test(function() { var animation = target.animate({transform: ['rotate(0deg)', 'rotate(180deg)']}, 100000);
diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/animations/inline-block-transform.html b/third_party/WebKit/LayoutTests/virtual/threaded/animations/inline-block-transform.html index cb7efc3..f3b2a3e9 100644 --- a/third_party/WebKit/LayoutTests/virtual/threaded/animations/inline-block-transform.html +++ b/third_party/WebKit/LayoutTests/virtual/threaded/animations/inline-block-transform.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> -<div id=target style="display:inline-block"></div> +<div id="target" style="display:inline-block">x</div> <script> var test = async_test('inline-block should run compositor animations'); var anim = target.animate({transform: ['rotate(0deg)', 'rotate(180deg)']}, 100000);
diff --git a/third_party/WebKit/LayoutTests/virtual/threaded/animations/transitions-retarget.html b/third_party/WebKit/LayoutTests/virtual/threaded/animations/transitions-retarget.html index facc097..46e055a 100644 --- a/third_party/WebKit/LayoutTests/virtual/threaded/animations/transitions-retarget.html +++ b/third_party/WebKit/LayoutTests/virtual/threaded/animations/transitions-retarget.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <script src="../../../resources/testharness.js"></script> <script src="../../../resources/testharnessreport.js"></script> -<div id='element'></div> +<div id="element">x</div> <style> #element { transition: transform 2000ms;
diff --git a/third_party/WebKit/LayoutTests/webaudio/audiosummingjunction-crash-expected.txt b/third_party/WebKit/LayoutTests/webaudio/audiosummingjunction-crash-expected.txt deleted file mode 100644 index 43e5eeed..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/audiosummingjunction-crash-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/WebKit/LayoutTests/webaudio/audiosummingjunction-crash.html b/third_party/WebKit/LayoutTests/webaudio/audiosummingjunction-crash.html index d00cdde0..3074e49 100644 --- a/third_party/WebKit/LayoutTests/webaudio/audiosummingjunction-crash.html +++ b/third_party/WebKit/LayoutTests/webaudio/audiosummingjunction-crash.html
@@ -1,10 +1,26 @@ <body> -<script src="../resources/js-test.js"> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<script src="resources/audit.js"></script> <script> -description("This test passes if it doesn't crash."); -var ac = new AudioContext(); -var node = ac.createChannelMerger(4); -node.connect(ac.createMediaStreamDestination(), 0); -gc(); +let audit = Audit.createTaskRunner(); + +audit.define( + { + label: 'test', + description: + 'Test connection from ChannelMerger to MediaStreamAudioDestination' + }, + (task, should) => { + let context = new AudioContext(); + let node = context.createChannelMerger(4); + node.connect(context.createMediaStreamDestination(), 0); + gc(); + // Test passes if we get here because we didn't crash + should(true, 'Test survived GC').message('correctly', 'incorrectly'); + task.done(); + }); + +audit.run(); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/mixing-expected.wav b/third_party/WebKit/LayoutTests/webaudio/mixing-expected.wav deleted file mode 100644 index 1f1dffd0..0000000 --- a/third_party/WebKit/LayoutTests/webaudio/mixing-expected.wav +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/webaudio/mixing.html b/third_party/WebKit/LayoutTests/webaudio/mixing.html index 1d04149..6c7967c 100644 --- a/third_party/WebKit/LayoutTests/webaudio/mixing.html +++ b/third_party/WebKit/LayoutTests/webaudio/mixing.html
@@ -7,59 +7,126 @@ <html> <head> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> <script src="resources/audit-util.js"></script> -<script src="resources/audio-testing.js"></script> -<script type="text/javascript" src="resources/buffer-loader.js"></script> - +<script src="resources/audit.js"></script> </head> <body> <script> +let audit = Audit.createTaskRunner(); -window.onload = init; +let sampleRate = 44100.0; +let lengthInSeconds = 2; -var sampleRate = 44100.0; -var lengthInSeconds = 2; +audit.define('test', (task, should) => { + // Create offline audio context. + let context = + new OfflineAudioContext(2, sampleRate * lengthInSeconds, sampleRate); -var context = 0; -var bufferLoader = 0; + // Load up audio files and test + Promise + .all([ + // This file is stereo + Audit.loadFileFromUrl('resources/hyper-reality/br-jam-loop.wav') + .then(response => { return context.decodeAudioData(response); }), + // This file is mono + Audit.loadFileFromUrl('resources/hyper-reality/laughter.wav') + .then(response => { return context.decodeAudioData(response); }), + ]) + .then(audioBuffers => { + // Thresholds are experimentally determined + return runTest(context, audioBuffers, should, [ + {snrThreshold: Infinity, errorThreshold: 0}, + {snrThreshold: Infinity, errorThreshold: 0} + ]); + }) + .then(() => task.done()); +}); -function init() { - if (!window.testRunner) - return; - - // Create offline audio context. - context = new OfflineAudioContext(2, sampleRate * lengthInSeconds, sampleRate); - - bufferLoader = new BufferLoader( - context, - [ - "resources/hyper-reality/br-jam-loop.wav", - "resources/hyper-reality/laughter.wav", - ], - finishedLoading - ); +audit.run(); - bufferLoader.load(); - testRunner.waitUntilDone(); +function runTest(context, bufferList, should, testThresholds) { + should(bufferList.length, 'Number of decoded files').beEqualTo(2); + + // Create two sources and play them at the same time. + let source1 = context.createBufferSource(); + let source2 = context.createBufferSource(); + source1.buffer = bufferList[0]; + source2.buffer = bufferList[1]; + + source1.connect(context.destination); + source2.connect(context.destination); + source1.start(0); + source2.start(0); + + // Verify the number of channels in each source and the expected result. + should(bufferList[0].numberOfChannels, 'Number of channels in stereo source') + .beEqualTo(2); + + should(bufferList[1].numberOfChannels, 'Number of channels in mono source') + .beEqualTo(1); + + return context.startRendering().then(verifyResult); } -function finishedLoading(bufferList) { - // Create two sources and play them at the same time. - var source1 = context.createBufferSource(); - var source2 = context.createBufferSource(); - source1.buffer = bufferList[0]; - source2.buffer = bufferList[1]; - - source1.connect(context.destination); - source2.connect(context.destination); - source1.start(0); - source2.start(0); - - context.oncomplete = finishAudioTest; - context.startRendering(); -} +function verifyResult(renderedBuffer) { + // Test only works if we have a stereo result. + should( + renderedBuffer.numberOfChannels, 'Number of channels in rendered output') + .beEqualTo(2); + // Note: the source lengths may not match the context length. Create copies + // of the sources truncated or zero-filled to the rendering length. + + let stereoSource = new AudioBuffer({ + length: renderedBuffer.length, + numberOfChannels: 2, + sampleRate: context.sampleRate + }); + stereoSource.copyToChannel(bufferList[0].getChannelData(0), 0); + stereoSource.copyToChannel(bufferList[0].getChannelData(1), 1); + + let monoSource = new AudioBuffer({ + length: renderedBuffer.length, + numberOfChannels: 1, + sampleRate: context.sampleRate + }); + monoSource.copyToChannel(bufferList[1].getChannelData(0), 0); + + // Compute the expected result buffer0 is stereo and buffer1 is mono. The + // result should be stereo, with the mono source implicitly upmixed to + // stereo to produce the expected result. + let expectedBuffer = new AudioBuffer({ + length: renderedBuffer.length, + numberOfChannels: 2, + sampleRate: context.sampleRate + }); + + let monoData = monoSource.getChannelData(0); + for (let c = 0; c < expectedBuffer.numberOfChannels; ++c) { + let expectedData = expectedBuffer.getChannelData(c); + let stereoData = stereoSource.getChannelData(c); + for (let k = 0; k < expectedBuffer.length; ++k) { + expectedData[k] = stereoData[k] + monoData[k]; + } + } + + // Compare the rendered data with the expected data for each channel. + for (let k = 0; k < renderedBuffer.numberOfChannels; ++k) { + let actualData = renderedBuffer.getChannelData(k); + let expectedData = expectedBuffer.getChannelData(k); + let threshold = testThresholds[k]; + let snr = 10 * Math.log10(computeSNR(actualData, expectedData)); + + should(snr, 'SNR for channel ' + k) + .beGreaterThanOrEqualTo(threshold.snrThreshold); + should(actualData, 'Rendered audio').beCloseToArray(expectedData, { + absoluteThreshold: threshold.errorThreshold + }); + } +} </script> </body>
diff --git a/third_party/WebKit/LayoutTests/webaudio/test-basic.html b/third_party/WebKit/LayoutTests/webaudio/test-basic.html index 6bc29bef..878bcd4 100644 --- a/third_party/WebKit/LayoutTests/webaudio/test-basic.html +++ b/third_party/WebKit/LayoutTests/webaudio/test-basic.html
@@ -8,50 +8,58 @@ <html> <head> -<script src="../resources/js-test.js"></script> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> <script src="resources/audit-util.js"></script> -<script src="resources/audio-testing.js"></script> +<script src="resources/audit.js"></script> </head> <body> - -<div id="description"></div> -<div id="console"></div> - <script> -description("Tests basic audio test infrastructure: specifically testRunner.setAudioData()"); +let audit = Audit.createTaskRunner(); -var sampleRate = 44100.0; -var lengthInSeconds = 2; +let sampleRate = 44100.0; +let lengthInSeconds = 2; function generateSinWave(audioBuffer) { - var n = audioBuffer.length; - var channelL = audioBuffer.getChannelData(0); - var channelR = audioBuffer.getChannelData(1); - var sampleRate = audioBuffer.sampleRate; - - for (var i = 0; i < n; ++i) { - channelL[i] = Math.sin(880.0 * 2.0*Math.PI * i / sampleRate); - channelR[i] = Math.sin(440.0 * 2.0*Math.PI * i / sampleRate); - } + let n = audioBuffer.length; + let channelL = audioBuffer.getChannelData(0); + let channelR = audioBuffer.getChannelData(1); + let sampleRate = audioBuffer.sampleRate; + + for (let i = 0; i < n; ++i) { + channelL[i] = Math.sin(880.0 * 2.0 * Math.PI * i / sampleRate); + channelR[i] = Math.sin(440.0 * 2.0 * Math.PI * i / sampleRate); + } } -function runTest() { - if (!window.testRunner) +audit.define( + { + label: 'test', + description: + 'Basic audio test infrastructure: testRunner.setAudioData()' + }, + (task, should) => { + if (!window.testRunner) { + should(!window.testRunner, 'window.testRunner is defined').beTrue(); + task.done(); return; - - var context = new AudioContext(); - var audioBuffer = context.createBuffer(2, lengthInSeconds * sampleRate, sampleRate); - - generateSinWave(audioBuffer); + } - var audioData = createAudioData(audioBuffer); - testRunner.setAudioData(audioData); + let context = new AudioContext(); + let audioBuffer = + context.createBuffer(2, lengthInSeconds * sampleRate, sampleRate); - testRunner.notifyDone(); -} + generateSinWave(audioBuffer); -runTest(); + let audioData = createAudioData(audioBuffer); + testRunner.setAudioData(audioData); + + testRunner.notifyDone(); + task.done(); + }); + +audit.run(); </script>
diff --git a/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp index 0720f8d..088ceb751 100644 --- a/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp
@@ -37,11 +37,9 @@ #include "bindings/core/v8/ToV8.h" #include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8DOMActivityLogger.h" -#include "bindings/core/v8/V8GCForContextDispose.h" #include "bindings/core/v8/V8HTMLDocument.h" #include "bindings/core/v8/V8HiddenValue.h" #include "bindings/core/v8/V8Initializer.h" -#include "bindings/core/v8/V8PagePopupControllerBinding.h" #include "bindings/core/v8/V8PrivateProperty.h" #include "bindings/core/v8/V8Window.h" #include "core/dom/Modulator.h" @@ -59,7 +57,6 @@ #include "platform/heap/Handle.h" #include "platform/instrumentation/tracing/TraceEvent.h" #include "platform/weborigin/SecurityOrigin.h" -#include "v8/include/v8.h" #include "wtf/Assertions.h" namespace blink { @@ -77,36 +74,7 @@ m_world->worldId()); MainThreadDebugger::instance()->contextWillBeDestroyed(m_scriptState.get()); - if (behavior == DetachGlobal) { - v8::Local<v8::Context> context = m_scriptState->context(); - // Clean up state on the global proxy, which will be reused. - if (!m_globalProxy.isEmpty()) { - // TODO(yukishiino): This DCHECK failed on Canary (M57) and Dev (M56). - // We need to figure out why m_globalProxy != context->Global(). - DCHECK(m_globalProxy == context->Global()); - DCHECK_EQ(toScriptWrappable(context->Global()), - toScriptWrappable( - context->Global()->GetPrototype().As<v8::Object>())); - m_globalProxy.get().SetWrapperClassId(0); - } - V8DOMWrapper::clearNativeInfo(isolate(), context->Global()); - m_scriptState->detachGlobalObject(); - -#if DCHECK_IS_ON() - didDetachGlobalProxy(); -#endif - } - - m_scriptState->disposePerContextData(); - - // It's likely that disposing the context has created a lot of - // garbage. Notify V8 about this so it'll have a chance of cleaning - // it up when idle. - V8GCForContextDispose::instance().notifyContextDisposed( - frame()->isMainFrame()); - - DCHECK(m_lifecycle == Lifecycle::ContextInitialized); - m_lifecycle = Lifecycle::ContextDetached; + WindowProxy::disposeContext(behavior); } void LocalWindowProxy::initialize() { @@ -162,54 +130,12 @@ frame()->loader().dispatchDidClearWindowObjectInMainWorld(); } -void LocalWindowProxy::setupWindowPrototypeChain() { - // Associate the window wrapper object and its prototype chain with the - // corresponding native DOMWindow object. - LocalDOMWindow* window = frame()->domWindow(); - const WrapperTypeInfo* wrapperTypeInfo = window->wrapperTypeInfo(); - v8::Local<v8::Context> context = m_scriptState->context(); - - // The global proxy object. Note this is not the global object. - v8::Local<v8::Object> globalProxy = context->Global(); - CHECK(m_globalProxy == globalProxy); - V8DOMWrapper::setNativeInfo(isolate(), globalProxy, wrapperTypeInfo, window); - // Mark the handle to be traced by Oilpan, since the global proxy has a - // reference to the DOMWindow. - m_globalProxy.get().SetWrapperClassId(wrapperTypeInfo->wrapperClassId); - -#if DCHECK_IS_ON() - didAttachGlobalProxy(); -#endif - - // The global object, aka window wrapper object. - v8::Local<v8::Object> windowWrapper = - globalProxy->GetPrototype().As<v8::Object>(); - V8DOMWrapper::setNativeInfo(isolate(), windowWrapper, wrapperTypeInfo, - window); - - // The prototype object of Window interface. - v8::Local<v8::Object> windowPrototype = - windowWrapper->GetPrototype().As<v8::Object>(); - CHECK(!windowPrototype.IsEmpty()); - V8DOMWrapper::setNativeInfo(isolate(), windowPrototype, wrapperTypeInfo, - window); - - // The named properties object of Window interface. - v8::Local<v8::Object> windowProperties = - windowPrototype->GetPrototype().As<v8::Object>(); - CHECK(!windowProperties.IsEmpty()); - V8DOMWrapper::setNativeInfo(isolate(), windowProperties, wrapperTypeInfo, - window); - - // TODO(keishi): Remove installPagePopupController and implement - // PagePopupController in another way. - V8PagePopupControllerBinding::installPagePopupController(context, - windowWrapper); -} - void LocalWindowProxy::createContext() { // Create a new v8::Context with the window object as the global object - // (aka the inner global). Reuse the outer global proxy if it already exists. + // (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(isolate(), *m_world)->InstanceTemplate(); CHECK(!globalTemplate.IsEmpty());
diff --git a/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.h b/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.h index a171b73..e92aea2 100644 --- a/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.h +++ b/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.h
@@ -62,11 +62,6 @@ // (e.g., after setting docoument.domain). void updateSecurityOrigin(SecurityOrigin*); - ScriptState* getScriptState() const { return m_scriptState.get(); } - v8::Local<v8::Context> contextIfInitialized() const { - return m_scriptState ? m_scriptState->context() : v8::Local<v8::Context>(); - } - private: LocalWindowProxy(v8::Isolate*, LocalFrame&, RefPtr<DOMWrapperWorld>); @@ -79,10 +74,6 @@ // wrapper is not yet associated with the native DOMWindow object. void createContext(); - // Associates the window wrapper and its prototype chain with the native - // DOMWindow object. Also does some more Window-specific initialization. - void setupWindowPrototypeChain(); - void setSecurityToken(SecurityOrigin*); // The JavaScript wrapper for the document object is cached on the global @@ -94,8 +85,6 @@ void updateActivityLogger(); LocalFrame* frame() const { return toLocalFrame(WindowProxy::frame()); } - - RefPtr<ScriptState> m_scriptState; }; } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp index fe75242a..fa80475 100644 --- a/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp
@@ -28,15 +28,49 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "bindings/core/v8/RemoteWindowProxy.h" +#include "bindings/core/v8/WindowProxy.h" +#include <v8-debug.h> +#include <v8.h> +#include <algorithm> +#include <utility> +#include "bindings/core/v8/ConditionalFeatures.h" #include "bindings/core/v8/DOMWrapperWorld.h" -#include "bindings/core/v8/V8DOMWrapper.h" +#include "bindings/core/v8/ScriptController.h" +#include "bindings/core/v8/ToV8.h" +#include "bindings/core/v8/V8Binding.h" +#include "bindings/core/v8/V8DOMActivityLogger.h" +#include "bindings/core/v8/V8Document.h" +#include "bindings/core/v8/V8GCForContextDispose.h" +#include "bindings/core/v8/V8HTMLCollection.h" +#include "bindings/core/v8/V8HTMLDocument.h" +#include "bindings/core/v8/V8HiddenValue.h" +#include "bindings/core/v8/V8Initializer.h" +#include "bindings/core/v8/V8ObjectConstructor.h" +#include "bindings/core/v8/V8PagePopupControllerBinding.h" +#include "bindings/core/v8/V8PrivateProperty.h" #include "bindings/core/v8/V8Window.h" +#include "core/frame/LocalFrame.h" +#include "core/frame/LocalFrameClient.h" +#include "core/frame/csp/ContentSecurityPolicy.h" +#include "core/html/DocumentNameCollection.h" +#include "core/html/HTMLCollection.h" +#include "core/html/HTMLIFrameElement.h" +#include "core/inspector/InspectorInstrumentation.h" +#include "core/inspector/MainThreadDebugger.h" +#include "core/loader/DocumentLoader.h" +#include "core/loader/FrameLoader.h" +#include "core/origin_trials/OriginTrialContext.h" #include "platform/Histogram.h" +#include "platform/RuntimeEnabledFeatures.h" +#include "platform/ScriptForbiddenScope.h" +#include "platform/heap/Handle.h" #include "platform/instrumentation/tracing/TraceEvent.h" -#include "v8/include/v8.h" +#include "platform/weborigin/SecurityOrigin.h" +#include "public/platform/Platform.h" #include "wtf/Assertions.h" +#include "wtf/StringExtras.h" +#include "wtf/text/CString.h" namespace blink { @@ -49,16 +83,7 @@ if (m_lifecycle != Lifecycle::ContextInitialized) return; - if (behavior == DetachGlobal && !m_globalProxy.isEmpty()) { - m_globalProxy.get().SetWrapperClassId(0); - V8DOMWrapper::clearNativeInfo(isolate(), m_globalProxy.newLocal(isolate())); -#if DCHECK_IS_ON() - didDetachGlobalProxy(); -#endif - } - - DCHECK_EQ(Lifecycle::ContextInitialized, m_lifecycle); - m_lifecycle = Lifecycle::ContextDetached; + WindowProxy::disposeContext(behavior); } void RemoteWindowProxy::initialize() { @@ -68,11 +93,23 @@ frame()->isMainFrame() ? "Blink.Binding.InitializeMainWindowProxy" : "Blink.Binding.InitializeNonMainWindowProxy"); + ScriptForbiddenScope::AllowUserAgentScript allowScript; + v8::HandleScope handleScope(isolate()); createContext(); + ScriptState::Scope scope(m_scriptState.get()); + v8::Local<v8::Context> context = m_scriptState->context(); + if (m_globalProxy.isEmpty()) { + m_globalProxy.set(isolate(), context->Global()); + CHECK(!m_globalProxy.isEmpty()); + } + setupWindowPrototypeChain(); + + // Remote frames always require a full canAccess() check. + context->UseDefaultSecurityToken(); } void RemoteWindowProxy::createContext() { @@ -85,41 +122,22 @@ V8Window::domTemplate(isolate(), *m_world)->InstanceTemplate(); CHECK(!globalTemplate.IsEmpty()); - v8::Local<v8::Object> globalProxy = - v8::Context::NewRemoteContext(isolate(), globalTemplate, - m_globalProxy.newLocal(isolate())) - .ToLocalChecked(); - if (m_globalProxy.isEmpty()) - m_globalProxy.set(isolate(), globalProxy); - else - DCHECK(m_globalProxy.get() == globalProxy); - CHECK(!m_globalProxy.isEmpty()); + v8::Local<v8::Context> context; + { + V8PerIsolateData::UseCounterDisabledScope useCounterDisabled( + V8PerIsolateData::from(isolate())); + context = v8::Context::New(isolate(), nullptr, globalTemplate, + m_globalProxy.newLocal(isolate())); + } + CHECK(!context.IsEmpty()); + + m_scriptState = ScriptState::create(context, m_world); // TODO(haraken): Currently we cannot enable the following DCHECK because // an already detached window proxy can be re-initialized. This is wrong. // DCHECK(m_lifecycle == Lifecycle::ContextUninitialized); m_lifecycle = Lifecycle::ContextInitialized; -} - -void RemoteWindowProxy::setupWindowPrototypeChain() { - DOMWindow* window = frame()->domWindow(); - const WrapperTypeInfo* wrapperTypeInfo = window->wrapperTypeInfo(); - // The global proxy object. Note this is not the global object. - v8::Local<v8::Object> globalProxy = m_globalProxy.newLocal(isolate()); - V8DOMWrapper::setNativeInfo(isolate(), globalProxy, wrapperTypeInfo, window); - // Mark the handle to be traced by Oilpan, since the global proxy has a - // reference to the DOMWindow. - m_globalProxy.get().SetWrapperClassId(wrapperTypeInfo->wrapperClassId); - -#if DCHECK_IS_ON() - didAttachGlobalProxy(); -#endif - - // The global object, aka window wrapper object. - v8::Local<v8::Object> windowWrapper = - globalProxy->GetPrototype().As<v8::Object>(); - V8DOMWrapper::setNativeInfo(isolate(), windowWrapper, wrapperTypeInfo, - window); + DCHECK(m_scriptState->contextIsValid()); } } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.h b/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.h index ad85a74..d85780f 100644 --- a/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.h +++ b/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.h
@@ -31,10 +31,9 @@ #ifndef RemoteWindowProxy_h #define RemoteWindowProxy_h -#include <v8.h> #include "bindings/core/v8/DOMWrapperWorld.h" -#include "bindings/core/v8/WindowProxy.h" #include "core/frame/RemoteFrame.h" +#include <v8.h> namespace blink { @@ -43,6 +42,7 @@ public: static RemoteWindowProxy* create(v8::Isolate* isolate, RemoteFrame& frame, + RefPtr<DOMWrapperWorld> world) { return new RemoteWindowProxy(isolate, frame, std::move(world)); } @@ -58,8 +58,6 @@ // prototype chain do not get fully initialized yet, e.g. the window // wrapper is not yet associated with the native DOMWindow object. void createContext(); - - void setupWindowPrototypeChain(); }; } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp index 561d28e3..4dcdb81 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp
@@ -36,7 +36,8 @@ : m_isolate(context->GetIsolate()), m_context(m_isolate, context), m_world(world), - m_perContextData(V8PerContextData::create(context)) { + m_perContextData(V8PerContextData::create(context)) +{ DCHECK(m_world); m_context.setWeak(this, &contextCollectedCallback); context->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, this); @@ -50,6 +51,9 @@ void ScriptState::detachGlobalObject() { ASSERT(!m_context.isEmpty()); context()->DetachGlobal(); +#if DCHECK_IS_ON() + m_globalObjectDetached = true; +#endif } void ScriptState::disposePerContextData() {
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptState.h b/third_party/WebKit/Source/bindings/core/v8/ScriptState.h index e3fe7dd6..4d8d0feb 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptState.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptState.h
@@ -155,6 +155,9 @@ } void detachGlobalObject(); void clearContext() { return m_context.clear(); } +#if DCHECK_IS_ON() + bool isGlobalObjectDetached() const { return m_globalObjectDetached; } +#endif V8PerContextData* perContextData() const { return m_perContextData.get(); } void disposePerContextData(); @@ -180,6 +183,10 @@ // disposePerContextData() once you no longer need V8PerContextData. // Otherwise, the v8::Context will leak. std::unique_ptr<V8PerContextData> m_perContextData; + +#if DCHECK_IS_ON() + bool m_globalObjectDetached = false; +#endif }; // ScriptStateProtectingContext keeps the context associated with the
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp index 0ccf6f2..5cd2bab1 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
@@ -811,7 +811,7 @@ return v8::Local<v8::Context>(); } -v8::Local<v8::Context> toV8Context(LocalFrame* frame, DOMWrapperWorld& world) { +v8::Local<v8::Context> toV8Context(Frame* frame, DOMWrapperWorld& world) { if (!frame) return v8::Local<v8::Context>(); v8::Local<v8::Context> context = toV8ContextEvenIfDetached(frame, world); @@ -825,10 +825,10 @@ return v8::Local<v8::Context>(); } -v8::Local<v8::Context> toV8ContextEvenIfDetached(LocalFrame* frame, +v8::Local<v8::Context> toV8ContextEvenIfDetached(Frame* frame, DOMWrapperWorld& world) { ASSERT(frame); - return frame->script().windowProxy(world)->contextIfInitialized(); + return frame->windowProxy(world)->contextIfInitialized(); } bool isValidEnum(const String& value,
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h index 58a6019..0f345139 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h
@@ -984,10 +984,10 @@ DOMWrapperWorld&); // Returns a V8 context associated with a Frame and a DOMWrapperWorld. // This method returns an empty context if the frame is already detached. -CORE_EXPORT v8::Local<v8::Context> toV8Context(LocalFrame*, DOMWrapperWorld&); +CORE_EXPORT v8::Local<v8::Context> toV8Context(Frame*, DOMWrapperWorld&); // Like toV8Context but also returns the context if the frame is already // detached. -CORE_EXPORT v8::Local<v8::Context> toV8ContextEvenIfDetached(LocalFrame*, +CORE_EXPORT v8::Local<v8::Context> toV8ContextEvenIfDetached(Frame*, DOMWrapperWorld&); // Returns the frame object of the window object associated with
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp index 562b977c..b750f26 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
@@ -30,7 +30,11 @@ #include "bindings/core/v8/WindowProxy.h" +#include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8DOMWrapper.h" +#include "bindings/core/v8/V8GCForContextDispose.h" +#include "bindings/core/v8/V8PagePopupControllerBinding.h" +#include "core/frame/DOMWindow.h" #include "core/frame/Frame.h" #include "wtf/Assertions.h" #include <utility> @@ -57,6 +61,37 @@ m_world(std::move(world)), m_lifecycle(Lifecycle::ContextUninitialized) {} +void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior) { + DCHECK(m_lifecycle == Lifecycle::ContextInitialized); + + if (behavior == DetachGlobal) { + v8::Local<v8::Context> context = m_scriptState->context(); + // Clean up state on the global proxy, which will be reused. + if (!m_globalProxy.isEmpty()) { + // TODO(yukishiino): This DCHECK failed on Canary (M57) and Dev (M56). + // We need to figure out why m_globalProxy != context->Global(). + DCHECK(m_globalProxy == context->Global()); + DCHECK_EQ(toScriptWrappable(context->Global()), + toScriptWrappable( + context->Global()->GetPrototype().As<v8::Object>())); + m_globalProxy.get().SetWrapperClassId(0); + } + V8DOMWrapper::clearNativeInfo(m_isolate, context->Global()); + m_scriptState->detachGlobalObject(); + } + + m_scriptState->disposePerContextData(); + + // It's likely that disposing the context has created a lot of + // garbage. Notify V8 about this so it'll have a chance of cleaning + // it up when idle. + V8GCForContextDispose::instance().notifyContextDisposed( + m_frame->isMainFrame()); + + DCHECK(m_lifecycle == Lifecycle::ContextInitialized); + m_lifecycle = Lifecycle::ContextDetached; +} + void WindowProxy::clearForClose() { disposeContext(DoNotDetachGlobal); } @@ -66,15 +101,20 @@ } v8::Local<v8::Object> WindowProxy::globalIfNotDetached() { - if (m_lifecycle == Lifecycle::ContextInitialized) + if (m_lifecycle == Lifecycle::ContextInitialized) { + DCHECK(m_scriptState->contextIsValid()); + DCHECK(m_globalProxy == m_scriptState->context()->Global()); return m_globalProxy.newLocal(m_isolate); + } return v8::Local<v8::Object>(); } v8::Local<v8::Object> WindowProxy::releaseGlobal() { DCHECK(m_lifecycle != Lifecycle::ContextInitialized); - DLOG_IF(FATAL, m_isGlobalProxyAttached) - << "Context not detached by calling clearForNavigation()"; + // Make sure the global object was detached from the proxy by calling + // clearForNavigation(). + if (m_lifecycle == Lifecycle::ContextDetached) + ASSERT(m_scriptState->isGlobalObjectDetached()); v8::Local<v8::Object> global = m_globalProxy.newLocal(m_isolate); m_globalProxy.clear(); @@ -136,4 +176,71 @@ } } +void WindowProxy::setupWindowPrototypeChain() { + // 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: + // + // global proxy object [1] + // -- has prototype --> global object (window wrapper object) [2] + // -- has prototype --> Window.prototype + // -- has prototype --> WindowProperties [3] + // -- has prototype --> EventTarget.prototype + // -- has prototype --> Object.prototype + // -- has prototype --> null + // + // [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(); + + // The global proxy object. Note this is not the global object. + v8::Local<v8::Object> globalProxy = context->Global(); + CHECK(m_globalProxy == globalProxy); + V8DOMWrapper::setNativeInfo(m_isolate, globalProxy, wrapperTypeInfo, window); + // Mark the handle to be traced by Oilpan, since the global proxy has a + // reference to the DOMWindow. + m_globalProxy.get().SetWrapperClassId(wrapperTypeInfo->wrapperClassId); + + // 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>(); + CHECK(!windowPrototype.IsEmpty()); + V8DOMWrapper::setNativeInfo(m_isolate, windowPrototype, wrapperTypeInfo, + window); + + // The named properties object of Window interface. + v8::Local<v8::Object> windowProperties = + windowPrototype->GetPrototype().As<v8::Object>(); + CHECK(!windowProperties.IsEmpty()); + V8DOMWrapper::setNativeInfo(m_isolate, windowProperties, wrapperTypeInfo, + window); + + // TODO(keishi): Remove installPagePopupController and implement + // PagePopupController in another way. + V8PagePopupControllerBinding::installPagePopupController(context, + windowWrapper); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h index 294d7eb..9089f01 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.h
@@ -31,125 +31,35 @@ #ifndef WindowProxy_h #define WindowProxy_h -#include <v8.h> #include "bindings/core/v8/DOMWrapperWorld.h" #include "bindings/core/v8/ScopedPersistent.h" -#include "core/CoreExport.h" +#include "bindings/core/v8/ScriptState.h" #include "platform/heap/Handle.h" #include "wtf/RefPtr.h" +#include <v8.h> namespace blink { class Frame; +class ScriptController; -// WindowProxy implements the split window model of a window for a frame. In the -// HTML standard, the split window model is composed of the Window interface -// (the inner global object) and the WindowProxy interface (the outer global -// proxy). -// -// The Window interface is backed by the Blink DOMWindow C++ implementation. -// In contrast, the WindowProxy interface does not have a corresponding -// C++ implementation in Blink: the WindowProxy class defined here only manages -// context initialization and detach. Instead, the behavior of the WindowProxy -// interface is defined by JSGlobalProxy in v8 and the prototype chain set up -// during context initialization. -// -// ====== Inner Global Object ====== -// The inner global object is the global for the script environment of a Frame. -// Since Window and Document also have a 1:1 relationship, this means that each -// inner global object has an associated Document which does not change. On -// navigation, the new Document receives a new inner global object. -// -// However, there is one exception to the 1:1 DOMWindow:Document rule. If: -// - the previous Document is the initial empty document -// - the new Document is same-origin to the previous Document -// then the inner global object will be reused for the new Document. This is the -// only case where the associated Document of an inner global object can change. -// -// All methods and attributes defined on the Window interface are exposed via -// the inner global object. Global variables defined by script running in the -// Document also live on the inner global object. -// -// ====== Outer Global Proxy ==== -// The outer global proxy is reused across navigations. It implements the -// security checks for same-origin/cross-origin access to the Window interface. -// When the check passes (i.e. the access is same-origin), the access is -// forwarded to the inner global object of the active Document in this -// WindowProxy's Frame). -// -// When the security check fails, the access is delegated to the outer global -// proxy's cross-origin interceptors. The cross-origin interceptors may choose -// to return a value (if the property is exposed cross-origin) or throw an -// exception otherwise. -// -// Note that the cross-origin interceptors are only used for cross-origin -// accesses: a same-origin access to a method that is available cross-origin, -// such as Window.postMessage, will be delegated to the inner global object. -// -// ====== LocalWindowProxy vs RemoteWindowProxy ====== -// WindowProxy has two concrete subclasses: -// - LocalWindowProxy: implements the split window model for a frame in the same -// process, i.e. a LocalFrame. -// - RemoteWindowProxy: implements the split window model for a frame in a -// different process, i.e. a RemoteFrame. -// -// While having a RemoteFrame implies the frame must be cross-origin, the -// opposite is not true: a LocalFrame can be same-origin or cross-origin. One -// additional complexity (which slightly violates the HTML standard): it is -// possible to have SecurityOrigin::canAccess() return true for a RemoteFrame's -// security origin; however, it is important to still deny access as if the -// frame were cross-origin. This is due to complexities in the process -// allocation model for renderer processes. See https://crbug.com/601629. -// -// ====== LocalWindowProxy ====== -// Since a LocalWindowProxy can represent a same-origin or cross-origin frame, -// the entire prototype chain must be available: -// -// outer global proxy -// -- has prototype --> inner global object -// -- has prototype --> Window.prototype -// -- has prototype --> WindowProperties [1] -// -- has prototype --> EventTarget.prototype -// -- has prototype --> Object.prototype -// -- has prototype --> null -// -// [1] WindowProperties is the named properties object of the Window interface. -// -// ====== RemoteWindowProxy ====== -// Since a RemoteWindowProxy only represents a cross-origin frame, it has a much -// simpler prototype chain. -// -// outer global proxy -// -- has prototype --> inner global object -// -- has prototype --> null -// -// Property access to get/set attributes and methods on the outer global proxy -// are redirected through the cross-origin interceptors, since any access will -// fail the security check, by definition. -// -// However, note that method invocations still use the inner global object as -// the receiver object. Blink bindings use v8::Signature to perform a strict -// receiver check, which requires that the FunctionTemplate used to instantiate -// the receiver object matches exactly. However, when creating a new context, -// only inner global object is instantiated using Blink's global template, so by -// definition, it is the only receiver object in the prototype chain that will -// match. -// -// ====== References ====== -// https://wiki.mozilla.org/Gecko:SplitWindow -// https://whatwg.org/C/browsers.html#the-windowproxy-exotic-object +// WindowProxy represents all the per-global object state for a Frame that +// persist between navigations. class WindowProxy : public GarbageCollectedFinalized<WindowProxy> { public: virtual ~WindowProxy(); DECLARE_TRACE(); + v8::Local<v8::Context> contextIfInitialized() const { + return m_scriptState ? m_scriptState->context() : v8::Local<v8::Context>(); + } void initializeIfNeeded(); void clearForClose(); void clearForNavigation(); - CORE_EXPORT v8::Local<v8::Object> globalIfNotDetached(); + v8::Local<v8::Object> globalIfNotDetached(); v8::Local<v8::Object> releaseGlobal(); void setGlobal(v8::Local<v8::Object>); @@ -158,6 +68,10 @@ DOMWrapperWorld& world() { return *m_world; } protected: + // TODO(dcheng): Remove this friend declaration once LocalWindowProxyManager + // and ScriptController are merged. + friend class ScriptController; + // A valid transition is from ContextUninitialized to ContextInitialized, // and then ContextDetached. Other transitions are forbidden. enum class Lifecycle { @@ -171,24 +85,24 @@ virtual void initialize() = 0; enum GlobalDetachmentBehavior { DoNotDetachGlobal, DetachGlobal }; - virtual void disposeContext(GlobalDetachmentBehavior) = 0; + virtual void disposeContext(GlobalDetachmentBehavior); + + // Associates the window wrapper and its prototype chain with the native + // DOMWindow object. Also does some more Window-specific initialization. + void setupWindowPrototypeChain(); v8::Isolate* isolate() const { return m_isolate; } Frame* frame() const { return m_frame.get(); } - -#if DCHECK_IS_ON() - void didAttachGlobalProxy() { m_isGlobalProxyAttached = true; } - void didDetachGlobalProxy() { m_isGlobalProxyAttached = false; } -#endif + ScriptState* getScriptState() const { return m_scriptState.get(); } private: v8::Isolate* const m_isolate; const Member<Frame> m_frame; -#if DCHECK_IS_ON() - bool m_isGlobalProxyAttached = false; -#endif protected: + // TODO(dcheng): Move this to LocalWindowProxy once RemoteWindowProxy uses + // remote contexts. + RefPtr<ScriptState> m_scriptState; // TODO(dcheng): Consider making these private and using getters. const RefPtr<DOMWrapperWorld> m_world; ScopedPersistent<v8::Object> m_globalProxy;
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.h b/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.h index 44adedc..a70c384d 100644 --- a/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.h +++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxyManager.h
@@ -54,9 +54,10 @@ template <typename FrameType, typename ProxyType> class WindowProxyManagerImplHelper : public WindowProxyManagerBase { - protected: + private: using Base = WindowProxyManagerBase; + public: FrameType* frame() const { return static_cast<FrameType*>(Base::frame()); } ProxyType* mainWorldProxy() const { return static_cast<ProxyType*>(Base::mainWorldProxy()); @@ -65,6 +66,7 @@ return static_cast<ProxyType*>(Base::windowProxy(world)); } + protected: explicit WindowProxyManagerImplHelper(Frame& frame) : WindowProxyManagerBase(frame) {} }; @@ -96,10 +98,6 @@ } private: - // TODO(dcheng): Ideally, remove this friend declaration once WindowProxy - // initialization details are better encapsulated. - friend class RemoteFrame; - explicit RemoteWindowProxyManager(RemoteFrame& frame) : WindowProxyManagerImplHelper<RemoteFrame, RemoteWindowProxy>(frame) {} };
diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl index 004c060..266b360b 100644 --- a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
@@ -78,8 +78,7 @@ } {% endif %} - {% set log_activity = world_suffix in method.activity_logging_world_list %} - {% if 'scriptState' in function_call or log_activity %} + {% if 'scriptState' in function_call %} {% if method.is_static %} ScriptState* scriptState = ScriptState::forFunctionObject(info); {% else %} @@ -87,15 +86,6 @@ {% endif %} {% endif %} - {% if log_activity %} - V8PerContextData* contextData = scriptState->perContextData(); - if (contextData && contextData->activityLogger()) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "{{interface_name}}", "{{method.name}}"); - Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); - contextData->activityLogger()->logMethod("{{interface_name}}.{{method.name}}", info.Length(), loggerArgs.data()); - } - {% endif %} - {% if method.is_custom_element_callbacks %} V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; {% endif %} @@ -521,6 +511,19 @@ Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}}); {% endif %} {% endif %}{# not method.overloads #} + {% if world_suffix in method.activity_logging_world_list %} + {% if method.is_static %} + ScriptState* scriptState = ScriptState::forFunctionObject(info); + {% else %} + ScriptState* scriptState = ScriptState::forReceiverObject(info); + {% endif %} + V8PerContextData* contextData = scriptState->perContextData(); + if (contextData && contextData->activityLogger()) { + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "{{interface_name}}", "{{method.name}}"); + Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); + contextData->activityLogger()->logMethod("{{interface_name}}.{{method.name}}", info.Length(), loggerArgs.data()); + } + {% endif %} {% if method.is_ce_reactions %} CEReactionsScope ceReactionsScope; {% endif %}
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 c538e35..ed61d657 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -7050,15 +7050,6 @@ static void activityLoggingAccessForAllWorldsMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::toImpl(info.Holder()); - ScriptState* scriptState = ScriptState::forReceiverObject(info); - - V8PerContextData* contextData = scriptState->perContextData(); - if (contextData && contextData->activityLogger()) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "activityLoggingAccessForAllWorldsMethod"); - Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); - contextData->activityLogger()->logMethod("TestObject.activityLoggingAccessForAllWorldsMethod", info.Length(), loggerArgs.data()); - } - impl->activityLoggingAccessForAllWorldsMethod(); } @@ -7713,45 +7704,18 @@ static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::toImpl(info.Holder()); - ScriptState* scriptState = ScriptState::forReceiverObject(info); - - V8PerContextData* contextData = scriptState->perContextData(); - if (contextData && contextData->activityLogger()) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "activityLoggingForAllWorldsPerWorldBindingsVoidMethod"); - Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); - contextData->activityLogger()->logMethod("TestObject.activityLoggingForAllWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); - } - impl->activityLoggingForAllWorldsPerWorldBindingsVoidMethod(); } static void activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::toImpl(info.Holder()); - ScriptState* scriptState = ScriptState::forReceiverObject(info); - - V8PerContextData* contextData = scriptState->perContextData(); - if (contextData && contextData->activityLogger()) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "activityLoggingForAllWorldsPerWorldBindingsVoidMethod"); - Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); - contextData->activityLogger()->logMethod("TestObject.activityLoggingForAllWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); - } - impl->activityLoggingForAllWorldsPerWorldBindingsVoidMethod(); } static void activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* impl = V8TestObject::toImpl(info.Holder()); - ScriptState* scriptState = ScriptState::forReceiverObject(info); - - V8PerContextData* contextData = scriptState->perContextData(); - if (contextData && contextData->activityLogger()) { - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod"); - Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); - contextData->activityLogger()->logMethod("TestObject.activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); - } - impl->activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod(); } @@ -10872,6 +10836,13 @@ } void V8TestObject::activityLoggingAccessForAllWorldsMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + ScriptState* scriptState = ScriptState::forReceiverObject(info); + V8PerContextData* contextData = scriptState->perContextData(); + if (contextData && contextData->activityLogger()) { + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "activityLoggingAccessForAllWorldsMethod"); + Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); + contextData->activityLogger()->logMethod("TestObject.activityLoggingAccessForAllWorldsMethod", info.Length(), loggerArgs.data()); + } TestObjectV8Internal::activityLoggingAccessForAllWorldsMethodMethod(info); } @@ -11015,14 +10986,35 @@ } void V8TestObject::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + ScriptState* scriptState = ScriptState::forReceiverObject(info); + V8PerContextData* contextData = scriptState->perContextData(); + if (contextData && contextData->activityLogger()) { + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "activityLoggingForAllWorldsPerWorldBindingsVoidMethod"); + Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); + contextData->activityLogger()->logMethod("TestObject.activityLoggingForAllWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); + } TestObjectV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethod(info); } void V8TestObject::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info) { + ScriptState* scriptState = ScriptState::forReceiverObject(info); + V8PerContextData* contextData = scriptState->perContextData(); + if (contextData && contextData->activityLogger()) { + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "activityLoggingForAllWorldsPerWorldBindingsVoidMethod"); + Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); + contextData->activityLogger()->logMethod("TestObject.activityLoggingForAllWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); + } TestObjectV8Internal::activityLoggingForAllWorldsPerWorldBindingsVoidMethodMethodForMainWorld(info); } void V8TestObject::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + ScriptState* scriptState = ScriptState::forReceiverObject(info); + V8PerContextData* contextData = scriptState->perContextData(); + if (contextData && contextData->activityLogger()) { + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod"); + Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); + contextData->activityLogger()->logMethod("TestObject.activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethod", info.Length(), loggerArgs.data()); + } TestObjectV8Internal::activityLoggingForIsolatedWorldsPerWorldBindingsVoidMethodMethod(info); }
diff --git a/third_party/WebKit/Source/core/dom/StaticRange.cpp b/third_party/WebKit/Source/core/dom/StaticRange.cpp index 3bb08a3..c763d18 100644 --- a/third_party/WebKit/Source/core/dom/StaticRange.cpp +++ b/third_party/WebKit/Source/core/dom/StaticRange.cpp
@@ -15,9 +15,9 @@ StaticRange::StaticRange(Document& document) : m_ownerDocument(document), - m_startContainer(nullptr), + m_startContainer(document), m_startOffset(0), - m_endContainer(nullptr), + m_endContainer(document), m_endOffset(0) {} StaticRange::StaticRange(Document& document,
diff --git a/third_party/WebKit/Source/core/dom/StaticRange.h b/third_party/WebKit/Source/core/dom/StaticRange.h index 880bb91..551efd9 100644 --- a/third_party/WebKit/Source/core/dom/StaticRange.h +++ b/third_party/WebKit/Source/core/dom/StaticRange.h
@@ -9,13 +9,13 @@ #include "bindings/core/v8/ScriptWrappable.h" #include "core/CoreExport.h" +#include "core/dom/Range.h" #include "platform/heap/Handle.h" namespace blink { class Document; class ExceptionState; -class Range; class CORE_EXPORT StaticRange final : public GarbageCollected<StaticRange>, public ScriptWrappable { @@ -33,6 +33,11 @@ return new StaticRange(document, startContainer, startOffset, endContainer, endOffset); } + static StaticRange* create(const Range* range) { + return new StaticRange(range->ownerDocument(), range->startContainer(), + range->startOffset(), range->endContainer(), + range->endOffset()); + } Node* startContainer() const { return m_startContainer.get(); } void setStartContainer(Node* startContainer) { @@ -55,7 +60,7 @@ void setStart(Node* container, int offset); void setEnd(Node* container, int offset); - Range* toRange(ExceptionState&) const; + Range* toRange(ExceptionState& = ASSERT_NO_EXCEPTION) const; DECLARE_TRACE();
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp index 8fe6ece..d73063fa 100644 --- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp +++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -2069,14 +2069,15 @@ node->layoutObject()->style()->textSecurity() != TSNONE; } -const RangeVector* targetRangesForInputEvent(const Node& node) { +const StaticRangeVector* targetRangesForInputEvent(const Node& node) { if (!hasRichlyEditableStyle(node)) return nullptr; - return new RangeVector( - 1, firstRangeOf(node.document() - .frame() - ->selection() - .computeVisibleSelectionInDOMTreeDeprecated())); + return new StaticRangeVector( + 1, StaticRange::create( + firstRangeOf(node.document() + .frame() + ->selection() + .computeVisibleSelectionInDOMTreeDeprecated()))); } DispatchEventResult dispatchBeforeInputInsertText(Node* target, @@ -2098,7 +2099,7 @@ DispatchEventResult dispatchBeforeInputEditorCommand( Node* target, InputEvent::InputType inputType, - const RangeVector* ranges) { + const StaticRangeVector* ranges) { if (!RuntimeEnabledFeatures::inputEventEnabled()) return DispatchEventResult::NotCanceled; if (!target)
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.h b/third_party/WebKit/Source/core/editing/EditingUtilities.h index b8bf1cdf..0f84715 100644 --- a/third_party/WebKit/Source/core/editing/EditingUtilities.h +++ b/third_party/WebKit/Source/core/editing/EditingUtilities.h
@@ -415,11 +415,11 @@ // ------------------------------------------------------------------------- // Functions dispatch InputEvent -const RangeVector* targetRangesForInputEvent(const Node&); +const StaticRangeVector* targetRangesForInputEvent(const Node&); DispatchEventResult dispatchBeforeInputInsertText(Node*, const String& data); DispatchEventResult dispatchBeforeInputEditorCommand(Node*, InputEvent::InputType, - const RangeVector*); + const StaticRangeVector*); DispatchEventResult dispatchBeforeInputDataTransfer(Node*, InputEvent::InputType, DataTransfer*);
diff --git a/third_party/WebKit/Source/core/editing/Editor.h b/third_party/WebKit/Source/core/editing/Editor.h index 3d71258..603fccec5c 100644 --- a/third_party/WebKit/Source/core/editing/Editor.h +++ b/third_party/WebKit/Source/core/editing/Editor.h
@@ -168,7 +168,7 @@ // Returns target ranges for the command, currently only supports delete // related commands. Used by InputEvent. - const RangeVector* getTargetRanges() const; + const StaticRangeVector* getTargetRanges() const; const EditorInternalCommand* m_command; EditorCommandSource m_source;
diff --git a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp index 32c09d2..3463cfc 100644 --- a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
@@ -650,9 +650,7 @@ // The selection crosses an Editing boundary. This is a // programmer error in the editing code. Happy debugging! NOTREACHED(); - m_base = PositionTemplate<Strategy>(); - m_extent = PositionTemplate<Strategy>(); - validate(); + *this = VisibleSelectionTemplate<Strategy>(); return; } m_end = previous.deepEquivalent(); @@ -688,9 +686,7 @@ // The selection crosses an Editing boundary. This is a // programmer error in the editing code. Happy debugging! NOTREACHED(); - m_base = PositionTemplate<Strategy>(); - m_extent = PositionTemplate<Strategy>(); - validate(); + *this = VisibleSelectionTemplate<Strategy>(); return; } m_start = next.deepEquivalent();
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp index 4ebc607..a3f78b1f 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -191,7 +191,7 @@ } } -RangeVector* RangesFromCurrentSelectionOrExtendCaret( +StaticRangeVector* RangesFromCurrentSelectionOrExtendCaret( const LocalFrame& frame, SelectionDirection direction, TextGranularity granularity) { @@ -201,11 +201,12 @@ if (selectionModifier.selection().isCaret()) selectionModifier.modify(FrameSelection::AlterationExtend, direction, granularity); - RangeVector* ranges = new RangeVector; + StaticRangeVector* ranges = new StaticRangeVector; // We only supports single selections. if (selectionModifier.selection().isNone()) return ranges; - ranges->push_back(firstRangeOf(selectionModifier.selection())); + ranges->push_back( + StaticRange::create(firstRangeOf(selectionModifier.selection()))); return ranges; } @@ -2720,7 +2721,7 @@ return isSupported() ? static_cast<int>(m_command->commandType) : 0; } -const RangeVector* Editor::Command::getTargetRanges() const { +const StaticRangeVector* Editor::Command::getTargetRanges() const { const Node* target = eventTargetNodeForDocument(m_frame->document()); if (!isSupported() || !m_frame || !target || !hasRichlyEditableStyle(*target)) return nullptr;
diff --git a/third_party/WebKit/Source/core/events/InputEvent.cpp b/third_party/WebKit/Source/core/events/InputEvent.cpp index fec9334..79e69f8e 100644 --- a/third_party/WebKit/Source/core/events/InputEvent.cpp +++ b/third_party/WebKit/Source/core/events/InputEvent.cpp
@@ -93,8 +93,10 @@ m_dataTransfer = initializer.dataTransfer(); if (initializer.hasIsComposing()) m_isComposing = initializer.isComposing(); - if (initializer.hasRanges()) - m_ranges = initializer.ranges(); + if (!initializer.hasTargetRanges()) + return; + for (const auto& range : initializer.targetRanges()) + m_ranges.push_back(range->toRange()); } /* static */ @@ -102,7 +104,7 @@ const String& data, EventCancelable cancelable, EventIsComposing isComposing, - const RangeVector* ranges) { + const StaticRangeVector* ranges) { InputEventInit inputEventInit; inputEventInit.setBubbles(true); @@ -114,7 +116,7 @@ inputEventInit.setData(data); inputEventInit.setIsComposing(isComposing == IsComposing); if (ranges) - inputEventInit.setRanges(*ranges); + inputEventInit.setTargetRanges(*ranges); inputEventInit.setComposed(true); return InputEvent::create(EventTypeNames::beforeinput, inputEventInit); } @@ -124,7 +126,7 @@ DataTransfer* dataTransfer, EventCancelable cancelable, EventIsComposing isComposing, - const RangeVector* ranges) { + const StaticRangeVector* ranges) { InputEventInit inputEventInit; inputEventInit.setBubbles(true); @@ -133,7 +135,7 @@ inputEventInit.setDataTransfer(dataTransfer); inputEventInit.setIsComposing(isComposing == IsComposing); if (ranges) - inputEventInit.setRanges(*ranges); + inputEventInit.setTargetRanges(*ranges); inputEventInit.setComposed(true); return InputEvent::create(EventTypeNames::beforeinput, inputEventInit); } @@ -142,7 +144,7 @@ InputEvent* InputEvent::createInput(InputType inputType, const String& data, EventIsComposing isComposing, - const RangeVector* ranges) { + const StaticRangeVector* ranges) { InputEventInit inputEventInit; inputEventInit.setBubbles(true); @@ -154,7 +156,7 @@ inputEventInit.setData(data); inputEventInit.setIsComposing(isComposing == IsComposing); if (ranges) - inputEventInit.setRanges(*ranges); + inputEventInit.setTargetRanges(*ranges); inputEventInit.setComposed(true); return InputEvent::create(EventTypeNames::input, inputEventInit); } @@ -166,9 +168,7 @@ StaticRangeVector InputEvent::getTargetRanges() const { StaticRangeVector staticRanges; for (const auto& range : m_ranges) - staticRanges.push_back(StaticRange::create( - range->ownerDocument(), range->startContainer(), range->startOffset(), - range->endContainer(), range->endOffset())); + staticRanges.push_back(StaticRange::create(range)); return staticRanges; }
diff --git a/third_party/WebKit/Source/core/events/InputEvent.h b/third_party/WebKit/Source/core/events/InputEvent.h index 5810fe66..e7f79a2 100644 --- a/third_party/WebKit/Source/core/events/InputEvent.h +++ b/third_party/WebKit/Source/core/events/InputEvent.h
@@ -82,16 +82,16 @@ const String& data, EventCancelable, EventIsComposing, - const RangeVector*); + const StaticRangeVector*); static InputEvent* createBeforeInput(InputType, DataTransfer*, EventCancelable, EventIsComposing, - const RangeVector*); + const StaticRangeVector*); static InputEvent* createInput(InputType, const String& data, EventIsComposing, - const RangeVector*); + const StaticRangeVector*); String inputType() const; const String& data() const { return m_data; }
diff --git a/third_party/WebKit/Source/core/events/InputEventInit.idl b/third_party/WebKit/Source/core/events/InputEventInit.idl index 7a6dfea..bdc3631 100644 --- a/third_party/WebKit/Source/core/events/InputEventInit.idl +++ b/third_party/WebKit/Source/core/events/InputEventInit.idl
@@ -11,5 +11,5 @@ DOMString? data; DataTransfer? dataTransfer; boolean isComposing = false; - sequence<Range> ranges = []; + sequence<StaticRange> targetRanges = []; };
diff --git a/third_party/WebKit/Source/core/events/PointerEvent.cpp b/third_party/WebKit/Source/core/events/PointerEvent.cpp index 8b416ad..5b8d152 100644 --- a/third_party/WebKit/Source/core/events/PointerEvent.cpp +++ b/third_party/WebKit/Source/core/events/PointerEvent.cpp
@@ -83,9 +83,6 @@ DispatchEventResult PointerEventDispatchMediator::dispatchEvent( EventDispatcher& dispatcher) const { - if (isDisabledFormControl(&dispatcher.node())) - return DispatchEventResult::CanceledBeforeDispatch; - if (event().type().isEmpty()) return DispatchEventResult::NotCanceled; // Shouldn't happen.
diff --git a/third_party/WebKit/Source/core/frame/Frame.cpp b/third_party/WebKit/Source/core/frame/Frame.cpp index 5343878..a1bdb34 100644 --- a/third_party/WebKit/Source/core/frame/Frame.cpp +++ b/third_party/WebKit/Source/core/frame/Frame.cpp
@@ -288,11 +288,10 @@ if (securityContext()->isSandboxed(SandboxTopNavigation) && securityContext()->isSandboxed( SandboxTopNavigationByUserActivation)) { - // TODO(binlu): To add "or 'allow-top-navigation-by-user-activation'" - // to the reason below, once the new flag is shipped. reason = "The frame attempting navigation of the top-level window is " - "sandboxed, but the 'allow-top-navigation' flag is not set."; + "sandboxed, but the flag of 'allow-top-navigation' or " + "'allow-top-navigation-by-user-activation' is not set."; return false; } if (securityContext()->isSandboxed(SandboxTopNavigation) &&
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index 5bf6441..a2e0bdb 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -348,8 +348,11 @@ scrollingCoordinator->willDestroyScrollableArea(this); FrameHost* frameHost = m_frame->host(); - DCHECK(frameHost); - frameHost->globalRootScrollerController().didDisposeScrollableArea(*this); + // TODO(dcheng): It's wrong that the frame can be detached before the + // FrameView. Figure out what's going on and fix FrameView to be disposed with + // the correct timing. + if (frameHost) + frameHost->globalRootScrollerController().didDisposeScrollableArea(*this); // We need to clear the RootFrameViewport's animator since it gets called // from non-GC'd objects and RootFrameViewport will still have a pointer to
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.h b/third_party/WebKit/Source/core/frame/LocalFrame.h index fbe9ac6..da489be 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.h +++ b/third_party/WebKit/Source/core/frame/LocalFrame.h
@@ -121,7 +121,6 @@ void printNavigationWarning(const String&) override; bool prepareForCommit() override; void didChangeVisibilityState() override; - WindowProxyManagerBase* getWindowProxyManager() const override; void detachChildren(); void documentAttached(); @@ -233,6 +232,8 @@ InterfaceProvider*, InterfaceRegistry*); + // Internal Frame helper overrides: + WindowProxyManagerBase* getWindowProxyManager() const override; // Intentionally private to prevent redundant checks when the type is // already LocalFrame. bool isLocalFrame() const override { return true; }
diff --git a/third_party/WebKit/Source/core/frame/RemoteFrame.h b/third_party/WebKit/Source/core/frame/RemoteFrame.h index ab54b3d..4c108d0 100644 --- a/third_party/WebKit/Source/core/frame/RemoteFrame.h +++ b/third_party/WebKit/Source/core/frame/RemoteFrame.h
@@ -41,7 +41,6 @@ void printNavigationWarning(const String&) override {} bool prepareForCommit() override; bool shouldClose() override; - WindowProxyManagerBase* getWindowProxyManager() const override; // FIXME: Remove this method once we have input routing in the browser // process. See http://crbug.com/339659. @@ -62,6 +61,9 @@ private: RemoteFrame(RemoteFrameClient*, FrameHost*, FrameOwner*); + // Internal Frame helper overrides: + WindowProxyManagerBase* getWindowProxyManager() const override; + // Intentionally private to prevent redundant checks when the type is // already RemoteFrame. bool isLocalFrame() const override { return false; }
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc index edc7d660..a4df599b 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -784,6 +784,14 @@ DCHECK(current_child_); if (current_child_->Type() == NGLayoutInputNode::kLegacyInline) { // TODO(kojii): Setup space_builder_ appropriately for inline child. + + // Margins collapsing: Inline block. + curr_bfc_offset_.block_offset += curr_margin_strut_.Sum(); + UpdateFragmentBfcOffset(curr_bfc_offset_); + PositionPendingFloats(curr_bfc_offset_.block_offset, ConstraintSpace(), + builder_.get()); + curr_margin_strut_ = {}; + return space_builder_->ToConstraintSpace( FromPlatformWritingMode(Style().getWritingMode())); // Calculate margins in parent's writing mode.
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc index 11912e2a..f73b2eee 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
@@ -45,9 +45,11 @@ public: NGBlockLayoutAlgorithmTest() { RuntimeEnabledFeatures::setLayoutNGEnabled(true); + RuntimeEnabledFeatures::setLayoutNGInlineEnabled(true); } ~NGBlockLayoutAlgorithmTest() { RuntimeEnabledFeatures::setLayoutNGEnabled(false); + RuntimeEnabledFeatures::setLayoutNGInlineEnabled(false); } protected: @@ -619,6 +621,37 @@ EXPECT_THAT(horizontal_fragment->LeftOffset(), LayoutUnit(130)); } +// Verifies that margins collapsing logic works with Layout Inline. +TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsWithText) { + setBodyInnerHTML(R"HTML( + <!DOCTYPE html> + <style> + body { + margin: 10px; + } + p { + margin: 20px; + } + </style> + <p>Some text</p> + )HTML"); + RefPtr<NGPhysicalBoxFragment> html_fragment; + std::tie(html_fragment, std::ignore) = RunBlockLayoutAlgorithmForElement( + document().getElementsByTagName("html")->item(0)); + + auto* body_fragment = + toNGPhysicalBoxFragment(html_fragment->Children()[0].get()); + // 20 = std::max(body's margin, p's margin) + EXPECT_THAT(body_fragment->Offset(), + NGPhysicalOffset(LayoutUnit(10), LayoutUnit(20))); + + auto* p_fragment = + toNGPhysicalBoxFragment(body_fragment->Children()[0].get()); + // Collapsed margins with result = 0. + EXPECT_THAT(p_fragment->Offset(), + NGPhysicalOffset(LayoutUnit(20), LayoutUnit(0))); +} + // Verifies that the margin strut of a child with a different writing mode does // not get used in the collapsing margins calculation. //
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc index 291a8f7..434d0b2 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.cc
@@ -29,4 +29,9 @@ delete static_cast<const NGPhysicalBoxFragment*>(this); } +const ComputedStyle& NGPhysicalFragment::Style() const { + DCHECK(layout_object_); + return layout_object_->styleRef(); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h index 2d014c50..58995316 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h
@@ -13,6 +13,7 @@ namespace blink { +class ComputedStyle; class LayoutObject; class NGBreakToken; @@ -78,6 +79,10 @@ NGBreakToken* BreakToken() const { return break_token_; } + const ComputedStyle& Style() const; + + // GetLayoutObject should only be used when necessary for compatibility + // with LegacyLayout. LayoutObject* GetLayoutObject() const { return layout_object_; } bool IsPlaced() const { return is_placed_; }
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMasker.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMasker.cpp index 4cb089d..e215ce3 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMasker.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMasker.cpp
@@ -90,7 +90,7 @@ const LayoutObject* layoutObject = childElement.layoutObject(); if (!layoutObject || layoutObject->styleRef().display() == EDisplay::None) continue; - SVGPaintContext::paintSubtree(builder.context(), layoutObject); + SVGPaintContext::paintResourceSubtree(builder.context(), layoutObject); } m_cachedPaintRecord = builder.endRecording();
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp index 618b11e3..5afa093 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
@@ -212,7 +212,7 @@ tileTransform); for (LayoutObject* child = patternLayoutObject->firstChild(); child; child = child->nextSibling()) - SVGPaintContext::paintSubtree(builder.context(), child); + SVGPaintContext::paintResourceSubtree(builder.context(), child); } return builder.endRecording();
diff --git a/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp b/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp index 00ee12c..89691537 100644 --- a/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp +++ b/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp
@@ -218,8 +218,8 @@ return false; } -void SVGPaintContext::paintSubtree(GraphicsContext& context, - const LayoutObject* item) { +void SVGPaintContext::paintResourceSubtree(GraphicsContext& context, + const LayoutObject* item) { DCHECK(item); DCHECK(!item->needsLayout());
diff --git a/third_party/WebKit/Source/core/paint/SVGPaintContext.h b/third_party/WebKit/Source/core/paint/SVGPaintContext.h index 696c122..e69322f 100644 --- a/third_party/WebKit/Source/core/paint/SVGPaintContext.h +++ b/third_party/WebKit/Source/core/paint/SVGPaintContext.h
@@ -117,7 +117,7 @@ // successfully applied. bool applyClipMaskAndFilterIfNecessary(); - static void paintSubtree(GraphicsContext&, const LayoutObject*); + static void paintResourceSubtree(GraphicsContext&, const LayoutObject*); // TODO(fs): This functions feels a bit misplaced (we don't want this to // turn into the new kitchen sink). Move it if a better location surfaces.
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp index 07562710..c22b97a 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp +++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -70,8 +70,11 @@ // Since different compilers/architectures pack ComputedStyle differently, // re-create the same structure for an accurate size comparison. -struct SameSizeAsComputedStyle : public ComputedStyleBase, - public RefCounted<ComputedStyle> { +struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> { + struct ComputedStyleBase { + unsigned m_bitfields[3]; + } m_base; + void* dataRefs[7]; void* ownPtrs[1]; void* dataRefSvgStyle; @@ -85,6 +88,10 @@ } m_nonInheritedData; }; +// If this assert fails, it means that size of ComputedStyle has changed. Please +// check that you really *do* what to increase the size of ComputedStyle, then +// update the SameSizeAsComputedStyle struct to match the updated storage of +// ComputedStyle. ASSERT_SIZE(ComputedStyle, SameSizeAsComputedStyle); PassRefPtr<ComputedStyle> ComputedStyle::create() {
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 5641e19..e4eb086 100644 --- a/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.cpp +++ b/third_party/WebKit/Source/core/svg/graphics/filters/SVGFEImage.cpp
@@ -182,7 +182,7 @@ { TransformRecorder transformRecorder(builder.context(), layoutObject, transform); - SVGPaintContext::paintSubtree(builder.context(), &layoutObject); + SVGPaintContext::paintResourceSubtree(builder.context(), &layoutObject); } return SkPictureImageFilter::Make(ToSkPicture(builder.endRecording()),
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js b/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js index 1b5b1ec..5399d410 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/AXTreePane.js
@@ -14,8 +14,12 @@ this._axSidebarView = axSidebarView; this._treeOutline = this.createTreeOutline(); this._treeOutline.setPaddingSize(12); + this._treeOutline.element.addEventListener('keydown', this._onKeyDown.bind(this), true); this.element.classList.add('accessibility-computed'); + + this._preselectedTreeElement = null; + this._hoveredTreeElement = null; } /** @@ -57,22 +61,108 @@ previousTreeElement.expand(); inspectedNodeTreeElement.selectable = true; + inspectedNodeTreeElement.setInspected(true); inspectedNodeTreeElement.select(!this._selectedByUser /* omitFocus */, false); inspectedNodeTreeElement.expand(); + this._preselectedTreeElement = inspectedNodeTreeElement; + this.clearSelectedByUser(); } /** + * @param {!Event} event + */ + _onKeyDown(event) { + if (!this._preselectedTreeElement) + return; + if (!event.path.some(element => element === this._preselectedTreeElement.listItemElement)) + return; + if (event.shiftKey || event.metaKey || event.ctrlKey) + return; + + var handled = false; + if (event.key === 'ArrowUp' && !event.altKey) + handled = this._preselectPrevious(); + else if (event.key === 'ArrowDown' && !event.altKey) + handled = this._preselectNext(); + else if (event.key === 'ArrowLeft') + handled = this._preselectedTreeElement.collapseOrAscend(event.altKey); + else if (event.key === 'ArrowRight') + handled = this._preselectedTreeElement.descendOrExpand(event.altKey); + else if (isEnterKey(event)) + handled = this._preselectedTreeElement.onenter(); + + if (handled) + event.consume(true); + } + + /** + * @return {boolean} + */ + _preselectPrevious() { + var previousElement = this._preselectedTreeElement.traversePreviousTreeElement(true); + if (!previousElement) + return false; + + previousElement.reveal(); + previousElement.setPreselected(true); + previousElement.focus(); + return true; + } + + /** + * @return {boolean} + */ + _preselectNext() { + var nextElement = this._preselectedTreeElement.traverseNextTreeElement(true); + if (!nextElement) + return false; + + nextElement.reveal(); + nextElement.setPreselected(true); + nextElement.focus(); + return true; + } + + /** + * @param {!Accessibility.AXNodeTreeElement} treeElement + */ + _setPreselectedTreeElement(treeElement) { + if (treeElement === this._preselectedTreeElement) + return; + if (this._preselectedTreeElement) + this._preselectedTreeElement.setPreselected(false); + this._preselectedTreeElement = treeElement; + } + + /** + * @param {!Accessibility.AXNodeTreeElement} treeElement + */ + setHoveredElement(treeElement) { + if (treeElement === this._hoveredElement) + return; + if (this._hoveredElement) + this._hoveredElement.setHovered(false); + this._hoveredElement = treeElement; + } + + /** * @param {!Accessibility.AccessibilityNode} axNode */ - setSelectedNode(axNode) { + setInspectedNode(axNode) { + var axSidebarView = this._axSidebarView; if (axNode.parentNode()) { - Common.Revealer.reveal(axNode.deferredDOMNode()); + var inspectedDOMNode = UI.context.flavor(SDK.DOMNode); + axNode.deferredDOMNode().resolve(domNode => { + if (domNode !== inspectedDOMNode) + Common.Revealer.reveal(axNode.deferredDOMNode(), true /* omitFocus */); + else + axSidebarView.setNode(domNode); + }); } else { // Only set the node for the accessibility panel, not the Elements tree. - var axSidebarView = this._axSidebarView; - axNode.deferredDOMNode().resolve(node => { - axSidebarView.setNode(node); + axNode.deferredDOMNode().resolve(domNode => { + axSidebarView.setNode(domNode); }); } } @@ -96,28 +186,6 @@ } }; -Accessibility.InspectNodeButton = class { - /** - * @param {!Accessibility.AccessibilityNode} axNode - * @param {!Accessibility.AXTreePane} treePane - */ - constructor(axNode, treePane) { - this._axNode = axNode; - this._treePane = treePane; - - this.element = UI.Icon.create('smallicon-arrow-in-circle', 'inspect-dom-node'); - this.element.addEventListener('mousedown', this._handleMouseDown.bind(this)); - } - - /** - * @param {!Event} event - */ - _handleMouseDown(event) { - this._treePane.setSelectedByUser(true); - this._treePane.setSelectedNode(this._axNode); - } -}; - /** * @unrestricted */ @@ -136,13 +204,30 @@ /** @type {!Accessibility.AXTreePane} */ this._treePane = treePane; - this.selectable = true; + this.selectable = false; this.paddingSize = 12; + this._preselected = false; this._hovered = false; - this._inspectNodeButton = new Accessibility.InspectNodeButton(axNode, treePane); this.listItemElement.addEventListener('mousemove', this._onmousemove.bind(this), false); this.listItemElement.addEventListener('mouseleave', this._onmouseleave.bind(this), false); + this.listItemElement.addEventListener('click', this._onClick.bind(this), false); + } + + /** + * @param {boolean} x + */ + setPreselected(x) { + if (this._preselected === x) + return; + this._preselected = x; + this.listItemElement.classList.toggle('hovered', x || this._hovered); + this.setFocusable(x); + if (this._preselected) { + this._treePane._setPreselectedTreeElement(this); + this.listItemElement.classList.toggle('hovered', true); + this._axNode.highlightDOMNode(); + } } /** @@ -152,16 +237,37 @@ if (this._hovered === x) return; this._hovered = x; - this.listItemElement.classList.toggle('hovered', x); - if (this._hovered) + this.listItemElement.classList.toggle('hovered', x || this._preselected); + if (this._hovered) { + this._treePane.setHoveredElement(this); + this.listItemElement.classList.toggle('hovered', true); this._axNode.highlightDOMNode(); + } + } + + focus() { + this.listItemElement.focus(); + } + + /** + * @param {boolean} focusable + */ + setFocusable(focusable) { + if (focusable) + this.listItemElement.setAttribute('tabIndex', 0); + else + this.listItemElement.removeAttribute('tabIndex'); } _onmousemove(event) { + if (this._preselected || this._inspected || !this._axNode.isDOMNode()) + return; this.setHovered(true); } _onmouseleave(event) { + if (this._inspected) + return; this.setHovered(false); } @@ -177,12 +283,6 @@ */ setInspected(inspected) { this._inspected = inspected; - if (this._inspected) - this.setTrailingIcons([UI.Icon.create('smallicon-thick-left-arrow')]); - else - this.setTrailingIcons([]); - - this.listItemElement.classList.toggle('inspected', this._inspected); } /** @@ -200,11 +300,23 @@ * @return {boolean} */ ondblclick(event) { + if (!this.axNode().isDOMNode()) + return false; this.inspectDOMNode(); return true; } /** + * @param {!Event} event + */ + _onClick(event) { + if (!this.axNode().isDOMNode() || this._inspected) + return; + this.inspectDOMNode(); + } + + + /** * @override */ onpopulate() { @@ -218,7 +330,7 @@ inspectDOMNode() { this._treePane.setSelectedByUser(true); - this._treePane.setSelectedNode(this._axNode); + this._treePane.setInspectedNode(this._axNode); } /** @@ -250,7 +362,6 @@ if (!this._axNode.isDOMNode()) this.listItemElement.classList.add('no-dom-node'); - this.titleElement().appendChild(this._inspectNodeButton.element); } /** @@ -273,6 +384,62 @@ } /** + * @param {boolean} altKey + * @return {boolean} + * @override + */ + collapseOrAscend(altKey) { + if (this.expanded) { + if (altKey) + this.collapseRecursively(); + else + this.collapse(); + return true; + } + + if (!this.parent || this.parent.root) + return false; + + var nextElement = this.parent; + if (nextElement) { + nextElement.reveal(); + nextElement.setPreselected(true); + nextElement.focus(); + return true; + } + + return false; + } + + /** + * @param {boolean} altKey + * @return {boolean} + * @override + */ + descendOrExpand(altKey) { + if (!this.isExpandable()) + return false; + + if (!this.expanded) { + if (altKey) + this.expandRecursively(); + else + this.expand(); + return true; + } + + var nextElement = this.firstChild(); + if (nextElement) { + nextElement.reveal(); + nextElement.setPreselected(true); + nextElement.focus(); + return true; + } + + return false; + } + + /** * @param {string} name */ _appendNameElement(name) {
diff --git a/third_party/WebKit/Source/devtools/front_end/accessibility/accessibilityNode.css b/third_party/WebKit/Source/devtools/front_end/accessibility/accessibilityNode.css index 52539116..20518fd3 100644 --- a/third_party/WebKit/Source/devtools/front_end/accessibility/accessibilityNode.css +++ b/third_party/WebKit/Source/devtools/front_end/accessibility/accessibilityNode.css
@@ -80,10 +80,6 @@ left: -2px; } -.tree-outline li.selected .selection { - background-color: inherit; -} - .tree-outline li.no-dom-node { opacity: 0.5; } @@ -142,33 +138,14 @@ display: none; } -.tree-outline li:hover .inspect-dom-node { - display: inline-block; -} - -.tree-outline li.no-dom-node:hover .inspect-dom-node, -.tree-outline li.inspected:hover .inspect-dom-node { - display: none; -} - -li .inspect-dom-node { - background-color: #5a5a5a; - padding: 0; - margin-left: 5px; - border: 0; - display: none; - position: relative; - top: 2px; -} - -.tree-outline li.selected:focus .inspect-dom-node { - background-color: white; -} - -.tree-outline li.hovered:not(.selected) .selection { +.tree-outline li.preselected:not(.selected) .selection ( display: block; left: 3px; right: 3px; background-color: rgba(56, 121, 217, 0.1); border-radius: 5px; } + +.tree-outline li.inspected .selection { + background-color: rgb(56, 121, 217); +}
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/module.json b/third_party/WebKit/Source/devtools/front_end/emulation/module.json index 3f0e9c9..9d94d56 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulation/module.json +++ b/third_party/WebKit/Source/devtools/front_end/emulation/module.json
@@ -40,20 +40,6 @@ "actionId": "emulation.capture-screenshot" }, { - "type": "@UI.ActionDelegate", - "actionId": "emulation.capture-full-height-screenshot", - "category": "Mobile", - "className": "Emulation.DeviceModeWrapper.ActionDelegate", - "title": "Capture full size screenshot", - "tags": "device" - }, - { - "type": "context-menu-item", - "location": "deviceModeMenu/tools", - "order": 13, - "actionId": "emulation.capture-full-height-screenshot" - }, - { "type": "@UI.ToolbarItem.Provider", "actionId": "emulation.toggle-device-mode", "condition": "can_dock",
diff --git a/third_party/WebKit/Source/modules/BUILD.gn b/third_party/WebKit/Source/modules/BUILD.gn index 20461bd..342b6c2e 100644 --- a/third_party/WebKit/Source/modules/BUILD.gn +++ b/third_party/WebKit/Source/modules/BUILD.gn
@@ -311,7 +311,7 @@ deps = [ ":modules", ":modules_testing", - "//components/payments:payment_request_blink", + "//components/payments/content:payment_request_blink", "//skia", "//testing/gmock", "//testing/gtest",
diff --git a/third_party/WebKit/Source/modules/payments/BUILD.gn b/third_party/WebKit/Source/modules/payments/BUILD.gn index 8a8d5db..e2f6fb6 100644 --- a/third_party/WebKit/Source/modules/payments/BUILD.gn +++ b/third_party/WebKit/Source/modules/payments/BUILD.gn
@@ -31,7 +31,7 @@ "PaymentsValidators.h", ] deps = [ - "//components/payments:payment_app_blink", - "//components/payments:payment_request_blink", + "//components/payments/content:payment_app_blink", + "//components/payments/content:payment_request_blink", ] }
diff --git a/third_party/WebKit/Source/modules/payments/PaymentAddress.h b/third_party/WebKit/Source/modules/payments/PaymentAddress.h index 3204bab..461a704 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentAddress.h +++ b/third_party/WebKit/Source/modules/payments/PaymentAddress.h
@@ -7,7 +7,7 @@ #include "bindings/core/v8/ScriptValue.h" #include "bindings/core/v8/ScriptWrappable.h" -#include "components/payments/payment_request.mojom-blink.h" +#include "components/payments/content/payment_request.mojom-blink.h" #include "modules/ModulesExport.h" #include "platform/heap/Handle.h" #include "wtf/Noncopyable.h"
diff --git a/third_party/WebKit/Source/modules/payments/PaymentAppManager.h b/third_party/WebKit/Source/modules/payments/PaymentAppManager.h index 7e9b3d9..fb48b6c0 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentAppManager.h +++ b/third_party/WebKit/Source/modules/payments/PaymentAppManager.h
@@ -7,7 +7,7 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptWrappable.h" -#include "components/payments/payment_app.mojom-blink.h" +#include "components/payments/content/payment_app.mojom-blink.h" #include "modules/ModulesExport.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.h b/third_party/WebKit/Source/modules/payments/PaymentRequest.h index ee0713bdb..b0162f85 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.h +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
@@ -8,7 +8,7 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptValue.h" #include "bindings/core/v8/ScriptWrappable.h" -#include "components/payments/payment_request.mojom-blink.h" +#include "components/payments/content/payment_request.mojom-blink.h" #include "core/dom/ContextLifecycleObserver.h" #include "core/events/EventTarget.h" #include "modules/ModulesExport.h"
diff --git a/third_party/WebKit/Source/modules/payments/PaymentResponse.h b/third_party/WebKit/Source/modules/payments/PaymentResponse.h index f66dbb73..d6b95895 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentResponse.h +++ b/third_party/WebKit/Source/modules/payments/PaymentResponse.h
@@ -8,7 +8,7 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptValue.h" #include "bindings/core/v8/ScriptWrappable.h" -#include "components/payments/payment_request.mojom-blink.h" +#include "components/payments/content/payment_request.mojom-blink.h" #include "modules/ModulesExport.h" #include "modules/payments/PaymentCurrencyAmount.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.h b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.h index 12a5cb86..7f8568a 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.h +++ b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.h
@@ -7,7 +7,7 @@ #include "bindings/core/v8/ScriptFunction.h" #include "bindings/core/v8/V8DOMException.h" -#include "components/payments/payment_request.mojom-blink.h" +#include "components/payments/content/payment_request.mojom-blink.h" #include "modules/payments/PaymentDetails.h" #include "modules/payments/PaymentItem.h" #include "modules/payments/PaymentShippingOption.h"
diff --git a/third_party/WebKit/Source/modules/payments/PaymentsValidators.h b/third_party/WebKit/Source/modules/payments/PaymentsValidators.h index 2dbb6b9..66e9e07 100644 --- a/third_party/WebKit/Source/modules/payments/PaymentsValidators.h +++ b/third_party/WebKit/Source/modules/payments/PaymentsValidators.h
@@ -5,7 +5,7 @@ #ifndef PaymentsValidators_h #define PaymentsValidators_h -#include "components/payments/payment_request.mojom-blink.h" +#include "components/payments/content/payment_request.mojom-blink.h" #include "modules/ModulesExport.h" #include "wtf/Allocator.h" #include "wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 index 564230b..b5f4d84 100644 --- a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 +++ b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
@@ -855,7 +855,7 @@ }, { name: "TopNavByUserActivationInSandbox", - status: "experimental", + status: "stable", }, // Many websites disable mouse support when touch APIs are available. We'd // like to enable this always but can't until more websites fix this bug.
diff --git a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp index 9b8ed4f..e43dcc01 100644 --- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp +++ b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
@@ -4,8 +4,6 @@ #include "web/WebRemoteFrameImpl.h" -#include "bindings/core/v8/DOMWrapperWorld.h" -#include "bindings/core/v8/WindowProxy.h" #include "core/dom/Fullscreen.h" #include "core/dom/RemoteSecurityContext.h" #include "core/dom/SecurityContext.h" @@ -23,10 +21,10 @@ #include "public/web/WebPerformance.h" #include "public/web/WebRange.h" #include "public/web/WebTreeScopeType.h" -#include "v8/include/v8.h" #include "web/RemoteFrameOwner.h" #include "web/WebLocalFrameImpl.h" #include "web/WebViewImpl.h" +#include <v8/include/v8.h> namespace blink { @@ -214,6 +212,11 @@ return v8::Local<v8::Context>(); } +v8::Local<v8::Context> WebRemoteFrameImpl::deprecatedMainWorldScriptContext() + const { + return toV8Context(frame(), DOMWrapperWorld::mainWorld()); +} + void WebRemoteFrameImpl::reload(WebFrameLoadType) { NOTREACHED(); } @@ -523,12 +526,6 @@ frame()->setDocumentHasReceivedUserGesture(); } -v8::Local<v8::Object> WebRemoteFrameImpl::globalProxy() const { - return frame() - ->windowProxy(DOMWrapperWorld::mainWorld()) - ->globalIfNotDetached(); -} - WebRemoteFrameImpl::WebRemoteFrameImpl(WebTreeScopeType scope, WebRemoteFrameClient* client) : WebRemoteFrame(scope),
diff --git a/third_party/WebKit/Source/web/WebRemoteFrameImpl.h b/third_party/WebKit/Source/web/WebRemoteFrameImpl.h index 9d26737..d049228 100644 --- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.h +++ b/third_party/WebKit/Source/web/WebRemoteFrameImpl.h
@@ -75,6 +75,7 @@ int argc, v8::Local<v8::Value> argv[]) override; v8::Local<v8::Context> mainWorldScriptContext() const override; + v8::Local<v8::Context> deprecatedMainWorldScriptContext() const override; void reload(WebFrameLoadType) override; void reloadWithOverrideURL(const WebURL& overrideUrl, WebFrameLoadType) override; @@ -155,11 +156,13 @@ WebInsecureRequestPolicy) const override; void setReplicatedPotentiallyTrustworthyUniqueOrigin(bool) const override; void dispatchLoadEventOnFrameOwner() const override; + void didStartLoading() override; void didStopLoading() override; + bool isIgnoredForHitTest() const override; + void willEnterFullscreen() override; - v8::Local<v8::Object> globalProxy() const override; void setHasReceivedUserGesture() override;
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py index dae0eb5f..bea0408 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/host_mock.py
@@ -59,7 +59,7 @@ self.buildbot = MockBuildBot() - # Note: We're using a real PortFactory here. Tests which don't wish to depend + # Note: We're using a real PortFactory here. Tests which don't wish to depend # on the list of known ports should override this with a MockPortFactory. self.port_factory = PortFactory(self)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory.py index 95d2454..659324f 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -35,90 +35,6 @@ from webkitpy.common.webkit_finder import WebKitFinder -def platform_options(use_globs=False): - return [ - optparse.make_option('--android', action='store_const', dest='platform', - const=('android*' if use_globs else 'android'), - help=('Alias for --platform=android*' if use_globs else 'Alias for --platform=android')), - - optparse.make_option('--platform', action='store', - help=('Glob-style list of platform/ports to use (e.g., "mac*")' - if use_globs else 'Platform to use (e.g., "mac-lion")')), - ] - - -def configuration_options(): - return [ - optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration", - help='Set the configuration to Debug'), - optparse.make_option("-t", "--target", dest="target", - help="Specify the target build subdirectory under src/out/"), - optparse.make_option('--release', action='store_const', const='Release', dest="configuration", - help='Set the configuration to Release'), - ] - - -def _builder_options(builder_name): - return optparse.Values({ - 'builder_name': builder_name, - 'configuration': "Debug" if re.search(r"[d|D](ebu|b)g", builder_name) else "Release", - 'target': None, - }) - - -def _check_configuration_and_target(host, options): - if not options or not getattr(options, 'target', None): - return - - gn_configuration = _read_configuration_from_gn(host, options) - if gn_configuration: - if getattr(options, 'configuration') not in (None, gn_configuration): - raise ValueError('Configuration does not match the GN build args.') - options.configuration = gn_configuration - return - - if options.target in ('Debug', 'Debug_x64'): - options.configuration = 'Debug' - elif options.target in ('Release', 'Release_x64'): - options.configuration = 'Release' - else: - raise ValueError('Could not determine build configuration type.\n' - 'Either switch to one of the default target directories,\n' - 'use args.gn, or specify --debug or --release explicitly.\n' - 'If the directory is out/<dir>, then pass -t <dir>.') - - -def _read_configuration_from_gn(fs, options): - """Return the configuration to used based on args.gn, if possible.""" - - # We should really default to 'out' everywhere at this point, but - # that's a separate cleanup CL. - build_directory = getattr(options, 'build_directory', None) or 'out' - - target = options.target - finder = WebKitFinder(fs) - path = fs.join(finder.chromium_base(), build_directory, target, 'args.gn') - if not fs.exists(path): - path = fs.join(finder.chromium_base(), build_directory, target, 'toolchain.ninja') - if not fs.exists(path): - # This does not appear to be a GN-based build directory, so we don't know - # how to interpret it. - return None - - # toolchain.ninja exists, but args.gn does not; this can happen when - # `gn gen` is run with no --args. - return 'Debug' - - args = fs.read_text_file(path) - for l in args.splitlines(): - if re.match(r'^\s*is_debug\s*=\s*false(\s*$|\s*#.*$)', l): - return 'Release' - - # if is_debug is set to anything other than false, or if it - # does not exist at all, we should use the default value (True). - return 'Debug' - - class PortFactory(object): PORT_CLASSES = ( 'android.AndroidPort', @@ -143,8 +59,9 @@ raise NotImplementedError('unknown platform: %s' % platform) def get(self, port_name=None, options=None, **kwargs): - """Returns an object implementing the Port interface. If - port_name is None, this routine attempts to guess at the most + """Returns an object implementing the Port interface. + + If port_name is None, this routine attempts to guess at the most appropriate port on this platform. """ port_name = port_name or self._default_port() @@ -170,18 +87,103 @@ raise NotImplementedError('unsupported platform: "%s"' % port_name) def all_port_names(self, platform=None): - """Return a list of all valid, fully-specified, "real" port names. + """Returns a list of all valid, fully-specified, "real" port names. This is the list of directories that are used as actual baseline_paths() by real ports. This does not include any "fake" names like "test" - or "mock-mac", and it does not include any directories that are not. + or "mock-mac", and it does not include any directories that are not + port names. - If platform is not specified, we will glob-match all ports + If platform is not specified, all known port names will be returned. """ platform = platform or '*' return fnmatch.filter(self._host.builders.all_port_names(), platform) def get_from_builder_name(self, builder_name): port_name = self._host.builders.port_name_for_builder_name(builder_name) - assert port_name, "unrecognized builder name '%s'" % builder_name - return self.get(port_name, _builder_options(builder_name)) + assert port_name, 'unrecognized builder name: "%s"' % builder_name + return self.get(port_name, options=_builder_options(builder_name)) + + +def platform_options(use_globs=False): + return [ + optparse.make_option('--android', action='store_const', dest='platform', + const=('android*' if use_globs else 'android'), + help=('Alias for --platform=android*' if use_globs else 'Alias for --platform=android')), + + optparse.make_option('--platform', action='store', + help=('Glob-style list of platform/ports to use (e.g., "mac*")' + if use_globs else 'Platform to use (e.g., "mac-lion")')), + ] + + +def configuration_options(): + return [ + optparse.make_option('--debug', action='store_const', const='Debug', dest='configuration', + help='Set the configuration to Debug'), + optparse.make_option('-t', '--target', dest='target', + help='Specify the target build subdirectory under src/out/'), + optparse.make_option('--release', action='store_const', const='Release', dest='configuration', + help='Set the configuration to Release'), + ] + + +def _builder_options(builder_name): + return optparse.Values({ + 'builder_name': builder_name, + 'configuration': 'Debug' if re.search(r'[d|D](ebu|b)g', builder_name) else 'Release', + 'target': None, + }) + + +def _check_configuration_and_target(host, options): + """Updates options.configuration based on options.target.""" + if not options or not getattr(options, 'target', None): + return + + gn_configuration = _read_configuration_from_gn(host, options) + if gn_configuration: + if getattr(options, 'configuration') not in (None, gn_configuration): + raise ValueError('Configuration does not match the GN build args.') + options.configuration = gn_configuration + return + + if options.target in ('Debug', 'Debug_x64'): + options.configuration = 'Debug' + elif options.target in ('Release', 'Release_x64'): + options.configuration = 'Release' + else: + raise ValueError('Could not determine build configuration type.\n' + 'Either switch to one of the default target directories,\n' + 'use args.gn, or specify --debug or --release explicitly.\n' + 'If the directory is out/<dir>, then pass -t <dir>.') + + +def _read_configuration_from_gn(fs, options): + """Returns the configuration to used based on args.gn, if possible.""" + + # TODO(qyearsley): Default to 'out' everywhere. + build_directory = getattr(options, 'build_directory', None) or 'out' + + target = options.target + finder = WebKitFinder(fs) + path = fs.join(finder.chromium_base(), build_directory, target, 'args.gn') + if not fs.exists(path): + path = fs.join(finder.chromium_base(), build_directory, target, 'toolchain.ninja') + if not fs.exists(path): + # This does not appear to be a GN-based build directory, so we don't know + # how to interpret it. + return None + + # toolchain.ninja exists, but args.gn does not; this can happen when + # `gn gen` is run with no --args. + return 'Debug' + + args = fs.read_text_file(path) + for line in args.splitlines(): + if re.match(r'^\s*is_debug\s*=\s*false(\s*$|\s*#.*$)', line): + return 'Release' + + # If is_debug is set to anything other than false, or if it + # does not exist at all, we should use the default value (True). + return 'Debug'
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory_mock.py new file mode 100644 index 0000000..911432fb --- /dev/null +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/factory_mock.py
@@ -0,0 +1,18 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from webkitpy.layout_tests.port.test import TestPort + + +class MockPortFactory(object): + + def __init__(self, host): + self._host = host + + def get(self, port_name=None): + return TestPort(port_name=port_name, host=self._host) + + def get_from_builder_name(self, builder_name): + port_name = self._host.builders.port_name_for_builder_name(builder_name) + return self.get(port_name)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py index 6aa4dbb..f6df071 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py
@@ -41,10 +41,13 @@ from webkitpy.w3c.test_parser import TestParser from webkitpy.w3c.test_converter import convert_for_webkit -# Maximum length of import path starting from top of source repository. +# Maximum length of import path relative to the upstream repository base. # This limit is here because the Windows builders cannot create paths that are -# longer than the Windows max path length (260). See http://crbug.com/609871. -MAX_PATH_LENGTH = 140 +# longer than the Windows max path length (260). If the absolute path to the +# destination directory is up to 100 characters on Windows, then that would +# give us 160 characters from the base of the upstream repo. +# See: http://crbug.com/609871. +MAX_PATH_LENGTH = 160 _log = logging.getLogger(__name__)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier_unittest.py index 6631bb3..7b18031 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier_unittest.py
@@ -145,7 +145,7 @@ def test_files_with_long_path_are_skipped(self): host = MockHost() host.filesystem = MockFileSystem(files=FAKE_FILES) - long_file_path = '%s/%s.html' % (FAKE_SOURCE_REPO_DIR, 'x' * 150) + long_file_path = '%s/%s.html' % (FAKE_SOURCE_REPO_DIR, 'x' * 180) short_file_path = '%s/x.html' % FAKE_SOURCE_REPO_DIR host.filesystem.write_text_file(long_file_path, '<html></html>') host.filesystem.write_text_file(short_file_path, '<html></html>') @@ -153,7 +153,7 @@ copier.find_importable_tests() self.assertLog([ 'WARNING: Skipping: %s\n' % long_file_path, - 'WARNING: Reason: Long path. Max length 140; see http://crbug.com/609871.\n', + 'WARNING: Reason: Long path. Max length 160; see http://crbug.com/609871.\n', ]) def test_should_try_to_convert_positive_cases(self):
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py index 2ef4840..53bf10fe 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
@@ -376,7 +376,14 @@ '--gerrit', '-m', description, - ] + ['--cc=' + email_address for email_address in directory_owners]) + ] + self._cc_part(directory_owners)) + + @staticmethod + def _cc_part(directory_owners): + cc_part = [] + for owner_tuple in sorted(directory_owners): + cc_part.extend('--cc=' + owner for owner in owner_tuple) + return cc_part def get_directory_owners(self): """Returns a mapping of email addresses to owners of changed tests."""
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py index d6fbcd8a..4c7ab7b 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
@@ -183,3 +183,12 @@ '# external/wpt/foo [ Pass ]\n') importer = TestImporter(host) self.assertEqual(importer.get_directory_owners(), {}) + + def test_cc_part(self): + directory_owners = { + ('someone@chromium.org',): ['external/wpt/foo', 'external/wpt/bar'], + ('x@chromium.org', 'y@chromium.org'): ['external/wpt/baz'], + } + self.assertEqual( + TestImporter._cc_part(directory_owners), + ['--cc=someone@chromium.org', '--cc=x@chromium.org', '--cc=y@chromium.org'])
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py index e65d5e6..fc8f37b3 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py
@@ -279,8 +279,8 @@ for name in sorted(port_names): specifiers.append(self.host.builders.version_specifier_for_port_name(name)) port = self.host.port_factory.get() - specifiers = self.simplify_specifiers(specifiers, port.configuration_specifier_macros()) specifiers.extend(self.skipped_specifiers(test_name)) + specifiers = self.simplify_specifiers(specifiers, port.configuration_specifier_macros()) if not specifiers: return '' return '[ %s ]' % ' '.join(specifiers)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater_unittest.py index b705cde..847eb2fa 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater_unittest.py
@@ -10,6 +10,7 @@ from webkitpy.common.net.layout_test_results import LayoutTestResult, LayoutTestResults from webkitpy.common.system.log_testing import LoggingTestCase from webkitpy.layout_tests.builder_list import BuilderList +from webkitpy.layout_tests.port.factory_mock import MockPortFactory from webkitpy.w3c.wpt_expectations_updater import WPTExpectationsUpdater, MARKER_COMMENT @@ -18,6 +19,7 @@ def mock_host(self): super(WPTExpectationsUpdaterTest, self).setUp() host = MockHost() + host.port_factory = MockPortFactory(host) host.builders = BuilderList({ 'MOCK Try Mac10.10': { 'port_name': 'test-mac-mac10.10', @@ -34,6 +36,11 @@ 'specifiers': ['Trusty', 'Release'], 'is_try_builder': True, }, + 'MOCK Try Precise': { + 'port_name': 'test-linux-precise', + 'specifiers': ['Precise', 'Release'], + 'is_try_builder': True, + }, 'MOCK Try Win10': { 'port_name': 'test-win-win10', 'specifiers': ['Win10', 'Release'], @@ -163,7 +170,7 @@ self.assertEqual( updater.create_line_list(results), [ - 'crbug.com/test [ Linux ] external/fake/test/path.html [ Pass ]', + 'crbug.com/test [ Trusty ] external/fake/test/path.html [ Pass ]', 'crbug.com/test [ Mac10.11 ] external/fake/test/path.html [ Timeout ]', 'crbug.com/test [ Mac10.10 ] external/fake/test/zzzz.html [ Failure ]', ]) @@ -171,6 +178,7 @@ def test_specifier_part(self): updater = WPTExpectationsUpdater(self.mock_host()) self.assertEqual(updater.specifier_part(['test-mac-mac10.10'], 'x/y.html'), '[ Mac10.10 ]') + self.assertEqual(updater.specifier_part([], 'x/y.html'), '') def test_skipped_specifiers_when_test_is_wontfix(self): host = self.mock_host() @@ -184,7 +192,7 @@ macros = { 'mac': ['Mac10.10', 'mac10.11'], 'win': ['Win7', 'win10'], - 'Linux': ['TRUSTY'], + 'Linux': ['Trusty'], } self.assertEqual(WPTExpectationsUpdater.simplify_specifiers(['mac10.10', 'mac10.11'], macros), ['Mac']) self.assertEqual(WPTExpectationsUpdater.simplify_specifiers(['Mac10.10', 'Mac10.11', 'Trusty'], macros), ['Linux', 'Mac']) @@ -193,6 +201,17 @@ self.assertEqual(WPTExpectationsUpdater.simplify_specifiers(['a', 'b', 'c'], {}), ['A', 'B', 'C']) self.assertEqual(WPTExpectationsUpdater.simplify_specifiers(['Mac', 'Win', 'Linux'], macros), []) + def test_specifier_part_with_skipped_test(self): + host = self.mock_host() + expectations_path = '/test.checkout/LayoutTests/NeverFixTests' + host.filesystem.files[expectations_path] = 'crbug.com/111 [ Linux Mac10.11 ] external/wpt/test.html [ WontFix ]\n' + host.filesystem.files['/test.checkout/LayoutTests/external/wpt/test.html'] = '' + updater = WPTExpectationsUpdater(host) + self.assertEqual( + updater.specifier_part(['test-mac-mac10.10', 'test-win-win7', 'test-win-win10'], 'external/wpt/test.html'), '') + self.assertEqual( + updater.specifier_part(['test-win-win7', 'test-win-win10'], 'external/wpt/another.html'), '[ Win ]') + def test_merge_dicts_with_conflict_raise_exception(self): updater = WPTExpectationsUpdater(self.mock_host()) # Both dicts here have the key "one", and the value is not equal. @@ -260,7 +279,8 @@ def test_write_to_test_expectations_with_marker_comment(self): host = self.mock_host() - expectations_path = '/mock-checkout/third_party/WebKit/LayoutTests/TestExpectations' + + expectations_path = host.port_factory.get().path_to_generic_test_expectations_file() host.filesystem.files[expectations_path] = MARKER_COMMENT + '\n' updater = WPTExpectationsUpdater(host) line_list = ['crbug.com/123 [ Trusty ] fake/file/path.html [ Pass ]'] @@ -273,21 +293,21 @@ def test_write_to_test_expectations_with_no_marker_comment(self): host = self.mock_host() - expectations_path = '/mock-checkout/third_party/WebKit/LayoutTests/TestExpectations' - host.filesystem.files[expectations_path] = 'crbug.com/111 [ Trusty ]\n' + expectations_path = host.port_factory.get().path_to_generic_test_expectations_file() + host.filesystem.files[expectations_path] = 'crbug.com/111 [ Trusty ] foo/bar.html [ Failure ]\n' updater = WPTExpectationsUpdater(host) line_list = ['crbug.com/123 [ Trusty ] fake/file/path.html [ Pass ]'] updater.write_to_test_expectations(line_list) value = host.filesystem.read_text_file(expectations_path) self.assertMultiLineEqual( value, - ('crbug.com/111 [ Trusty ]\n' + ('crbug.com/111 [ Trusty ] foo/bar.html [ Failure ]\n' '\n' + MARKER_COMMENT + '\n' 'crbug.com/123 [ Trusty ] fake/file/path.html [ Pass ]')) def test_write_to_test_expectations_skips_existing_lines(self): host = self.mock_host() - expectations_path = '/mock-checkout/third_party/WebKit/LayoutTests/TestExpectations' + expectations_path = host.port_factory.get().path_to_generic_test_expectations_file() host.filesystem.files[expectations_path] = 'crbug.com/111 dont/copy/me.html [ Failure ]\n' updater = WPTExpectationsUpdater(host) line_list = [ @@ -304,7 +324,7 @@ def test_write_to_test_expectations_with_marker_and_no_lines(self): host = self.mock_host() - expectations_path = '/mock-checkout/third_party/WebKit/LayoutTests/TestExpectations' + expectations_path = host.port_factory.get().path_to_generic_test_expectations_file() host.filesystem.files[expectations_path] = ( MARKER_COMMENT + '\n' 'crbug.com/123 [ Trusty ] fake/file/path.html [ Pass ]\n')
diff --git a/third_party/WebKit/public/BUILD.gn b/third_party/WebKit/public/BUILD.gn index dd43b77..2f1c3c2c 100644 --- a/third_party/WebKit/public/BUILD.gn +++ b/third_party/WebKit/public/BUILD.gn
@@ -705,7 +705,7 @@ "platform/modules/webshare/webshare.mojom", ] public_deps = [ - "//components/payments:payment_request", + "//components/payments/content:payment_request", "//url/mojo:url_mojom_gurl", ]
diff --git a/third_party/WebKit/public/web/WebRemoteFrame.h b/third_party/WebKit/public/web/WebRemoteFrame.h index 7ca1af3..04659d0 100644 --- a/third_party/WebKit/public/web/WebRemoteFrame.h +++ b/third_party/WebKit/public/web/WebRemoteFrame.h
@@ -10,7 +10,6 @@ #include "public/platform/WebInsecureRequestPolicy.h" #include "public/web/WebFrame.h" #include "public/web/WebSandboxFlags.h" -#include "v8/include/v8.h" namespace blink { @@ -105,7 +104,7 @@ // Temporary method to allow embedders to get the script context of a // remote frame. This should only be used by legacy code that has not yet // migrated over to the new OOPI infrastructure. - virtual v8::Local<v8::Object> globalProxy() const = 0; + virtual v8::Local<v8::Context> deprecatedMainWorldScriptContext() const = 0; protected: explicit WebRemoteFrame(WebTreeScopeType scope) : WebFrame(scope) {}
diff --git a/third_party/libvpx/README.chromium b/third_party/libvpx/README.chromium index 3d82e58..7d9541f 100644 --- a/third_party/libvpx/README.chromium +++ b/third_party/libvpx/README.chromium
@@ -5,9 +5,9 @@ License File: source/libvpx/LICENSE Security Critical: yes -Date: Tuesday February 21 2017 +Date: Friday February 24 2017 Branch: master -Commit: 4d4231352c8cefdae2e76b7bad4286ec21747c89 +Commit: 8121f85473b28183c93fdcef290ed6f74b0b52db Description: Contains the sources used to compile libvpx binaries used by Google Chrome and
diff --git a/third_party/libvpx/libvpx_srcs.gni b/third_party/libvpx/libvpx_srcs.gni index 429aa79..7a4c241 100644 --- a/third_party/libvpx/libvpx_srcs.gni +++ b/third_party/libvpx/libvpx_srcs.gni
@@ -371,8 +371,6 @@ "//third_party/libvpx/source/libvpx/vp9/common/x86/vp9_mfqe_sse2.asm", "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_dct_sse2.asm", "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_error_sse2.asm", - "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_highbd_error_avx.asm", - "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_highbd_error_sse2.asm", "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_temporal_filter_apply_sse2.asm", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/add_noise_sse2.asm", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/deblock_sse2.asm", @@ -429,6 +427,7 @@ libvpx_srcs_x86_ssse3 = [ "//third_party/libvpx/source/libvpx/vp8/encoder/x86/quantize_ssse3.c", "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_dct_ssse3.c", + "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_frame_scale_ssse3.c", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/inv_txfm_ssse3.c", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c", ] @@ -814,8 +813,6 @@ "//third_party/libvpx/source/libvpx/vp9/common/x86/vp9_mfqe_sse2.asm", "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_dct_sse2.asm", "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_error_sse2.asm", - "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_highbd_error_avx.asm", - "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_highbd_error_sse2.asm", "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_quantize_ssse3_x86_64.asm", "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_temporal_filter_apply_sse2.asm", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/add_noise_sse2.asm", @@ -878,6 +875,7 @@ libvpx_srcs_x86_64_ssse3 = [ "//third_party/libvpx/source/libvpx/vp8/encoder/x86/quantize_ssse3.c", "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_dct_ssse3.c", + "//third_party/libvpx/source/libvpx/vp9/encoder/x86/vp9_frame_scale_ssse3.c", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/inv_txfm_ssse3.c", "//third_party/libvpx/source/libvpx/vpx_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c", ]
diff --git a/third_party/libvpx/source/config/ios/arm-neon/vp9_rtcd.h b/third_party/libvpx/source/config/ios/arm-neon/vp9_rtcd.h index d07bcaa3..5b59baa 100644 --- a/third_party/libvpx/source/config/ios/arm-neon/vp9_rtcd.h +++ b/third_party/libvpx/source/config/ios/arm-neon/vp9_rtcd.h
@@ -42,8 +42,8 @@ int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); #define vp9_diamond_search_sad vp9_diamond_search_sad_c -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_fdct8x8_quant vp9_fdct8x8_quant_neon void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -78,11 +78,11 @@ void vp9_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_neon -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp vp9_quantize_fp_neon -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst);
diff --git a/third_party/libvpx/source/config/ios/arm64/vp9_rtcd.h b/third_party/libvpx/source/config/ios/arm64/vp9_rtcd.h index d07bcaa3..5b59baa 100644 --- a/third_party/libvpx/source/config/ios/arm64/vp9_rtcd.h +++ b/third_party/libvpx/source/config/ios/arm64/vp9_rtcd.h
@@ -42,8 +42,8 @@ int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); #define vp9_diamond_search_sad vp9_diamond_search_sad_c -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_fdct8x8_quant vp9_fdct8x8_quant_neon void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -78,11 +78,11 @@ void vp9_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_neon -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp vp9_quantize_fp_neon -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst);
diff --git a/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vp9_rtcd.h b/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vp9_rtcd.h index 789724f..0c6f311f7 100644 --- a/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/arm-neon-cpu-detect/vp9_rtcd.h
@@ -42,9 +42,9 @@ int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); #define vp9_diamond_search_sad vp9_diamond_search_sad_c -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); #define vp9_fht16x16 vp9_fht16x16_c @@ -78,11 +78,11 @@ void vp9_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); RTCD_EXTERN void (*vp9_iht8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst);
diff --git a/third_party/libvpx/source/config/linux/arm-neon/vp9_rtcd.h b/third_party/libvpx/source/config/linux/arm-neon/vp9_rtcd.h index d07bcaa3..5b59baa 100644 --- a/third_party/libvpx/source/config/linux/arm-neon/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/arm-neon/vp9_rtcd.h
@@ -42,8 +42,8 @@ int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); #define vp9_diamond_search_sad vp9_diamond_search_sad_c -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_fdct8x8_quant vp9_fdct8x8_quant_neon void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -78,11 +78,11 @@ void vp9_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_neon -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp vp9_quantize_fp_neon -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst);
diff --git a/third_party/libvpx/source/config/linux/arm/vp9_rtcd.h b/third_party/libvpx/source/config/linux/arm/vp9_rtcd.h index cd5726c..59b1478 100644 --- a/third_party/libvpx/source/config/linux/arm/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/arm/vp9_rtcd.h
@@ -41,7 +41,7 @@ int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); #define vp9_diamond_search_sad vp9_diamond_search_sad_c -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_fdct8x8_quant vp9_fdct8x8_quant_c void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -74,10 +74,10 @@ void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_c -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp vp9_quantize_fp_c -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst);
diff --git a/third_party/libvpx/source/config/linux/arm64/vp9_rtcd.h b/third_party/libvpx/source/config/linux/arm64/vp9_rtcd.h index d07bcaa3..5b59baa 100644 --- a/third_party/libvpx/source/config/linux/arm64/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/arm64/vp9_rtcd.h
@@ -42,8 +42,8 @@ int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); #define vp9_diamond_search_sad vp9_diamond_search_sad_c -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_neon(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_fdct8x8_quant vp9_fdct8x8_quant_neon void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -78,11 +78,11 @@ void vp9_iht8x8_64_add_neon(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_neon -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_neon(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp vp9_quantize_fp_neon -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst);
diff --git a/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h b/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h index c044e461..b0aa898f 100644 --- a/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/generic/vp9_rtcd.h
@@ -41,7 +41,7 @@ int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); #define vp9_diamond_search_sad vp9_diamond_search_sad_c -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_fdct8x8_quant vp9_fdct8x8_quant_c void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -68,9 +68,6 @@ int64_t vp9_highbd_block_error_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); #define vp9_highbd_block_error vp9_highbd_block_error_c -int64_t vp9_highbd_block_error_8bit_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -#define vp9_highbd_block_error_8bit vp9_highbd_block_error_8bit_c - void vp9_highbd_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); #define vp9_highbd_fht16x16 vp9_highbd_fht16x16_c @@ -101,10 +98,10 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit); #define vp9_highbd_post_proc_down_and_across vp9_highbd_post_proc_down_and_across_c -void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp vp9_highbd_quantize_fp_c -void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp_32x32 vp9_highbd_quantize_fp_32x32_c void vp9_highbd_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -119,12 +116,15 @@ void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_c -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp vp9_quantize_fp_c -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c +void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +#define vp9_scale_and_extend_frame vp9_scale_and_extend_frame_c + void vp9_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); #define vp9_temporal_filter_apply vp9_temporal_filter_apply_c
diff --git a/third_party/libvpx/source/config/linux/ia32/vp9_rtcd.h b/third_party/libvpx/source/config/linux/ia32/vp9_rtcd.h index ac968a9..6d869f9 100644 --- a/third_party/libvpx/source/config/linux/ia32/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/ia32/vp9_rtcd.h
@@ -30,6 +30,7 @@ #endif int64_t vp9_block_error_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); +int64_t vp9_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); int64_t vp9_block_error_avx2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); RTCD_EXTERN int64_t (*vp9_block_error)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); @@ -45,9 +46,9 @@ int vp9_diamond_search_sad_avx(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); RTCD_EXTERN int (*vp9_diamond_search_sad)(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); void vp9_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -82,11 +83,6 @@ int64_t vp9_highbd_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); RTCD_EXTERN int64_t (*vp9_highbd_block_error)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); -int64_t vp9_highbd_block_error_8bit_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_avx(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -RTCD_EXTERN int64_t (*vp9_highbd_block_error_8bit)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); - void vp9_highbd_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); #define vp9_highbd_fht16x16 vp9_highbd_fht16x16_c @@ -117,10 +113,10 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit); #define vp9_highbd_post_proc_down_and_across vp9_highbd_post_proc_down_and_across_c -void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp vp9_highbd_quantize_fp_c -void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp_32x32 vp9_highbd_quantize_fp_32x32_c void vp9_highbd_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -138,13 +134,17 @@ void vp9_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); RTCD_EXTERN void (*vp9_iht8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c +void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +void vp9_scale_and_extend_frame_ssse3(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +RTCD_EXTERN void (*vp9_scale_and_extend_frame)(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); + void vp9_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); void vp9_temporal_filter_apply_sse2(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); RTCD_EXTERN void (*vp9_temporal_filter_apply)(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -160,6 +160,7 @@ (void)flags; vp9_block_error = vp9_block_error_c; + if (flags & HAS_SSE2) vp9_block_error = vp9_block_error_sse2; if (flags & HAS_AVX2) vp9_block_error = vp9_block_error_avx2; vp9_block_error_fp = vp9_block_error_fp_c; if (flags & HAS_SSE2) vp9_block_error_fp = vp9_block_error_fp_sse2; @@ -186,9 +187,6 @@ if (flags & HAS_SSE2) vp9_fwht4x4 = vp9_fwht4x4_sse2; vp9_highbd_block_error = vp9_highbd_block_error_c; if (flags & HAS_SSE2) vp9_highbd_block_error = vp9_highbd_block_error_sse2; - vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_c; - if (flags & HAS_SSE2) vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_sse2; - if (flags & HAS_AVX) vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_avx; vp9_iht16x16_256_add = vp9_iht16x16_256_add_c; if (flags & HAS_SSE2) vp9_iht16x16_256_add = vp9_iht16x16_256_add_sse2; vp9_iht4x4_16_add = vp9_iht4x4_16_add_c; @@ -197,6 +195,8 @@ if (flags & HAS_SSE2) vp9_iht8x8_64_add = vp9_iht8x8_64_add_sse2; vp9_quantize_fp = vp9_quantize_fp_c; if (flags & HAS_SSE2) vp9_quantize_fp = vp9_quantize_fp_sse2; + vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_c; + if (flags & HAS_SSSE3) vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_ssse3; vp9_temporal_filter_apply = vp9_temporal_filter_apply_c; if (flags & HAS_SSE2) vp9_temporal_filter_apply = vp9_temporal_filter_apply_sse2; }
diff --git a/third_party/libvpx/source/config/linux/ia32/vpx_dsp_rtcd.h b/third_party/libvpx/source/config/linux/ia32/vpx_dsp_rtcd.h index 20ab4d2..47fe5dd 100644 --- a/third_party/libvpx/source/config/linux/ia32/vpx_dsp_rtcd.h +++ b/third_party/libvpx/source/config/linux/ia32/vpx_dsp_rtcd.h
@@ -1445,10 +1445,12 @@ void vpx_idct32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_1024_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct32x32_1024_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct32x32_1024_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_135_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_1024_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct32x32_135_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct32x32_135_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest, int stride); @@ -1457,6 +1459,7 @@ void vpx_idct32x32_34_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_34_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct32x32_34_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct32x32_34_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride); @@ -1469,6 +1472,7 @@ void vpx_idct8x8_12_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_12_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct8x8_12_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct8x8_12_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_1_add_c(const tran_low_t *input, uint8_t *dest, int stride); @@ -1477,6 +1481,7 @@ void vpx_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct8x8_64_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride); int16_t vpx_int_pro_col_c(const uint8_t *ref, const int width); @@ -2581,22 +2586,27 @@ if (flags & HAS_SSE2) vpx_idct16x16_38_add = vpx_idct16x16_256_add_sse2; vpx_idct32x32_1024_add = vpx_idct32x32_1024_add_c; if (flags & HAS_SSE2) vpx_idct32x32_1024_add = vpx_idct32x32_1024_add_sse2; + if (flags & HAS_SSSE3) vpx_idct32x32_1024_add = vpx_idct32x32_1024_add_ssse3; vpx_idct32x32_135_add = vpx_idct32x32_135_add_c; if (flags & HAS_SSE2) vpx_idct32x32_135_add = vpx_idct32x32_1024_add_sse2; + if (flags & HAS_SSSE3) vpx_idct32x32_135_add = vpx_idct32x32_135_add_ssse3; vpx_idct32x32_1_add = vpx_idct32x32_1_add_c; if (flags & HAS_SSE2) vpx_idct32x32_1_add = vpx_idct32x32_1_add_sse2; vpx_idct32x32_34_add = vpx_idct32x32_34_add_c; if (flags & HAS_SSE2) vpx_idct32x32_34_add = vpx_idct32x32_34_add_sse2; + if (flags & HAS_SSSE3) vpx_idct32x32_34_add = vpx_idct32x32_34_add_ssse3; vpx_idct4x4_16_add = vpx_idct4x4_16_add_c; if (flags & HAS_SSE2) vpx_idct4x4_16_add = vpx_idct4x4_16_add_sse2; vpx_idct4x4_1_add = vpx_idct4x4_1_add_c; if (flags & HAS_SSE2) vpx_idct4x4_1_add = vpx_idct4x4_1_add_sse2; vpx_idct8x8_12_add = vpx_idct8x8_12_add_c; if (flags & HAS_SSE2) vpx_idct8x8_12_add = vpx_idct8x8_12_add_sse2; + if (flags & HAS_SSSE3) vpx_idct8x8_12_add = vpx_idct8x8_12_add_ssse3; vpx_idct8x8_1_add = vpx_idct8x8_1_add_c; if (flags & HAS_SSE2) vpx_idct8x8_1_add = vpx_idct8x8_1_add_sse2; vpx_idct8x8_64_add = vpx_idct8x8_64_add_c; if (flags & HAS_SSE2) vpx_idct8x8_64_add = vpx_idct8x8_64_add_sse2; + if (flags & HAS_SSSE3) vpx_idct8x8_64_add = vpx_idct8x8_64_add_ssse3; vpx_int_pro_col = vpx_int_pro_col_c; if (flags & HAS_SSE2) vpx_int_pro_col = vpx_int_pro_col_sse2; vpx_int_pro_row = vpx_int_pro_row_c;
diff --git a/third_party/libvpx/source/config/linux/mips64el/vp9_rtcd.h b/third_party/libvpx/source/config/linux/mips64el/vp9_rtcd.h index 403db51..84cc120 100644 --- a/third_party/libvpx/source/config/linux/mips64el/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/mips64el/vp9_rtcd.h
@@ -41,7 +41,7 @@ int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); #define vp9_diamond_search_sad vp9_diamond_search_sad_c -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_fdct8x8_quant vp9_fdct8x8_quant_c void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -74,10 +74,10 @@ void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_c -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp vp9_quantize_fp_c -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst);
diff --git a/third_party/libvpx/source/config/linux/mipsel/vp9_rtcd.h b/third_party/libvpx/source/config/linux/mipsel/vp9_rtcd.h index 403db51..84cc120 100644 --- a/third_party/libvpx/source/config/linux/mipsel/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/mipsel/vp9_rtcd.h
@@ -41,7 +41,7 @@ int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); #define vp9_diamond_search_sad vp9_diamond_search_sad_c -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_fdct8x8_quant vp9_fdct8x8_quant_c void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -74,10 +74,10 @@ void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_c -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp vp9_quantize_fp_c -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst);
diff --git a/third_party/libvpx/source/config/linux/x64/vp9_rtcd.h b/third_party/libvpx/source/config/linux/x64/vp9_rtcd.h index b102039..7d37d7b9 100644 --- a/third_party/libvpx/source/config/linux/x64/vp9_rtcd.h +++ b/third_party/libvpx/source/config/linux/x64/vp9_rtcd.h
@@ -30,6 +30,7 @@ #endif int64_t vp9_block_error_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); +int64_t vp9_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); int64_t vp9_block_error_avx2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); RTCD_EXTERN int64_t (*vp9_block_error)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); @@ -45,9 +46,9 @@ int vp9_diamond_search_sad_avx(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); RTCD_EXTERN int (*vp9_diamond_search_sad)(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); void vp9_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -82,11 +83,6 @@ int64_t vp9_highbd_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); #define vp9_highbd_block_error vp9_highbd_block_error_sse2 -int64_t vp9_highbd_block_error_8bit_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_avx(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -RTCD_EXTERN int64_t (*vp9_highbd_block_error_8bit)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); - void vp9_highbd_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); #define vp9_highbd_fht16x16 vp9_highbd_fht16x16_c @@ -117,10 +113,10 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit); #define vp9_highbd_post_proc_down_and_across vp9_highbd_post_proc_down_and_across_c -void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp vp9_highbd_quantize_fp_c -void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp_32x32 vp9_highbd_quantize_fp_32x32_c void vp9_highbd_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -138,14 +134,18 @@ void vp9_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_sse2 -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_32x32_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); + +void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +void vp9_scale_and_extend_frame_ssse3(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +RTCD_EXTERN void (*vp9_scale_and_extend_frame)(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); void vp9_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); void vp9_temporal_filter_apply_sse2(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -161,7 +161,7 @@ (void)flags; - vp9_block_error = vp9_block_error_c; + vp9_block_error = vp9_block_error_sse2; if (flags & HAS_AVX2) vp9_block_error = vp9_block_error_avx2; vp9_diamond_search_sad = vp9_diamond_search_sad_c; if (flags & HAS_AVX) vp9_diamond_search_sad = vp9_diamond_search_sad_avx; @@ -170,12 +170,12 @@ vp9_full_search_sad = vp9_full_search_sad_c; if (flags & HAS_SSE3) vp9_full_search_sad = vp9_full_search_sadx3; if (flags & HAS_SSE4_1) vp9_full_search_sad = vp9_full_search_sadx8; - vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_sse2; - if (flags & HAS_AVX) vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_avx; vp9_quantize_fp = vp9_quantize_fp_sse2; if (flags & HAS_SSSE3) vp9_quantize_fp = vp9_quantize_fp_ssse3; vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_c; if (flags & HAS_SSSE3) vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_ssse3; + vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_c; + if (flags & HAS_SSSE3) vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_ssse3; } #endif
diff --git a/third_party/libvpx/source/config/linux/x64/vpx_dsp_rtcd.h b/third_party/libvpx/source/config/linux/x64/vpx_dsp_rtcd.h index ac714cab..df2e81e7 100644 --- a/third_party/libvpx/source/config/linux/x64/vpx_dsp_rtcd.h +++ b/third_party/libvpx/source/config/linux/x64/vpx_dsp_rtcd.h
@@ -1488,7 +1488,8 @@ void vpx_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); -#define vpx_idct8x8_64_add vpx_idct8x8_64_add_sse2 +void vpx_idct8x8_64_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); +RTCD_EXTERN void (*vpx_idct8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride); int16_t vpx_int_pro_col_c(const uint8_t *ref, const int width); int16_t vpx_int_pro_col_sse2(const uint8_t *ref, const int width); @@ -2155,6 +2156,8 @@ if (flags & HAS_SSSE3) vpx_idct32x32_34_add = vpx_idct32x32_34_add_ssse3; vpx_idct8x8_12_add = vpx_idct8x8_12_add_sse2; if (flags & HAS_SSSE3) vpx_idct8x8_12_add = vpx_idct8x8_12_add_ssse3; + vpx_idct8x8_64_add = vpx_idct8x8_64_add_sse2; + if (flags & HAS_SSSE3) vpx_idct8x8_64_add = vpx_idct8x8_64_add_ssse3; vpx_lpf_horizontal_16 = vpx_lpf_horizontal_16_sse2; if (flags & HAS_AVX2) vpx_lpf_horizontal_16 = vpx_lpf_horizontal_16_avx2; vpx_lpf_horizontal_16_dual = vpx_lpf_horizontal_16_dual_sse2;
diff --git a/third_party/libvpx/source/config/mac/ia32/vp9_rtcd.h b/third_party/libvpx/source/config/mac/ia32/vp9_rtcd.h index ac968a9..6d869f9 100644 --- a/third_party/libvpx/source/config/mac/ia32/vp9_rtcd.h +++ b/third_party/libvpx/source/config/mac/ia32/vp9_rtcd.h
@@ -30,6 +30,7 @@ #endif int64_t vp9_block_error_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); +int64_t vp9_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); int64_t vp9_block_error_avx2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); RTCD_EXTERN int64_t (*vp9_block_error)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); @@ -45,9 +46,9 @@ int vp9_diamond_search_sad_avx(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); RTCD_EXTERN int (*vp9_diamond_search_sad)(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); void vp9_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -82,11 +83,6 @@ int64_t vp9_highbd_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); RTCD_EXTERN int64_t (*vp9_highbd_block_error)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); -int64_t vp9_highbd_block_error_8bit_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_avx(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -RTCD_EXTERN int64_t (*vp9_highbd_block_error_8bit)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); - void vp9_highbd_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); #define vp9_highbd_fht16x16 vp9_highbd_fht16x16_c @@ -117,10 +113,10 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit); #define vp9_highbd_post_proc_down_and_across vp9_highbd_post_proc_down_and_across_c -void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp vp9_highbd_quantize_fp_c -void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp_32x32 vp9_highbd_quantize_fp_32x32_c void vp9_highbd_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -138,13 +134,17 @@ void vp9_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); RTCD_EXTERN void (*vp9_iht8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c +void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +void vp9_scale_and_extend_frame_ssse3(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +RTCD_EXTERN void (*vp9_scale_and_extend_frame)(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); + void vp9_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); void vp9_temporal_filter_apply_sse2(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); RTCD_EXTERN void (*vp9_temporal_filter_apply)(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -160,6 +160,7 @@ (void)flags; vp9_block_error = vp9_block_error_c; + if (flags & HAS_SSE2) vp9_block_error = vp9_block_error_sse2; if (flags & HAS_AVX2) vp9_block_error = vp9_block_error_avx2; vp9_block_error_fp = vp9_block_error_fp_c; if (flags & HAS_SSE2) vp9_block_error_fp = vp9_block_error_fp_sse2; @@ -186,9 +187,6 @@ if (flags & HAS_SSE2) vp9_fwht4x4 = vp9_fwht4x4_sse2; vp9_highbd_block_error = vp9_highbd_block_error_c; if (flags & HAS_SSE2) vp9_highbd_block_error = vp9_highbd_block_error_sse2; - vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_c; - if (flags & HAS_SSE2) vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_sse2; - if (flags & HAS_AVX) vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_avx; vp9_iht16x16_256_add = vp9_iht16x16_256_add_c; if (flags & HAS_SSE2) vp9_iht16x16_256_add = vp9_iht16x16_256_add_sse2; vp9_iht4x4_16_add = vp9_iht4x4_16_add_c; @@ -197,6 +195,8 @@ if (flags & HAS_SSE2) vp9_iht8x8_64_add = vp9_iht8x8_64_add_sse2; vp9_quantize_fp = vp9_quantize_fp_c; if (flags & HAS_SSE2) vp9_quantize_fp = vp9_quantize_fp_sse2; + vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_c; + if (flags & HAS_SSSE3) vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_ssse3; vp9_temporal_filter_apply = vp9_temporal_filter_apply_c; if (flags & HAS_SSE2) vp9_temporal_filter_apply = vp9_temporal_filter_apply_sse2; }
diff --git a/third_party/libvpx/source/config/mac/ia32/vpx_dsp_rtcd.h b/third_party/libvpx/source/config/mac/ia32/vpx_dsp_rtcd.h index 20ab4d2..47fe5dd 100644 --- a/third_party/libvpx/source/config/mac/ia32/vpx_dsp_rtcd.h +++ b/third_party/libvpx/source/config/mac/ia32/vpx_dsp_rtcd.h
@@ -1445,10 +1445,12 @@ void vpx_idct32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_1024_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct32x32_1024_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct32x32_1024_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_135_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_1024_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct32x32_135_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct32x32_135_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest, int stride); @@ -1457,6 +1459,7 @@ void vpx_idct32x32_34_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_34_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct32x32_34_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct32x32_34_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride); @@ -1469,6 +1472,7 @@ void vpx_idct8x8_12_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_12_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct8x8_12_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct8x8_12_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_1_add_c(const tran_low_t *input, uint8_t *dest, int stride); @@ -1477,6 +1481,7 @@ void vpx_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct8x8_64_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride); int16_t vpx_int_pro_col_c(const uint8_t *ref, const int width); @@ -2581,22 +2586,27 @@ if (flags & HAS_SSE2) vpx_idct16x16_38_add = vpx_idct16x16_256_add_sse2; vpx_idct32x32_1024_add = vpx_idct32x32_1024_add_c; if (flags & HAS_SSE2) vpx_idct32x32_1024_add = vpx_idct32x32_1024_add_sse2; + if (flags & HAS_SSSE3) vpx_idct32x32_1024_add = vpx_idct32x32_1024_add_ssse3; vpx_idct32x32_135_add = vpx_idct32x32_135_add_c; if (flags & HAS_SSE2) vpx_idct32x32_135_add = vpx_idct32x32_1024_add_sse2; + if (flags & HAS_SSSE3) vpx_idct32x32_135_add = vpx_idct32x32_135_add_ssse3; vpx_idct32x32_1_add = vpx_idct32x32_1_add_c; if (flags & HAS_SSE2) vpx_idct32x32_1_add = vpx_idct32x32_1_add_sse2; vpx_idct32x32_34_add = vpx_idct32x32_34_add_c; if (flags & HAS_SSE2) vpx_idct32x32_34_add = vpx_idct32x32_34_add_sse2; + if (flags & HAS_SSSE3) vpx_idct32x32_34_add = vpx_idct32x32_34_add_ssse3; vpx_idct4x4_16_add = vpx_idct4x4_16_add_c; if (flags & HAS_SSE2) vpx_idct4x4_16_add = vpx_idct4x4_16_add_sse2; vpx_idct4x4_1_add = vpx_idct4x4_1_add_c; if (flags & HAS_SSE2) vpx_idct4x4_1_add = vpx_idct4x4_1_add_sse2; vpx_idct8x8_12_add = vpx_idct8x8_12_add_c; if (flags & HAS_SSE2) vpx_idct8x8_12_add = vpx_idct8x8_12_add_sse2; + if (flags & HAS_SSSE3) vpx_idct8x8_12_add = vpx_idct8x8_12_add_ssse3; vpx_idct8x8_1_add = vpx_idct8x8_1_add_c; if (flags & HAS_SSE2) vpx_idct8x8_1_add = vpx_idct8x8_1_add_sse2; vpx_idct8x8_64_add = vpx_idct8x8_64_add_c; if (flags & HAS_SSE2) vpx_idct8x8_64_add = vpx_idct8x8_64_add_sse2; + if (flags & HAS_SSSE3) vpx_idct8x8_64_add = vpx_idct8x8_64_add_ssse3; vpx_int_pro_col = vpx_int_pro_col_c; if (flags & HAS_SSE2) vpx_int_pro_col = vpx_int_pro_col_sse2; vpx_int_pro_row = vpx_int_pro_row_c;
diff --git a/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h b/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h index b102039..7d37d7b9 100644 --- a/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h +++ b/third_party/libvpx/source/config/mac/x64/vp9_rtcd.h
@@ -30,6 +30,7 @@ #endif int64_t vp9_block_error_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); +int64_t vp9_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); int64_t vp9_block_error_avx2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); RTCD_EXTERN int64_t (*vp9_block_error)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); @@ -45,9 +46,9 @@ int vp9_diamond_search_sad_avx(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); RTCD_EXTERN int (*vp9_diamond_search_sad)(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); void vp9_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -82,11 +83,6 @@ int64_t vp9_highbd_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); #define vp9_highbd_block_error vp9_highbd_block_error_sse2 -int64_t vp9_highbd_block_error_8bit_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_avx(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -RTCD_EXTERN int64_t (*vp9_highbd_block_error_8bit)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); - void vp9_highbd_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); #define vp9_highbd_fht16x16 vp9_highbd_fht16x16_c @@ -117,10 +113,10 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit); #define vp9_highbd_post_proc_down_and_across vp9_highbd_post_proc_down_and_across_c -void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp vp9_highbd_quantize_fp_c -void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp_32x32 vp9_highbd_quantize_fp_32x32_c void vp9_highbd_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -138,14 +134,18 @@ void vp9_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_sse2 -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_32x32_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); + +void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +void vp9_scale_and_extend_frame_ssse3(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +RTCD_EXTERN void (*vp9_scale_and_extend_frame)(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); void vp9_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); void vp9_temporal_filter_apply_sse2(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -161,7 +161,7 @@ (void)flags; - vp9_block_error = vp9_block_error_c; + vp9_block_error = vp9_block_error_sse2; if (flags & HAS_AVX2) vp9_block_error = vp9_block_error_avx2; vp9_diamond_search_sad = vp9_diamond_search_sad_c; if (flags & HAS_AVX) vp9_diamond_search_sad = vp9_diamond_search_sad_avx; @@ -170,12 +170,12 @@ vp9_full_search_sad = vp9_full_search_sad_c; if (flags & HAS_SSE3) vp9_full_search_sad = vp9_full_search_sadx3; if (flags & HAS_SSE4_1) vp9_full_search_sad = vp9_full_search_sadx8; - vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_sse2; - if (flags & HAS_AVX) vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_avx; vp9_quantize_fp = vp9_quantize_fp_sse2; if (flags & HAS_SSSE3) vp9_quantize_fp = vp9_quantize_fp_ssse3; vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_c; if (flags & HAS_SSSE3) vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_ssse3; + vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_c; + if (flags & HAS_SSSE3) vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_ssse3; } #endif
diff --git a/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h b/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h index ac714cab..df2e81e7 100644 --- a/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h +++ b/third_party/libvpx/source/config/mac/x64/vpx_dsp_rtcd.h
@@ -1488,7 +1488,8 @@ void vpx_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); -#define vpx_idct8x8_64_add vpx_idct8x8_64_add_sse2 +void vpx_idct8x8_64_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); +RTCD_EXTERN void (*vpx_idct8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride); int16_t vpx_int_pro_col_c(const uint8_t *ref, const int width); int16_t vpx_int_pro_col_sse2(const uint8_t *ref, const int width); @@ -2155,6 +2156,8 @@ if (flags & HAS_SSSE3) vpx_idct32x32_34_add = vpx_idct32x32_34_add_ssse3; vpx_idct8x8_12_add = vpx_idct8x8_12_add_sse2; if (flags & HAS_SSSE3) vpx_idct8x8_12_add = vpx_idct8x8_12_add_ssse3; + vpx_idct8x8_64_add = vpx_idct8x8_64_add_sse2; + if (flags & HAS_SSSE3) vpx_idct8x8_64_add = vpx_idct8x8_64_add_ssse3; vpx_lpf_horizontal_16 = vpx_lpf_horizontal_16_sse2; if (flags & HAS_AVX2) vpx_lpf_horizontal_16 = vpx_lpf_horizontal_16_avx2; vpx_lpf_horizontal_16_dual = vpx_lpf_horizontal_16_dual_sse2;
diff --git a/third_party/libvpx/source/config/nacl/vp9_rtcd.h b/third_party/libvpx/source/config/nacl/vp9_rtcd.h index c044e461..b0aa898f 100644 --- a/third_party/libvpx/source/config/nacl/vp9_rtcd.h +++ b/third_party/libvpx/source/config/nacl/vp9_rtcd.h
@@ -41,7 +41,7 @@ int vp9_diamond_search_sad_c(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); #define vp9_diamond_search_sad vp9_diamond_search_sad_c -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_fdct8x8_quant vp9_fdct8x8_quant_c void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -68,9 +68,6 @@ int64_t vp9_highbd_block_error_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); #define vp9_highbd_block_error vp9_highbd_block_error_c -int64_t vp9_highbd_block_error_8bit_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -#define vp9_highbd_block_error_8bit vp9_highbd_block_error_8bit_c - void vp9_highbd_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); #define vp9_highbd_fht16x16 vp9_highbd_fht16x16_c @@ -101,10 +98,10 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit); #define vp9_highbd_post_proc_down_and_across vp9_highbd_post_proc_down_and_across_c -void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp vp9_highbd_quantize_fp_c -void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp_32x32 vp9_highbd_quantize_fp_32x32_c void vp9_highbd_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -119,12 +116,15 @@ void vp9_iht8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_c -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp vp9_quantize_fp_c -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c +void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +#define vp9_scale_and_extend_frame vp9_scale_and_extend_frame_c + void vp9_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); #define vp9_temporal_filter_apply vp9_temporal_filter_apply_c
diff --git a/third_party/libvpx/source/config/vpx_version.h b/third_party/libvpx/source/config/vpx_version.h index d38bf2ad..2b51b30 100644 --- a/third_party/libvpx/source/config/vpx_version.h +++ b/third_party/libvpx/source/config/vpx_version.h
@@ -1,7 +1,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 6 #define VERSION_PATCH 1 -#define VERSION_EXTRA "235-g4d4231352" +#define VERSION_EXTRA "263-g8121f8547" #define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH)) -#define VERSION_STRING_NOSP "v1.6.1-235-g4d4231352" -#define VERSION_STRING " v1.6.1-235-g4d4231352" +#define VERSION_STRING_NOSP "v1.6.1-263-g8121f8547" +#define VERSION_STRING " v1.6.1-263-g8121f8547"
diff --git a/third_party/libvpx/source/config/win/ia32/vp9_rtcd.h b/third_party/libvpx/source/config/win/ia32/vp9_rtcd.h index ac968a9..6d869f9 100644 --- a/third_party/libvpx/source/config/win/ia32/vp9_rtcd.h +++ b/third_party/libvpx/source/config/win/ia32/vp9_rtcd.h
@@ -30,6 +30,7 @@ #endif int64_t vp9_block_error_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); +int64_t vp9_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); int64_t vp9_block_error_avx2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); RTCD_EXTERN int64_t (*vp9_block_error)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); @@ -45,9 +46,9 @@ int vp9_diamond_search_sad_avx(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); RTCD_EXTERN int (*vp9_diamond_search_sad)(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); void vp9_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -82,11 +83,6 @@ int64_t vp9_highbd_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); RTCD_EXTERN int64_t (*vp9_highbd_block_error)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); -int64_t vp9_highbd_block_error_8bit_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_avx(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -RTCD_EXTERN int64_t (*vp9_highbd_block_error_8bit)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); - void vp9_highbd_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); #define vp9_highbd_fht16x16 vp9_highbd_fht16x16_c @@ -117,10 +113,10 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit); #define vp9_highbd_post_proc_down_and_across vp9_highbd_post_proc_down_and_across_c -void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp vp9_highbd_quantize_fp_c -void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp_32x32 vp9_highbd_quantize_fp_32x32_c void vp9_highbd_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -138,13 +134,17 @@ void vp9_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); RTCD_EXTERN void (*vp9_iht8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_quantize_fp_32x32 vp9_quantize_fp_32x32_c +void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +void vp9_scale_and_extend_frame_ssse3(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +RTCD_EXTERN void (*vp9_scale_and_extend_frame)(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); + void vp9_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); void vp9_temporal_filter_apply_sse2(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); RTCD_EXTERN void (*vp9_temporal_filter_apply)(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -160,6 +160,7 @@ (void)flags; vp9_block_error = vp9_block_error_c; + if (flags & HAS_SSE2) vp9_block_error = vp9_block_error_sse2; if (flags & HAS_AVX2) vp9_block_error = vp9_block_error_avx2; vp9_block_error_fp = vp9_block_error_fp_c; if (flags & HAS_SSE2) vp9_block_error_fp = vp9_block_error_fp_sse2; @@ -186,9 +187,6 @@ if (flags & HAS_SSE2) vp9_fwht4x4 = vp9_fwht4x4_sse2; vp9_highbd_block_error = vp9_highbd_block_error_c; if (flags & HAS_SSE2) vp9_highbd_block_error = vp9_highbd_block_error_sse2; - vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_c; - if (flags & HAS_SSE2) vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_sse2; - if (flags & HAS_AVX) vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_avx; vp9_iht16x16_256_add = vp9_iht16x16_256_add_c; if (flags & HAS_SSE2) vp9_iht16x16_256_add = vp9_iht16x16_256_add_sse2; vp9_iht4x4_16_add = vp9_iht4x4_16_add_c; @@ -197,6 +195,8 @@ if (flags & HAS_SSE2) vp9_iht8x8_64_add = vp9_iht8x8_64_add_sse2; vp9_quantize_fp = vp9_quantize_fp_c; if (flags & HAS_SSE2) vp9_quantize_fp = vp9_quantize_fp_sse2; + vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_c; + if (flags & HAS_SSSE3) vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_ssse3; vp9_temporal_filter_apply = vp9_temporal_filter_apply_c; if (flags & HAS_SSE2) vp9_temporal_filter_apply = vp9_temporal_filter_apply_sse2; }
diff --git a/third_party/libvpx/source/config/win/ia32/vpx_dsp_rtcd.h b/third_party/libvpx/source/config/win/ia32/vpx_dsp_rtcd.h index 20ab4d2..47fe5dd 100644 --- a/third_party/libvpx/source/config/win/ia32/vpx_dsp_rtcd.h +++ b/third_party/libvpx/source/config/win/ia32/vpx_dsp_rtcd.h
@@ -1445,10 +1445,12 @@ void vpx_idct32x32_1024_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_1024_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct32x32_1024_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct32x32_1024_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_135_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_1024_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct32x32_135_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct32x32_135_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_1_add_c(const tran_low_t *input, uint8_t *dest, int stride); @@ -1457,6 +1459,7 @@ void vpx_idct32x32_34_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct32x32_34_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct32x32_34_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct32x32_34_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct4x4_16_add_c(const tran_low_t *input, uint8_t *dest, int stride); @@ -1469,6 +1472,7 @@ void vpx_idct8x8_12_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_12_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct8x8_12_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct8x8_12_add)(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_1_add_c(const tran_low_t *input, uint8_t *dest, int stride); @@ -1477,6 +1481,7 @@ void vpx_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); +void vpx_idct8x8_64_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); RTCD_EXTERN void (*vpx_idct8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride); int16_t vpx_int_pro_col_c(const uint8_t *ref, const int width); @@ -2581,22 +2586,27 @@ if (flags & HAS_SSE2) vpx_idct16x16_38_add = vpx_idct16x16_256_add_sse2; vpx_idct32x32_1024_add = vpx_idct32x32_1024_add_c; if (flags & HAS_SSE2) vpx_idct32x32_1024_add = vpx_idct32x32_1024_add_sse2; + if (flags & HAS_SSSE3) vpx_idct32x32_1024_add = vpx_idct32x32_1024_add_ssse3; vpx_idct32x32_135_add = vpx_idct32x32_135_add_c; if (flags & HAS_SSE2) vpx_idct32x32_135_add = vpx_idct32x32_1024_add_sse2; + if (flags & HAS_SSSE3) vpx_idct32x32_135_add = vpx_idct32x32_135_add_ssse3; vpx_idct32x32_1_add = vpx_idct32x32_1_add_c; if (flags & HAS_SSE2) vpx_idct32x32_1_add = vpx_idct32x32_1_add_sse2; vpx_idct32x32_34_add = vpx_idct32x32_34_add_c; if (flags & HAS_SSE2) vpx_idct32x32_34_add = vpx_idct32x32_34_add_sse2; + if (flags & HAS_SSSE3) vpx_idct32x32_34_add = vpx_idct32x32_34_add_ssse3; vpx_idct4x4_16_add = vpx_idct4x4_16_add_c; if (flags & HAS_SSE2) vpx_idct4x4_16_add = vpx_idct4x4_16_add_sse2; vpx_idct4x4_1_add = vpx_idct4x4_1_add_c; if (flags & HAS_SSE2) vpx_idct4x4_1_add = vpx_idct4x4_1_add_sse2; vpx_idct8x8_12_add = vpx_idct8x8_12_add_c; if (flags & HAS_SSE2) vpx_idct8x8_12_add = vpx_idct8x8_12_add_sse2; + if (flags & HAS_SSSE3) vpx_idct8x8_12_add = vpx_idct8x8_12_add_ssse3; vpx_idct8x8_1_add = vpx_idct8x8_1_add_c; if (flags & HAS_SSE2) vpx_idct8x8_1_add = vpx_idct8x8_1_add_sse2; vpx_idct8x8_64_add = vpx_idct8x8_64_add_c; if (flags & HAS_SSE2) vpx_idct8x8_64_add = vpx_idct8x8_64_add_sse2; + if (flags & HAS_SSSE3) vpx_idct8x8_64_add = vpx_idct8x8_64_add_ssse3; vpx_int_pro_col = vpx_int_pro_col_c; if (flags & HAS_SSE2) vpx_int_pro_col = vpx_int_pro_col_sse2; vpx_int_pro_row = vpx_int_pro_row_c;
diff --git a/third_party/libvpx/source/config/win/x64/vp9_rtcd.h b/third_party/libvpx/source/config/win/x64/vp9_rtcd.h index b102039..7d37d7b9 100644 --- a/third_party/libvpx/source/config/win/x64/vp9_rtcd.h +++ b/third_party/libvpx/source/config/win/x64/vp9_rtcd.h
@@ -30,6 +30,7 @@ #endif int64_t vp9_block_error_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); +int64_t vp9_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); int64_t vp9_block_error_avx2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); RTCD_EXTERN int64_t (*vp9_block_error)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); @@ -45,9 +46,9 @@ int vp9_diamond_search_sad_avx(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); RTCD_EXTERN int (*vp9_diamond_search_sad)(const struct macroblock *x, const struct search_site_config *cfg, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv); -void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_c(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_fdct8x8_quant_ssse3(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_fdct8x8_quant)(const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); void vp9_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); void vp9_fht16x16_sse2(const int16_t *input, tran_low_t *output, int stride, int tx_type); @@ -82,11 +83,6 @@ int64_t vp9_highbd_block_error_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd); #define vp9_highbd_block_error vp9_highbd_block_error_sse2 -int64_t vp9_highbd_block_error_8bit_c(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_sse2(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -int64_t vp9_highbd_block_error_8bit_avx(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); -RTCD_EXTERN int64_t (*vp9_highbd_block_error_8bit)(const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz); - void vp9_highbd_fht16x16_c(const int16_t *input, tran_low_t *output, int stride, int tx_type); #define vp9_highbd_fht16x16 vp9_highbd_fht16x16_c @@ -117,10 +113,10 @@ void vp9_highbd_post_proc_down_and_across_c(const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit); #define vp9_highbd_post_proc_down_and_across vp9_highbd_post_proc_down_and_across_c -void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp vp9_highbd_quantize_fp_c -void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_highbd_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); #define vp9_highbd_quantize_fp_32x32 vp9_highbd_quantize_fp_32x32_c void vp9_highbd_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -138,14 +134,18 @@ void vp9_iht8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride, int tx_type); #define vp9_iht8x8_64_add vp9_iht8x8_64_add_sse2 -void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_sse2(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_quantize_fp)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -void vp9_quantize_fp_32x32_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); -RTCD_EXTERN void (*vp9_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +void vp9_quantize_fp_32x32_ssse3(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); +RTCD_EXTERN void (*vp9_quantize_fp_32x32)(const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan); + +void vp9_scale_and_extend_frame_c(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +void vp9_scale_and_extend_frame_ssse3(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); +RTCD_EXTERN void (*vp9_scale_and_extend_frame)(const struct yv12_buffer_config *src, struct yv12_buffer_config *dst); void vp9_temporal_filter_apply_c(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); void vp9_temporal_filter_apply_sse2(uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count); @@ -161,7 +161,7 @@ (void)flags; - vp9_block_error = vp9_block_error_c; + vp9_block_error = vp9_block_error_sse2; if (flags & HAS_AVX2) vp9_block_error = vp9_block_error_avx2; vp9_diamond_search_sad = vp9_diamond_search_sad_c; if (flags & HAS_AVX) vp9_diamond_search_sad = vp9_diamond_search_sad_avx; @@ -170,12 +170,12 @@ vp9_full_search_sad = vp9_full_search_sad_c; if (flags & HAS_SSE3) vp9_full_search_sad = vp9_full_search_sadx3; if (flags & HAS_SSE4_1) vp9_full_search_sad = vp9_full_search_sadx8; - vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_sse2; - if (flags & HAS_AVX) vp9_highbd_block_error_8bit = vp9_highbd_block_error_8bit_avx; vp9_quantize_fp = vp9_quantize_fp_sse2; if (flags & HAS_SSSE3) vp9_quantize_fp = vp9_quantize_fp_ssse3; vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_c; if (flags & HAS_SSSE3) vp9_quantize_fp_32x32 = vp9_quantize_fp_32x32_ssse3; + vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_c; + if (flags & HAS_SSSE3) vp9_scale_and_extend_frame = vp9_scale_and_extend_frame_ssse3; } #endif
diff --git a/third_party/libvpx/source/config/win/x64/vpx_dsp_rtcd.h b/third_party/libvpx/source/config/win/x64/vpx_dsp_rtcd.h index ac714cab..df2e81e7 100644 --- a/third_party/libvpx/source/config/win/x64/vpx_dsp_rtcd.h +++ b/third_party/libvpx/source/config/win/x64/vpx_dsp_rtcd.h
@@ -1488,7 +1488,8 @@ void vpx_idct8x8_64_add_c(const tran_low_t *input, uint8_t *dest, int stride); void vpx_idct8x8_64_add_sse2(const tran_low_t *input, uint8_t *dest, int stride); -#define vpx_idct8x8_64_add vpx_idct8x8_64_add_sse2 +void vpx_idct8x8_64_add_ssse3(const tran_low_t *input, uint8_t *dest, int stride); +RTCD_EXTERN void (*vpx_idct8x8_64_add)(const tran_low_t *input, uint8_t *dest, int stride); int16_t vpx_int_pro_col_c(const uint8_t *ref, const int width); int16_t vpx_int_pro_col_sse2(const uint8_t *ref, const int width); @@ -2155,6 +2156,8 @@ if (flags & HAS_SSSE3) vpx_idct32x32_34_add = vpx_idct32x32_34_add_ssse3; vpx_idct8x8_12_add = vpx_idct8x8_12_add_sse2; if (flags & HAS_SSSE3) vpx_idct8x8_12_add = vpx_idct8x8_12_add_ssse3; + vpx_idct8x8_64_add = vpx_idct8x8_64_add_sse2; + if (flags & HAS_SSSE3) vpx_idct8x8_64_add = vpx_idct8x8_64_add_ssse3; vpx_lpf_horizontal_16 = vpx_lpf_horizontal_16_sse2; if (flags & HAS_AVX2) vpx_lpf_horizontal_16 = vpx_lpf_horizontal_16_avx2; vpx_lpf_horizontal_16_dual = vpx_lpf_horizontal_16_dual_sse2;
diff --git a/third_party/libxml/OWNERS b/third_party/libxml/OWNERS index 5f395a58..31021ad 100644 --- a/third_party/libxml/OWNERS +++ b/third_party/libxml/OWNERS
@@ -3,3 +3,6 @@ cpu@chromium.org dominicc@chromium.org scottmg@chromium.org + +# TEAM: blink-html-dom@chromium.org +# COMPONENT: Blink>XML
diff --git a/tools/android/eclipse/.classpath b/tools/android/eclipse/.classpath index b407515..5577636 100644 --- a/tools/android/eclipse/.classpath +++ b/tools/android/eclipse/.classpath
@@ -258,7 +258,7 @@ <classpathentry kind="lib" path="out/Debug/lib.java/components/invalidation/impl/proto_java.jar"/> <classpathentry kind="lib" path="out/Debug/lib.java/components/navigation_interception/android/navigation_interception_java.jar"/> <classpathentry kind="lib" path="out/Debug/lib.java/components/policy/android/policy_java.jar"/> - <classpathentry kind="lib" path="out/Debug/lib.java/components/payments/payment_request_java.jar"/> + <classpathentry kind="lib" path="out/Debug/lib.java/components/payments/content/payment_request_java.jar"/> <classpathentry kind="lib" path="out/Debug/lib.java/components/precache/android/precache_java.jar"/> <classpathentry kind="lib" path="out/Debug/lib.java/components/safe_json/android/safe_json_java.jar"/> <classpathentry kind="lib" path="out/Debug/lib.java/components/service_tab_launcher/service_tab_launcher_java.jar"/>
diff --git a/tools/chrome_proxy/webdriver/lofi.py b/tools/chrome_proxy/webdriver/lofi.py index 3e49e510..a0753b1a 100644 --- a/tools/chrome_proxy/webdriver/lofi.py +++ b/tools/chrome_proxy/webdriver/lofi.py
@@ -42,5 +42,37 @@ # Verify that Lo-Fi responses were seen. self.assertNotEqual(0, lofi_responses) + # Checks that a Lite Page is served and that the ignore_preview_blacklist + # experiment is being used. + def testLitePage(self): + with TestDriver() as test_driver: + test_driver.AddChromeArg('--enable-spdy-proxy-auth') + test_driver.AddChromeArg('--data-reduction-proxy-lo-fi=always-on') + test_driver.AddChromeArg('--enable-data-reduction-proxy-lite-page') + + test_driver.LoadURL('http://check.googlezip.net/test.html') + + lite_page_responses = 0 + for response in test_driver.GetHTTPResponses(): + # Skip CSI requests when validating Lite Page headers. CSI requests + # aren't expected to have LoFi headers. + if '/csi?' in response.url: + continue + if response.url.startswith('data:'): + continue + chrome_proxy_request = response.request_headers['chrome-proxy'] + cpat_request = response.request_headers['chrome-proxy-accept-transform'] + cpct_response = response.response_headers[ + 'chrome-proxy-content-transform'] + self.assertHasChromeProxyViaHeader(response) + self.assertIn('exp=ignore_preview_blacklist', + chrome_proxy_request) + if ('lite-page' in cpct_response): + lite_page_responses = lite_page_responses + 1 + self.assertIn('lite-page', cpat_request) + + # Verify that a Lite Page response for the main frame was seen. + self.assertEqual(1, lite_page_responses) + if __name__ == '__main__': IntegrationTest.RunAllTests()
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index b4417b8..94805ba 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -1206,7 +1206,7 @@ ], 'gpu_fyi_tests_chromeos_ozone_release_trybot': [ - 'gpu_fyi_tests', 'release_trybot', 'chromeos', 'ozone', 'ozone_linux', 'system_gbm_libdrm', + 'gpu_fyi_tests', 'release_trybot', 'ozone', 'ozone_linux', 'system_gbm_libdrm', ], 'gpu_fyi_tests_chromeos_release_trybot': [
diff --git a/tools/perf/docs/perf_regression_sheriffing.md b/tools/perf/docs/perf_regression_sheriffing.md index 6373faf..17a21e2 100644 --- a/tools/perf/docs/perf_regression_sheriffing.md +++ b/tools/perf/docs/perf_regression_sheriffing.md
@@ -25,8 +25,8 @@ Pick up **Chromium Perf Sheriff** from "Select an item ▼" drop down menu. There are two tables of alerts that may be shown: - * "Performance Alerts", which you should triage, and - * "Data Stoppage Alerts", which you can ignore. + * "Performance Alerts" + * "Data Stoppage Alerts" For either type of alert, if there are no currently pending alerts, then the table won't be shown. @@ -86,39 +86,9 @@ Data stoppage alerts are listed on the [perf dashboard alerts page](https://chromeperf.appspot.com/alerts). Whenever the dashboard is monitoring a metric, and that metric stops sending data, an -alert is fired. Some of these alerts are expected: - - * When a telemetry benchmark is disabled, we get a data stoppage alert. - Check the [code for the benchmark](https://code.google.com/p/chromium/codesearch#chromium/src/tools/perf/benchmarks/) - to see if it has been disabled, and if so associate the alert with the - bug for the disable. - * When a bot has been turned down. These should be announced to - perf-sheriffs@chromium.org, but if you can't find the bot on - [the waterfall](https://uberchromegw.corp.google.com/i/chromium.perf/) and - you didn't see the announcement, double check in the speed infra chat. - Ideally these will be associated with the bug for the bot turndown, but - it's okay to mark them invalid if you can't find the bug. - You can check the - [recipe](https://chromium.googlesource.com/chromium/tools/build/+/master/scripts/slave/recipe_modules/chromium_tests/chromium_perf.py) - to find a corresponding bot name for waterfall with one for dashboard. - -If there doesn't seem to be a valid reason for the alert, file a bug on it -using the perf dashboard, and cc [the owner](http://go/perf-owners). Then do -some diagnosis: - - * Look at the perf dashboard graph to see the last revision we got data for, - and note that in the bug. Click on the `buildbot stdio` link in the tooltip - to find the buildbot status page for the last good build, and increment - the build number to get the first build with no data, and note that in the - bug as well. Check for any changes to the test in the revision range. - * Go to the buildbot status page of the bot which should be running the test. - Is it running the test? If not, note that in the bug. - * If it is running the test and the test is failing, diagnose as a test - failure. - * If it is running the test and the test is passing, check the `json.output` - link on the buildbot status page for the test. This is the data the test - sent to the perf dashboard. Are there null values? Sometimes it lists a - reason as well. Please put your finding in the bug. +alert is fired. See +[triaging data stoppage alerts](triaging_data_stoppage_alerts.md) for more +details. ## Follow up on Performance Regressions
diff --git a/tools/perf/docs/triaging_data_stoppage_alerts.md b/tools/perf/docs/triaging_data_stoppage_alerts.md new file mode 100644 index 0000000..586c45d --- /dev/null +++ b/tools/perf/docs/triaging_data_stoppage_alerts.md
@@ -0,0 +1,51 @@ +# Triaging Data Stoppage Alerts + +## What is a data stoppage alert? +A data stoppage alert is a new type of alert on the perf dashboard. Instead of a +performance regression, it indicates that the dashboard is no longer receiving +data for the given monitored test. A bug created from a data stoppage alert has +a subject starting with **“No data received for…”**. + +## How to triage data stoppage alerts + +### Check if the alert is recovered. +Look at the graph and see if there are new points, if so, mark the alert +**ignored**. + +### File a bug +Use the triage dialog to file a bug about the failure, and track your +investigation. Cc the owner of the benchmark from +[go/chrome-benchmarks](http://goto.google.com/chrome-benchmarks). + +### Get the logs +Each alert has a debug button at the right-hand side of the table. It tries to +automatically find the last successful build and the first failed build. To get +the logs: + * First try the *"Logs"* link from *"Next revison built"* (this should be the + first failed revision). Sometimes this can't be generated properly, so it + may not work. + * Next try the *"Buildbot status page"* link from *"Next revision built"*. + This should take you to the next build. **If this page 404s, it's possible + the builder was taken down.** Check the waterfall. + +Once you have the logs, put the link in the bug and also paste relevant snippets +about the failure (error logs) in the bug. + +### Check for suspicious changes. +It has a link to *"View commit log from rXXX to rYYY"*, click the link to view +CLs in the range. Look through the range for test disables, telemetry/catapult +changes, and changes to the code under test. If you see a CL that looks like a +likely culprit, cc the author in the bug. + +### Kick off a bisect. +If the test is failing on the *"Next revision built"*, bisect may be able to +narrow down the culprit. Go to the graph, click a data point, and click the +bisect button in the tooltip. **You'll need to change the values for return_code +bisect as follows**: + * **Bug ID**: Make sure to fill in the ID of the bug you just filed. + Otherwise the bisect will not update it. + * **Earlier revision**: Change this to the *"Last revision uploaded"* from the + debug button dialog. + * **Later revision**: Change this to the *"Next revision built"* from the + debug button dialog. + * **Bisect mode**: Change this to **return_code**
diff --git a/ui/android/delegated_frame_host_android.cc b/ui/android/delegated_frame_host_android.cc index 489003b2..b2b73ce 100644 --- a/ui/android/delegated_frame_host_android.cc +++ b/ui/android/delegated_frame_host_android.cc
@@ -53,13 +53,9 @@ DelegatedFrameHostAndroid::DelegatedFrameHostAndroid( ui::ViewAndroid* view, - SkColor background_color, Client* client, const cc::FrameSinkId& frame_sink_id) - : frame_sink_id_(frame_sink_id), - view_(view), - client_(client), - background_layer_(cc::SolidColorLayer::Create()) { + : frame_sink_id_(frame_sink_id), view_(view), client_(client) { DCHECK(view_); DCHECK(client_); @@ -69,10 +65,6 @@ surface_manager_->RegisterFrameSinkId(frame_sink_id_); surface_factory_ = base::WrapUnique( new cc::SurfaceFactory(frame_sink_id_, surface_manager_, this)); - - background_layer_->SetBackgroundColor(background_color); - view_->GetLayer()->AddChild(background_layer_); - UpdateBackgroundLayer(); } DelegatedFrameHostAndroid::~DelegatedFrameHostAndroid() { @@ -80,7 +72,6 @@ surface_factory_.reset(); DetachFromCompositor(); surface_manager_->InvalidateFrameSinkId(frame_sink_id_); - background_layer_->RemoveFromParent(); } DelegatedFrameHostAndroid::FrameData::FrameData() = default; @@ -132,7 +123,6 @@ current_frame_->surface_size, !current_frame_->has_transparent_background); view_->GetLayer()->AddChild(content_layer_); - UpdateBackgroundLayer(); } else { surface_factory_->SubmitCompositorFrame(current_frame_->local_surface_id, std::move(frame), draw_callback); @@ -177,8 +167,6 @@ content_layer_ = nullptr; surface_factory_->EvictSurface(); current_frame_.reset(); - - UpdateBackgroundLayer(); } bool DelegatedFrameHostAndroid::HasDelegatedContent() const { @@ -190,20 +178,6 @@ surface_factory_->Reset(); } -void DelegatedFrameHostAndroid::UpdateBackgroundColor(SkColor color) { - background_layer_->SetBackgroundColor(color); -} - -void DelegatedFrameHostAndroid::UpdateContainerSizeinDIP( - const gfx::Size& size_in_dip) { - container_size_in_dip_ = size_in_dip; - float device_scale_factor = display::Screen::GetScreen() - ->GetDisplayNearestWindow(view_).device_scale_factor(); - background_layer_->SetBounds( - gfx::ConvertSizeToPixel(device_scale_factor, container_size_in_dip_)); - UpdateBackgroundLayer(); -} - void DelegatedFrameHostAndroid::AttachToCompositor( WindowAndroidCompositor* compositor) { if (registered_parent_compositor_) @@ -231,26 +205,4 @@ client_->SetBeginFrameSource(begin_frame_source); } -void DelegatedFrameHostAndroid::UpdateBackgroundLayer() { - // The background layer draws in 2 cases: - // 1) When we don't have any content from the renderer. - // 2) When the bounds of the content received from the renderer does not match - // the desired content bounds. - bool background_is_drawable = false; - - if (current_frame_) { - float device_scale_factor = display::Screen::GetScreen() - ->GetDisplayNearestWindow(view_).device_scale_factor(); - gfx::Size content_size_in_dip = gfx::ConvertSizeToDIP( - device_scale_factor, current_frame_->surface_size); - background_is_drawable = - content_size_in_dip.width() < container_size_in_dip_.width() || - content_size_in_dip.height() < container_size_in_dip_.height(); - } else { - background_is_drawable = true; - } - - background_layer_->SetIsDrawable(background_is_drawable); -} - } // namespace ui
diff --git a/ui/android/delegated_frame_host_android.h b/ui/android/delegated_frame_host_android.h index 9b47f7b43..8421d06 100644 --- a/ui/android/delegated_frame_host_android.h +++ b/ui/android/delegated_frame_host_android.h
@@ -17,7 +17,6 @@ namespace cc { class CompositorFrame; -class Layer; class SurfaceManager; class SurfaceLayer; class LocalSurfaceIdAllocator; @@ -40,7 +39,6 @@ }; DelegatedFrameHostAndroid(ViewAndroid* view, - SkColor background_color, Client* client, const cc::FrameSinkId& frame_sink_id); @@ -63,10 +61,6 @@ void CompositorFrameSinkChanged(); - void UpdateBackgroundColor(SkColor color); - - void UpdateContainerSizeinDIP(const gfx::Size& size_in_dip); - // Called when this DFH is attached/detached from a parent browser compositor // and needs to be attached to the surface hierarchy. void AttachToCompositor(WindowAndroidCompositor* compositor); @@ -77,8 +71,6 @@ void ReturnResources(const cc::ReturnedResourceArray& resources) override; void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; - void UpdateBackgroundLayer(); - const cc::FrameSinkId frame_sink_id_; ViewAndroid* view_; @@ -107,10 +99,6 @@ scoped_refptr<cc::SurfaceLayer> content_layer_; - scoped_refptr<cc::Layer> background_layer_; - - gfx::Size container_size_in_dip_; - DISALLOW_COPY_AND_ASSIGN(DelegatedFrameHostAndroid); };
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn index 8e1f152..15e9793 100644 --- a/ui/aura/BUILD.gn +++ b/ui/aura/BUILD.gn
@@ -88,8 +88,6 @@ "mus/mus_mouse_location_updater.cc", "mus/mus_mouse_location_updater.h", "mus/mus_types.h", - "mus/mus_util.cc", - "mus/mus_util.h", "mus/os_exchange_data_provider_mus.cc", "mus/os_exchange_data_provider_mus.h", "mus/property_converter.cc",
diff --git a/ui/aura/mus/mus_util.cc b/ui/aura/mus/mus_util.cc deleted file mode 100644 index f32e881..0000000 --- a/ui/aura/mus/mus_util.cc +++ /dev/null
@@ -1,30 +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 "ui/aura/mus/mus_util.h" - -#include "ui/aura/window.h" -#include "ui/base/class_property.h" - -namespace aura { -namespace { - -// This code uses Set/GetNativeWindowProperty instead of Set/GetProperty to -// avoid a dependency on mus. -const char kMusWindowKey[] = "mus"; - -} // namespace - -ui::Window* GetMusWindow(Window* window) { - if (!window) - return nullptr; - return static_cast<ui::Window*>( - window->GetNativeWindowProperty(kMusWindowKey)); -} - -void SetMusWindow(Window* window, ui::Window* mus_window) { - window->SetNativeWindowProperty(kMusWindowKey, mus_window); -} - -} // namespace aura
diff --git a/ui/aura/mus/mus_util.h b/ui/aura/mus/mus_util.h deleted file mode 100644 index 02d58a0..0000000 --- a/ui/aura/mus/mus_util.h +++ /dev/null
@@ -1,24 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_AURA_MUS_MUS_UTIL_H_ -#define UI_AURA_MUS_MUS_UTIL_H_ - -#include "ui/aura/aura_export.h" - -namespace ui { -class Window; -} - -namespace aura { - -class Window; - -AURA_EXPORT ui::Window* GetMusWindow(Window* window); - -AURA_EXPORT void SetMusWindow(Window* window, ui::Window* mus_window); - -} // namespace aura - -#endif // UI_AURA_MUS_MUS_UTIL_H_
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc index ed9cea1..00e186f0 100644 --- a/ui/gfx/canvas.cc +++ b/ui/gfx/canvas.cc
@@ -373,12 +373,14 @@ DrawDashedRect(rect, SK_ColorGRAY); } -void Canvas::DrawSolidFocusRect(RectF rect, SkColor color, float thickness) { +void Canvas::DrawSolidFocusRect(RectF rect, SkColor color, int thickness) { cc::PaintFlags flags; flags.setColor(color); - flags.setStrokeWidth(SkFloatToScalar(thickness)); + const float adjusted_thickness = + std::floor(thickness * image_scale_) / image_scale_; + flags.setStrokeWidth(SkFloatToScalar(adjusted_thickness)); flags.setStyle(cc::PaintFlags::kStroke_Style); - rect.Inset(gfx::InsetsF(thickness / 2)); + rect.Inset(gfx::InsetsF(adjusted_thickness / 2)); DrawRect(rect, flags); }
diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h index 4431261..5c0f50d2 100644 --- a/ui/gfx/canvas.h +++ b/ui/gfx/canvas.h
@@ -424,9 +424,10 @@ // Draws a dotted gray rectangle used for focus purposes. void DrawFocusRect(const RectF& rect); - // Draws a |rect| in the specified region with the specified |color| with a - // with of one logical pixel which might be more device pixels. - void DrawSolidFocusRect(RectF rect, SkColor color, float thickness); + // Draws a |rect| in the specified region with the specified |color|. The + // width of the stroke is |thickness| dip, but the actual pixel width will be + // floored to ensure an integral value. + void DrawSolidFocusRect(RectF rect, SkColor color, int thickness); // Tiles the image in the specified region. // Parameters are specified relative to current canvas scale not in pixels.
diff --git a/ui/views/controls/slider.cc b/ui/views/controls/slider.cc index eacd6aa2..0834df3 100644 --- a/ui/views/controls/slider.cc +++ b/ui/views/controls/slider.cc
@@ -198,7 +198,7 @@ SkColorSetA(GetNativeTheme()->GetSystemColor( ui::NativeTheme::kColorId_FocusedBorderColor), 0x99), - 2.f); + 2); } void Slider::OnSliderDragStarted() {
diff --git a/ui/views/painter.cc b/ui/views/painter.cc index ffb4bbb..4c4e69f2 100644 --- a/ui/views/painter.cc +++ b/ui/views/painter.cc
@@ -121,9 +121,7 @@ class SolidFocusPainter : public Painter { public: - SolidFocusPainter(SkColor color, - SkScalar thickness, - const gfx::InsetsF& insets); + SolidFocusPainter(SkColor color, int thickness, const gfx::InsetsF& insets); ~SolidFocusPainter() override; // Painter: @@ -132,14 +130,14 @@ private: const SkColor color_; - const SkScalar thickness_; + const int thickness_; const gfx::InsetsF insets_; DISALLOW_COPY_AND_ASSIGN(SolidFocusPainter); }; SolidFocusPainter::SolidFocusPainter(SkColor color, - SkScalar thickness, + int thickness, const gfx::InsetsF& insets) : color_(color), thickness_(thickness), insets_(insets) {} @@ -355,17 +353,15 @@ // Subtract that here so it works the same way with the new // Canvas::DrawSolidFocusRect. const gfx::Insets corrected_insets = insets - gfx::Insets(0, 0, 1, 1); - return base::MakeUnique<SolidFocusPainter>(color, SkIntToScalar(1), - corrected_insets); + return base::MakeUnique<SolidFocusPainter>(color, 1, corrected_insets); } // static std::unique_ptr<Painter> Painter::CreateSolidFocusPainter( SkColor color, - float thickness, + int thickness, const gfx::InsetsF& insets) { - return base::MakeUnique<SolidFocusPainter>(color, SkFloatToScalar(thickness), - insets); + return base::MakeUnique<SolidFocusPainter>(color, thickness, insets); } // HorizontalPainter ----------------------------------------------------------
diff --git a/ui/views/painter.h b/ui/views/painter.h index a018e04..57573363 100644 --- a/ui/views/painter.h +++ b/ui/views/painter.h
@@ -87,9 +87,10 @@ static std::unique_ptr<Painter> CreateSolidFocusPainter( SkColor color, const gfx::Insets& insets); + // |thickness| is in dip. static std::unique_ptr<Painter> CreateSolidFocusPainter( SkColor color, - SkScalar thickness, + int thickness, const gfx::InsetsF& insets); // Returns the minimum size this painter can paint without obvious graphical
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h index 505beb1..2a239c43 100644 --- a/ui/views/widget/widget.h +++ b/ui/views/widget/widget.h
@@ -57,7 +57,6 @@ class NativeTheme; class OSExchangeData; class ThemeProvider; -class Window; } // namespace ui namespace wm { @@ -254,8 +253,6 @@ // Whether the widget should be maximized or minimized. ui::WindowShowState show_state; gfx::NativeView parent; - // Used only by mus and is necessitated by mus not being a NativeView. - ui::Window* parent_mus = nullptr; // Specifies the initial bounds of the Widget. Default is empty, which means // the NativeWidget may specify a default size. If the parent is specified, // |bounds| is in the parent's coordinate system. If the parent is not