diff --git a/DEPS b/DEPS index 322c40c..5dd249ad 100644 --- a/DEPS +++ b/DEPS
@@ -145,11 +145,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '26cedb4c603b4f845d35711e35863742fcb1c8df', + 'skia_revision': 'e89768469dea381a4aa226a52902ac940a7b0a68', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '63ed65e390e83916b19ee8f1152b8fb704ebd7a4', + 'v8_revision': '2cb722f7a9261c5c679bf21cad56facac9c2b6df', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -157,11 +157,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'e54c3e3aa01cc5e1d0bbec28d6db619b22960bd3', + 'angle_revision': 'efa898aca21d771802f274df8afd28d73ab9aaa3', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': 'e662bb437032ddfec2e154a420376351ac0bd54d', + 'swiftshader_revision': '0b79e98b8bf7dbe8479e3d4625e35bf4c7587360', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. @@ -280,11 +280,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': 'ebb05399c09af7814a21aa555800656b4f5021b2', + 'dawn_revision': '8cb23933b12e61a5a66bce75d37e8f62dbe97f0d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': 'cf6c3e69df4ee038863066e00e47569be0d7082e', + 'quiche_revision': '05984adaf39cf75e8b3a7c3db1e406708bb48350', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -814,7 +814,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'bfed8088cbab538e1b0edc064363e4c0ae5be804', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'cc2856f2b4ac6cd1cf421e52df62ca4b0ad74af6', 'condition': 'checkout_linux', }, @@ -839,7 +839,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '1b4c7e9f38442e4b43fd4092d719e9627028125c', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '6d98232fdea6ac40a3955ca66c660c5b3cdd5def', 'src/third_party/devtools-node-modules': Var('chromium_git') + '/external/github.com/ChromeDevTools/devtools-node-modules' + '@' + Var('devtools_node_modules_revision'), @@ -1212,7 +1212,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'f3b064fc4807e17c78a055d6f30d20f73082fe2a', + Var('android_git') + '/platform/external/perfetto.git' + '@' + 'f1487e4ce2295eca7430d1f0707d1c50c552c418', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1380,7 +1380,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'abaae129d9a0c6e1e092067e0b105475df43352e', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'e4ba4ee837acb8dfc2045a1c63a39547da419d7e', + Var('webrtc_git') + '/src.git' + '@' + 'e427996c6174be0ce25d08d32da3c7be4f3792db', 'src/third_party/xdg-utils': { 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d', @@ -1421,7 +1421,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@794dd735e4f8881d05cecd3941b74b8b0448483c', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@d3f2cdbb53a7ed516cbf394de29264d0ca229981', 'condition': 'checkout_src_internal', },
diff --git a/WATCHLISTS b/WATCHLISTS index 712ee20..d6cca21b 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -1714,6 +1714,9 @@ 'chromeos/.*(language|keyboard)'\ '|chromeos/ime/*' }, + 'third_party_conflicts': { + 'filepath': 'chrome/browser/win/conflicts/' + }, 'timers': { 'filepath': 'base/timer/'\ '|components/timers/' @@ -2193,7 +2196,8 @@ 'martijn+crwatch@martijnc.be', 'rsleevi+watch@chromium.org'], 'chrome_cleaner': ['joenotcharles+watch@google.com'], - 'chrome_elf': ['caitkp+watch@chromium.org'], + 'chrome_elf': ['caitkp+watch@chromium.org', + 'pmonette+watch@chromium.org'], 'chrome_grc': ['chrome-grc-reviews@chromium.org'], 'chrome_performance_manager': ['performance-manager-reviews@chromium.org'], 'chromecast': ['alokp+watch@chromium.org', @@ -2609,6 +2613,7 @@ 'shuchen+watch@chromium.org', 'yhanada+watch@chromium.org', 'yusukes+watch@chromium.org'], + 'third_party_conflicts': ['pmonette+watch@chromium.org'], 'timers': [], 'tools_win_chromeexts': ['robliao+watch@chromium.org'], 'touch_selection': ['ajith.v@samsung.com',
diff --git a/android_webview/browser/aw_browser_context.cc b/android_webview/browser/aw_browser_context.cc index eab07ca..7d85a1b 100644 --- a/android_webview/browser/aw_browser_context.cc +++ b/android_webview/browser/aw_browser_context.cc
@@ -354,7 +354,7 @@ download::InProgressDownloadManager* AwBrowserContext::RetriveInProgressDownloadManager() { return new download::InProgressDownloadManager( - nullptr, base::FilePath(), + nullptr, base::FilePath(), nullptr, base::BindRepeating(&IgnoreOriginSecurityCheck), base::BindRepeating(&content::DownloadRequestUtils::IsURLSafe), nullptr); }
diff --git a/android_webview/browser/aw_feature_list_creator.cc b/android_webview/browser/aw_feature_list_creator.cc index 7ebcc32..08a8bb0 100644 --- a/android_webview/browser/aw_feature_list_creator.cc +++ b/android_webview/browser/aw_feature_list_creator.cc
@@ -36,6 +36,7 @@ #include "components/variations/pref_names.h" #include "components/variations/service/safe_seed_manager.h" #include "components/variations/service/variations_service.h" +#include "content/public/common/content_switch_dependent_feature_overrides.h" #include "services/preferences/tracked/segregated_pref_store.h" namespace android_webview { @@ -144,9 +145,11 @@ variations_field_trial_creator_->SetupFieldTrials( cc::switches::kEnableGpuBenchmarking, switches::kEnableFeatures, switches::kDisableFeatures, unforceable_field_trials, - std::vector<std::string>(), /*low_entropy_provider=*/nullptr, - std::make_unique<base::FeatureList>(), aw_field_trials_.get(), - &ignored_safe_seed_manager); + std::vector<std::string>(), + content::GetSwitchDependentFeatureOverrides( + *base::CommandLine::ForCurrentProcess()), + /*low_entropy_provider=*/nullptr, std::make_unique<base::FeatureList>(), + aw_field_trials_.get(), &ignored_safe_seed_manager); } void AwFeatureListCreator::CreateLocalState() {
diff --git a/android_webview/browser/aw_settings.cc b/android_webview/browser/aw_settings.cc index 9dd147f..a747358 100644 --- a/android_webview/browser/aw_settings.cc +++ b/android_webview/browser/aw_settings.cc
@@ -455,18 +455,9 @@ bool enable_supported_hardware_accelerated_features = Java_AwSettings_getEnableSupportedHardwareAcceleratedFeaturesLocked(env, obj); - - bool accelerated_2d_canvas_enabled_by_switch = - web_prefs->accelerated_2d_canvas_enabled; - web_prefs->accelerated_2d_canvas_enabled = true; - if (!accelerated_2d_canvas_enabled_by_switch || - !enable_supported_hardware_accelerated_features) { - // Any canvas smaller than this will fallback to software. Abusing this - // slightly to turn canvas off without changing - // accelerated_2d_canvas_enabled, which also affects compositing mode. - // Using 100M instead of max int to avoid overflows. - web_prefs->minimum_accelerated_2d_canvas_size = 100 * 1000 * 1000; - } + web_prefs->accelerated_2d_canvas_enabled = + web_prefs->accelerated_2d_canvas_enabled && + enable_supported_hardware_accelerated_features; // Always allow webgl. Webview always requires access to the GPU even if // it only does software draws. WebGL will not show up in software draw so // there is no more brokenness for user. This makes it easier for apps that
diff --git a/android_webview/lib/DEPS b/android_webview/lib/DEPS index 4f91aa7..06f115c 100644 --- a/android_webview/lib/DEPS +++ b/android_webview/lib/DEPS
@@ -9,7 +9,6 @@ "+gin/public", "+gin/v8_initializer.h", "+media/base/media_switches.h", # For media command line switches. - "+third_party/blink/public/common/features.h", "+ui/events/gesture_detection", "+ui/gl", ]
diff --git a/android_webview/lib/aw_main_delegate.cc b/android_webview/lib/aw_main_delegate.cc index 83049a64..f597a79 100644 --- a/android_webview/lib/aw_main_delegate.cc +++ b/android_webview/lib/aw_main_delegate.cc
@@ -55,7 +55,6 @@ #include "gpu/ipc/gl_in_process_context.h" #include "media/base/media_switches.h" #include "media/media_buildflags.h" -#include "third_party/blink/public/common/features.h" #include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_switches.h" #include "ui/events/gesture_detection/gesture_configuration.h" @@ -206,10 +205,6 @@ // TODO(https://crbug.com/963653): SmsReceiver is not yet supported on // WebView. features.DisableIfNotSet(::features::kSmsReceiver); - - // WebView relies on tweaking the size heuristic to dynamically enable - // or disable accelerated cavnas 2d. - features.DisableIfNotSet(blink::features::kAlwaysAccelerateCanvas); } android_webview::RegisterPathProvider();
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 340467bc..fd8d213 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -630,6 +630,7 @@ "sticky_keys/sticky_keys_state.h", "style/ash_color_provider.cc", "style/ash_color_provider.h", + "style/default_color_constants.h", "system/accessibility/accessibility_feature_disable_dialog.cc", "system/accessibility/accessibility_feature_disable_dialog.h", "system/accessibility/accessibility_feature_pod_controller.cc",
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc index 4dc5329..d3f4e48 100644 --- a/ash/login/ui/lock_contents_view.cc +++ b/ash/login/ui/lock_contents_view.cc
@@ -576,13 +576,14 @@ void LockContentsView::RequestSecurityTokenPin( SecurityTokenPinRequest request) { - // TODO(crbug.com/983103): Pick up the user whose authentication triggered - // this PIN attempt, based on the account identifier supplied by the - // cryptohome. - if (primary_big_view_ && primary_big_view_->auth_user()) - primary_big_view_->auth_user()->RequestSecurityTokenPin(std::move(request)); - else + if (!primary_big_view_ || !primary_big_view_->auth_user() || + primary_big_view_->GetCurrentUser().basic_user_info.account_id != + request.account_id) { + // The PIN request is obsolete. std::move(request.pin_ui_closed_callback).Run(); + return; + } + primary_big_view_->auth_user()->RequestSecurityTokenPin(std::move(request)); } void LockContentsView::ClearSecurityTokenPinRequest() {
diff --git a/ash/login/ui/lock_screen_media_controls_view.cc b/ash/login/ui/lock_screen_media_controls_view.cc index 2be0320..ada7f9b 100644 --- a/ash/login/ui/lock_screen_media_controls_view.cc +++ b/ash/login/ui/lock_screen_media_controls_view.cc
@@ -194,7 +194,9 @@ session_artwork_ = contents_view_->AddChildView(std::move(session_artwork)); progress_ = contents_view_->AddChildView( - std::make_unique<media_message_center::MediaControlsProgressView>()); + std::make_unique<media_message_center::MediaControlsProgressView>( + base::BindRepeating(&LockScreenMediaControlsView::SeekTo, + base::Unretained(this)))); // |button_row_| contains the buttons for controlling playback. auto button_row = std::make_unique<NonAccessibleView>(); @@ -410,13 +412,22 @@ if (hide_controls_timer_->IsRunning()) return; + position_ = position; + if (!position.has_value()) { - progress_->SetVisible(false); + if (progress_->GetVisible()) { + progress_->SetVisible(false); + Layout(); + } return; } progress_->UpdateProgress(*position); - progress_->SetVisible(true); + + if (!progress_->GetVisible()) { + progress_->SetVisible(true); + Layout(); + } } void LockScreenMediaControlsView::MediaControllerImageChanged( @@ -564,6 +575,12 @@ UpdateActionButtonsVisibility(); } +void LockScreenMediaControlsView::SeekTo(double seek_progress) { + DCHECK(position_.has_value()); + + media_controller_remote_->SeekTo(seek_progress * position_->duration()); +} + void LockScreenMediaControlsView::Dismiss() { media_controller_remote_->Stop(); hide_media_controls_.Run();
diff --git a/ash/login/ui/lock_screen_media_controls_view.h b/ash/login/ui/lock_screen_media_controls_view.h index dd2f1c5..5715845 100644 --- a/ash/login/ui/lock_screen_media_controls_view.h +++ b/ash/login/ui/lock_screen_media_controls_view.h
@@ -115,6 +115,10 @@ private: friend class LockScreenMediaControlsViewTest; + // Performs "SeekTo" through |media_controller_ptr_|. The seek time is + // calculated using |seek_progress| and the total duration of the media. + void SeekTo(double seek_progress); + // Hides the controls and stops media playback. void Dismiss(); @@ -175,6 +179,9 @@ // a current session. base::Optional<base::UnguessableToken> media_session_id_; + // The MediaPosition associated with the current media session. + base::Optional<media_session::MediaPosition> position_; + // Spacing between controls and user. std::unique_ptr<views::View> middle_spacing_;
diff --git a/ash/login/ui/lock_screen_media_controls_view_unittest.cc b/ash/login/ui/lock_screen_media_controls_view_unittest.cc index 494ce42..1bdfdcf 100644 --- a/ash/login/ui/lock_screen_media_controls_view_unittest.cc +++ b/ash/login/ui/lock_screen_media_controls_view_unittest.cc
@@ -725,4 +725,47 @@ EXPECT_TRUE(media_controls_view_->IsDrawn()); } +TEST_F(LockScreenMediaControlsViewTest, SeekToClick) { + EXPECT_EQ(0, media_controller()->seek_to_count()); + + media_session::MediaPosition media_position( + 1 /* playback_rate */, base::TimeDelta::FromSeconds(600) /* duration */, + base::TimeDelta::FromSeconds(100) /* position */); + + // Simulate initial position change. + media_controls_view_->MediaSessionPositionChanged(media_position); + + // Click exactly halfway on the progress bar. + ui::test::EventGenerator* generator = GetEventGenerator(); + generator->MoveMouseTo(progress_view()->GetBoundsInScreen().CenterPoint()); + generator->ClickLeftButton(); + + // Verify the media was seeked to its halfway point. + media_controls_view_->FlushForTesting(); + EXPECT_EQ(1, media_controller()->seek_to_count()); + EXPECT_EQ(base::TimeDelta::FromSeconds(300), + media_controller()->seek_to_time()); +} + +TEST_F(LockScreenMediaControlsViewTest, SeekToTouch) { + EXPECT_EQ(0, media_controller()->seek_to_count()); + + media_session::MediaPosition media_position( + 1 /* playback_rate */, base::TimeDelta::FromSeconds(600) /* duration */, + base::TimeDelta::FromSeconds(100) /* position */); + + // Simulate initial position change. + media_controls_view_->MediaSessionPositionChanged(media_position); + + // Tap exactly halfway on the progress bar. + ui::test::EventGenerator* generator = GetEventGenerator(); + generator->GestureTapAt(progress_view()->GetBoundsInScreen().CenterPoint()); + + // Verify the media was seeked to its halfway point. + media_controls_view_->FlushForTesting(); + EXPECT_EQ(1, media_controller()->seek_to_count()); + EXPECT_EQ(base::TimeDelta::FromSeconds(300), + media_controller()->seek_to_time()); +} + } // namespace ash
diff --git a/ash/login/ui/login_auth_user_view.cc b/ash/login/ui/login_auth_user_view.cc index 6ec1806..94ba792f 100644 --- a/ash/login/ui/login_auth_user_view.cc +++ b/ash/login/ui/login_auth_user_view.cc
@@ -506,7 +506,7 @@ cc::PaintFlags flags; flags.setStyle(cc::PaintFlags::kFill_Style); SkColor color = Shell::Get()->wallpaper_controller()->GetProminentColor( - color_utils::ColorProfile(color_utils::LumaRange::DARK, + color_utils::ColorProfile(color_utils::LumaRange::NORMAL, color_utils::SaturationRange::MUTED)); if (color == kInvalidWallpaperColor || color == SK_ColorTRANSPARENT) color = kDisabledAuthMessageBubbleColor; @@ -997,10 +997,12 @@ // Abort the security token PIN request associated with the previous user, if // there was any. AbortSecurityTokenPinRequest(); - + const bool user_changed = current_user().basic_user_info.account_id != + user.basic_user_info.account_id; user_view_->UpdateForUser(user, true /*animate*/); password_view_->UpdateForUser(user); - password_view_->Clear(); + if (user_changed) + password_view_->Clear(); online_sign_in_message_->SetText( base::UTF8ToUTF16(user.basic_user_info.display_name)); }
diff --git a/ash/login/ui/login_auth_user_view_unittest.cc b/ash/login/ui/login_auth_user_view_unittest.cc index cab177f..4c2d610 100644 --- a/ash/login/ui/login_auth_user_view_unittest.cc +++ b/ash/login/ui/login_auth_user_view_unittest.cc
@@ -217,4 +217,18 @@ views::Button::STATE_NORMAL); } +TEST_F(LoginAuthUserViewUnittest, PasswordFieldChangeOnUpdateUser) { + LoginAuthUserView::TestApi test_auth_user_view(view_); + LoginPasswordView::TestApi password_test(test_auth_user_view.password_view()); + + const auto password = base::ASCIIToUTF16("abc1"); + password_test.textfield()->SetText(password); + view_->UpdateForUser(user_); + EXPECT_EQ(password_test.textfield()->GetText(), password); + + auto another_user = CreateUser("user2@domain.com"); + view_->UpdateForUser(another_user); + EXPECT_TRUE(password_test.textfield()->GetText().empty()); +} + } // namespace ash
diff --git a/ash/login/ui/parent_access_view.cc b/ash/login/ui/parent_access_view.cc index 651e17a2..2f89aff 100644 --- a/ash/login/ui/parent_access_view.cc +++ b/ash/login/ui/parent_access_view.cc
@@ -636,7 +636,7 @@ session_manager::SessionState::ACTIVE) { SkColor extracted_color = Shell::Get()->wallpaper_controller()->GetProminentColor( - color_utils::ColorProfile(color_utils::LumaRange::DARK, + color_utils::ColorProfile(color_utils::LumaRange::NORMAL, color_utils::SaturationRange::MUTED)); if (extracted_color != kInvalidWallpaperColor && extracted_color != SK_ColorTRANSPARENT) {
diff --git a/ash/public/cpp/ash_switches.cc b/ash/public/cpp/ash_switches.cc index 06ddd3a7..b347dc8 100644 --- a/ash/public/cpp/ash_switches.cc +++ b/ash/public/cpp/ash_switches.cc
@@ -12,7 +12,6 @@ // Indicates the current color mode of ash. const char kAshColorMode[] = "ash-color-mode"; const char kAshColorModeDark[] = "dark"; -const char kAshColorModeDefault[] = "default"; const char kAshColorModeLight[] = "light"; // Force the pointer (cursor) position to be kept inside root windows.
diff --git a/ash/public/cpp/ash_switches.h b/ash/public/cpp/ash_switches.h index 97b0e14..f429738 100644 --- a/ash/public/cpp/ash_switches.h +++ b/ash/public/cpp/ash_switches.h
@@ -18,7 +18,6 @@ // TODO(sky): fix order! ASH_PUBLIC_EXPORT extern const char kAshColorMode[]; ASH_PUBLIC_EXPORT extern const char kAshColorModeDark[]; -ASH_PUBLIC_EXPORT extern const char kAshColorModeDefault[]; ASH_PUBLIC_EXPORT extern const char kAshColorModeLight[]; ASH_PUBLIC_EXPORT extern const char kAshConstrainPointerToRoot[]; ASH_PUBLIC_EXPORT extern const char kAshDebugShortcuts[];
diff --git a/ash/public/cpp/login_types.h b/ash/public/cpp/login_types.h index 3d9e211..ae83bb0 100644 --- a/ash/public/cpp/login_types.h +++ b/ash/public/cpp/login_types.h
@@ -12,6 +12,7 @@ #include "base/token.h" #include "chromeos/components/proximity_auth/public/mojom/auth_type.mojom-forward.h" #include "chromeos/constants/security_token_pin_types.h" +#include "components/account_id/account_id.h" namespace ash { @@ -308,6 +309,9 @@ SecurityTokenPinRequest& operator=(SecurityTokenPinRequest&&); ~SecurityTokenPinRequest(); + // The user whose authentication triggered this PIN request. + AccountId account_id; + // Type of the code requested from the user. chromeos::SecurityTokenPinCodeType code_type = chromeos::SecurityTokenPinCodeType::kPin;
diff --git a/ash/shell.cc b/ash/shell.cc index c2413a8a..8a20576 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -1148,17 +1148,10 @@ std::make_unique<ScreenOrientationController>(); screen_layout_observer_.reset(new ScreenLayoutObserver()); sms_observer_.reset(new SmsObserver()); - split_view_controller_.reset(new SplitViewController()); - snap_controller_ = std::make_unique<SnapControllerImpl>(); - key_accessibility_enabler_ = std::make_unique<KeyAccessibilityEnabler>(); - - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kAshColorMode)) { - ash_color_provider_ = std::make_unique<AshColorProvider>(); - } + ash_color_provider_ = std::make_unique<AshColorProvider>(); // The compositor thread and main message loop have to be running in // order to create mirror window. Run it after the main message loop
diff --git a/ash/style/ash_color_provider.cc b/ash/style/ash_color_provider.cc index 891d2d9..797bd85 100644 --- a/ash/style/ash_color_provider.cc +++ b/ash/style/ash_color_provider.cc
@@ -5,6 +5,7 @@ #include "ash/style/ash_color_provider.h" #include "ash/public/cpp/ash_switches.h" +#include "ash/shell.h" #include "base/command_line.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" @@ -44,7 +45,77 @@ AshColorProvider::~AshColorProvider() = default; -SkColor AshColorProvider::GetShieldLayerColor(ShieldLayerType type) const { +// static +AshColorProvider* AshColorProvider::Get() { + return Shell::Get()->ash_color_provider(); +} + +SkColor AshColorProvider::DeprecatedGetShieldLayerColor( + ShieldLayerType type, + SkColor default_color) const { + if (color_mode_ == AshColorMode::kDefault) + return default_color; + + return GetShieldLayerColorImpl(type, color_mode_); +} + +SkColor AshColorProvider::GetShieldLayerColor( + ShieldLayerType type, + AshColorMode given_color_mode) const { + AshColorMode color_mode = + color_mode_ != AshColorMode::kDefault ? color_mode_ : given_color_mode; + DCHECK(color_mode != AshColorMode::kDefault); + return GetShieldLayerColorImpl(type, color_mode); +} + +SkColor AshColorProvider::DeprecatedGetBaseLayerColor( + BaseLayerType type, + SkColor default_color) const { + if (color_mode_ == AshColorMode::kDefault) + return default_color; + + return GetBaseLayerColorImpl(type, color_mode_); +} + +SkColor AshColorProvider::GetBaseLayerColor( + BaseLayerType type, + AshColorMode given_color_mode) const { + AshColorMode color_mode = + color_mode_ != AshColorMode::kDefault ? color_mode_ : given_color_mode; + DCHECK(color_mode != AshColorMode::kDefault); + return GetBaseLayerColorImpl(type, color_mode); +} + +SkColor AshColorProvider::DeprecatedGetControlsLayerColor( + ControlsLayerType type, + SkColor default_color) const { + if (color_mode_ == AshColorMode::kDefault) + return default_color; + + return GetControlsLayerColorImpl(type, color_mode_); +} + +SkColor AshColorProvider::GetControlsLayerColor( + ControlsLayerType type, + AshColorMode given_color_mode) const { + AshColorMode color_mode = + color_mode_ != AshColorMode::kDefault ? color_mode_ : given_color_mode; + DCHECK(color_mode != AshColorMode::kDefault); + return GetControlsLayerColorImpl(type, color_mode); +} + +AshColorProvider::RippleAttributes AshColorProvider::GetRippleAttributes( + SkColor bg_color) const { + const SkColor base_color = color_utils::GetColorWithMaxContrast(bg_color); + const float opacity = color_utils::IsDark(base_color) + ? kDarkInkRippleOpacity + : kLightInkRippleOpacity; + return RippleAttributes(base_color, opacity, opacity); +} + +SkColor AshColorProvider::GetShieldLayerColorImpl( + ShieldLayerType type, + AshColorMode color_mode) const { SkColor light_color, dark_color; switch (type) { case ShieldLayerType::kAlpha20: @@ -60,10 +131,11 @@ dark_color = SkColorSetA(gfx::kGoogleGrey900, 0x99); break; } - return SelectColorOnMode(light_color, dark_color); + return color_mode == AshColorMode::kLight ? light_color : dark_color; } -SkColor AshColorProvider::GetBaseLayerColor(BaseLayerType type) const { +SkColor AshColorProvider::GetBaseLayerColorImpl(BaseLayerType type, + AshColorMode color_mode) const { SkColor light_color, dark_color; switch (type) { case BaseLayerType::kTransparentWithBlur: @@ -79,10 +151,12 @@ dark_color = gfx::kGoogleGrey900; break; } - return SelectColorOnMode(light_color, dark_color); + return color_mode == AshColorMode::kLight ? light_color : dark_color; } -SkColor AshColorProvider::GetControlsLayerColor(ControlsLayerType type) const { +SkColor AshColorProvider::GetControlsLayerColorImpl( + ControlsLayerType type, + AshColorMode color_mode) const { SkColor light_color, dark_color; switch (type) { case ControlsLayerType::kHairlineBorder: @@ -100,28 +174,7 @@ dark_color = gfx::kGoogleBlue300; break; } - return SelectColorOnMode(light_color, dark_color); -} - -AshColorProvider::RippleAttributes AshColorProvider::GetRippleAttributes( - SkColor bg_color) const { - const SkColor base_color = color_utils::GetColorWithMaxContrast(bg_color); - const float opacity = color_utils::IsDark(base_color) - ? kDarkInkRippleOpacity - : kLightInkRippleOpacity; - return RippleAttributes(base_color, opacity, opacity); -} - -SkColor AshColorProvider::SelectColorOnMode(SkColor light_color, - SkColor dark_color) const { - if (color_mode_ == AshColorMode::kLight) - return light_color; - if (color_mode_ == AshColorMode::kDark) - return dark_color; - - LOG(ERROR) << "Current color mode is AshColorMode::kDefault and should not " - << "retrieve color from AshColorProvider."; - return SK_ColorTRANSPARENT; + return color_mode == AshColorMode::kLight ? light_color : dark_color; } } // namespace ash
diff --git a/ash/style/ash_color_provider.h b/ash/style/ash_color_provider.h index 267e4bf9..abbf37f9 100644 --- a/ash/style/ash_color_provider.h +++ b/ash/style/ash_color_provider.h
@@ -21,8 +21,9 @@ // be the combination of the colors of the three layers. class AshColorProvider { public: - // The color mode of system UI. It is controlled by the feature flag - // "--ash-color-mode" currently. + // The color mode of system UI. Switch "--ash-color-mode" can only set + // |color_mode_| to |kLight| or |kDark|, |color_mode_| will be |kDefault| if + // the flag is not set. enum class AshColorMode { // This is the color mode of current system UI, which is a combination of // dark and light mode. e.g, shelf and system tray are dark while many other @@ -79,10 +80,34 @@ AshColorProvider(); ~AshColorProvider(); - // Gets the color of corresponding layer for specific type. - SkColor GetShieldLayerColor(ShieldLayerType type) const; - SkColor GetBaseLayerColor(BaseLayerType type) const; - SkColor GetControlsLayerColor(ControlsLayerType type) const; + static AshColorProvider* Get(); + + // Gets color of Shield layer. See details at the corresponding function of + // Base layer. + SkColor DeprecatedGetShieldLayerColor(ShieldLayerType type, + SkColor default_color) const; + SkColor GetShieldLayerColor(ShieldLayerType type, + AshColorMode given_color_mode) const; + + // Used by UI elements that need to support |kDefault| mode to get the color + // of base layer. |default_color| is provided while |color_mode_| is not set. + // Otherwise, gets the base layer color on |type| and |color_mode_|. Note, + // this function will be removed after launch dark/light mode. + SkColor DeprecatedGetBaseLayerColor(BaseLayerType type, + SkColor default_color) const; + // Used by new specs to get the color of base layer. |given_color_mode| is + // provided since the colors of new specs will always follow |kLight| or + // |kDark| mode. But |color_mode_| should have higher priority, gets the color + // on |color_mode_| instead if it is set. + SkColor GetBaseLayerColor(BaseLayerType type, + AshColorMode given_color_mode) const; + + // Gets color of Controls layer. See details at the corresponding function of + // Base layer. + SkColor DeprecatedGetControlsLayerColor(ControlsLayerType type, + SkColor default_color) const; + SkColor GetControlsLayerColor(ControlsLayerType type, + AshColorMode given_color_mode) const; // Gets the attributes of ripple on |bg_color|. |bg_color| is the background // color of the UI element that wants to show inkdrop. @@ -91,8 +116,23 @@ AshColorMode color_mode() const { return color_mode_; } private: - // Selects from |light_color| and |dark_color| based on |color_mode_|. - SkColor SelectColorOnMode(SkColor light_color, SkColor dark_color) const; + // Gets Shield layer color on |type| and |color_mode|. This function will be + // merged into GetShieldLayerColor after DeprecatedGetShieldLayerColor got be + // removed. + SkColor GetShieldLayerColorImpl(ShieldLayerType type, + AshColorMode color_mode) const; + + // Gets Base layer color on |type| and |color_mode|. This function will be + // merged into GetBaseLayerColor after DeprecatedGetBaseLayerColor got be + // removed. + SkColor GetBaseLayerColorImpl(BaseLayerType type, + AshColorMode color_mode) const; + + // Gets Controls layer color on |type| and |color_mode|. This function will be + // merged into GetControlsLayerColor after DeprecatedGetControlsLayerColor got + // be removed. + SkColor GetControlsLayerColorImpl(ControlsLayerType type, + AshColorMode color_mode) const; // Current color mode of system UI. AshColorMode color_mode_ = AshColorMode::kDefault;
diff --git a/ash/style/default_color_constants.h b/ash/style/default_color_constants.h new file mode 100644 index 0000000..32fe744 --- /dev/null +++ b/ash/style/default_color_constants.h
@@ -0,0 +1,30 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_ +#define ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_ + +#include "ui/gfx/color_palette.h" + +// Colors used by AshColorMode::kDefault mode of system UI. Only old specs needs +// to support |kDefault| mode. New specs will always follow colors for |kLight| +// or |kDark| mode. Note, don't add new colors to this file since this file and +// related logic will be removed after launch dark/light mode. + +// Colors for status area trays, includs system tray, IME, stylus and +// notifications. +//----------------------------------Begin-------------------------------------- +constexpr SkColor kUnifiedMenuBackgroundColor = + SkColorSetA(gfx::kGoogleGrey900, 0xf2); // 95% +constexpr SkColor kUnifiedMenuBackgroundColorWithBlur = + SkColorSetA(kUnifiedMenuBackgroundColor, 0x99); // 60% + +// Colors of separator on light/dark background. +constexpr SkColor kSeparatorOnLightBackgroundColor = + SkColorSetA(SK_ColorBLACK, 0x23); // 14% +constexpr SkColor kSeparatorOnDarkBackgroundColor = + SkColorSetA(SK_ColorWHITE, 0x23); // 14% +//----------------------------------End---------------------------------------- + +#endif // ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_
diff --git a/ash/system/accessibility/autoclick_menu_view.cc b/ash/system/accessibility/autoclick_menu_view.cc index 7b04fb3..22e46b9 100644 --- a/ash/system/accessibility/autoclick_menu_view.cc +++ b/ash/system/accessibility/autoclick_menu_view.cc
@@ -8,6 +8,8 @@ #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/tray/tray_constants.h" #include "ash/system/unified/top_shortcut_button.h" #include "base/metrics/histogram_macros.h" @@ -213,7 +215,9 @@ AddChildView(action_button_container); views::Separator* separator = new views::Separator(); - separator->SetColor(kSeparatorOnDarkBackgroundColor); + separator->SetColor(AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnDarkBackgroundColor)); separator->SetPreferredHeight(kSeparatorHeight); int total_height = kUnifiedTopShortcutSpacing * 2 + kTrayItemSize; int separator_spacing = (total_height - kSeparatorHeight) / 2;
diff --git a/ash/system/ime_menu/ime_menu_tray.cc b/ash/system/ime_menu/ime_menu_tray.cc index fdc3073..756032e 100644 --- a/ash/system/ime_menu/ime_menu_tray.cc +++ b/ash/system/ime_menu/ime_menu_tray.cc
@@ -17,6 +17,8 @@ #include "ash/shelf/shelf.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/ime_menu/ime_list_view.h" #include "ash/system/model/system_tray_model.h" #include "ash/system/tray/detailed_view_delegate.h" @@ -127,8 +129,11 @@ public: explicit ImeTitleView(bool show_settings_button) : settings_button_(nullptr) { SetBorder(views::CreatePaddedBorder( - views::CreateSolidSidedBorder(0, 0, kMenuSeparatorWidth, 0, - kSeparatorOnLightBackgroundColor), + views::CreateSolidSidedBorder( + 0, 0, kMenuSeparatorWidth, 0, + AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnLightBackgroundColor)), gfx::Insets(kMenuSeparatorVerticalPadding - kMenuSeparatorWidth, 0))); auto box_layout = std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kHorizontal); @@ -230,8 +235,11 @@ box_layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight); SetLayoutManager(std::move(box_layout)); SetBorder(views::CreatePaddedBorder( - views::CreateSolidSidedBorder(kMenuSeparatorWidth, 0, 0, 0, - kSeparatorOnLightBackgroundColor), + views::CreateSolidSidedBorder( + kMenuSeparatorWidth, 0, 0, 0, + AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnLightBackgroundColor)), gfx::Insets(kMenuSeparatorVerticalPadding - kMenuSeparatorWidth, kMenuExtraMarginFromLeftEdge)));
diff --git a/ash/system/message_center/unified_message_center_view.cc b/ash/system/message_center/unified_message_center_view.cc index 84f24cb6..ac83bdd 100644 --- a/ash/system/message_center/unified_message_center_view.cc +++ b/ash/system/message_center/unified_message_center_view.cc
@@ -11,6 +11,8 @@ #include "ash/session/session_controller_impl.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/message_center/ash_message_center_lock_screen_controller.h" #include "ash/system/message_center/message_center_scroll_bar.h" #include "ash/system/message_center/unified_message_list_view.h" @@ -243,7 +245,9 @@ canvas->DrawSharpLine( gfx::PointF(bounds.bottom_left() - gfx::Vector2d(0, 1)), gfx::PointF(bounds.bottom_right() - gfx::Vector2d(0, 1)), - kSeparatorOnLightBackgroundColor); + AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnLightBackgroundColor)); } const char* StackingNotificationCounterView::GetClassName() const {
diff --git a/ash/system/message_center/unified_message_list_view.cc b/ash/system/message_center/unified_message_list_view.cc index 409c5c7..a31822e 100644 --- a/ash/system/message_center/unified_message_list_view.cc +++ b/ash/system/message_center/unified_message_list_view.cc
@@ -5,6 +5,8 @@ #include "ash/system/message_center/unified_message_list_view.h" #include "ash/public/cpp/ash_features.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/message_center/message_center_style.h" #include "ash/system/message_center/notification_swipe_control_view.h" #include "ash/system/message_center/unified_message_center_view.h" @@ -87,10 +89,13 @@ // at the top or the bottom. void UpdateBorder(bool is_top, bool is_bottom) { message_view_->SetBorder( - is_bottom ? views::NullBorder() - : views::CreateSolidSidedBorder( - 0, 0, kUnifiedNotificationSeparatorThickness, 0, - kSeparatorOnLightBackgroundColor)); + is_bottom + ? views::NullBorder() + : views::CreateSolidSidedBorder( + 0, 0, kUnifiedNotificationSeparatorThickness, 0, + AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnLightBackgroundColor))); const int top_radius = is_top ? kUnifiedTrayCornerRadius : 0; const int bottom_radius = is_bottom ? kUnifiedTrayCornerRadius : 0; message_view_->UpdateCornerRadius(top_radius, bottom_radius);
diff --git a/ash/system/palette/palette_tray.cc b/ash/system/palette/palette_tray.cc index d160bd7a6..555ce9f 100644 --- a/ash/system/palette/palette_tray.cc +++ b/ash/system/palette/palette_tray.cc
@@ -16,6 +16,8 @@ #include "ash/shelf/shelf_constants.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/model/system_tray_model.h" #include "ash/system/palette/palette_tool_manager.h" #include "ash/system/palette/palette_utils.h" @@ -497,7 +499,9 @@ // Add horizontal separator between the title and tools. auto* separator = new views::Separator(); - separator->SetColor(kSeparatorOnLightBackgroundColor); + separator->SetColor(AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnLightBackgroundColor)); separator->SetBorder(views::CreateEmptyBorder(gfx::Insets( kPaddingBetweenTitleAndSeparator, 0, kMenuSeparatorVerticalPadding, 0))); bubble_view->AddChildView(separator);
diff --git a/ash/system/tray/detailed_view_delegate.cc b/ash/system/tray/detailed_view_delegate.cc index 03cedddee..a750e6f 100644 --- a/ash/system/tray/detailed_view_delegate.cc +++ b/ash/system/tray/detailed_view_delegate.cc
@@ -6,6 +6,8 @@ #include "ash/resources/vector_icons/vector_icons.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/tray_constants.h" #include "ash/system/tray/tray_popup_item_style.h" @@ -145,7 +147,9 @@ views::View* DetailedViewDelegate::CreateTitleSeparator() { views::Separator* separator = new views::Separator(); - separator->SetColor(kSeparatorOnDarkBackgroundColor); + separator->SetColor(AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnDarkBackgroundColor)); separator->SetBorder(views::CreateEmptyBorder( kTitleRowProgressBarHeight - views::Separator::kThickness, 0, 0, 0)); return separator; @@ -155,8 +159,11 @@ bool show_separator) { if (show_separator) { view->SetBorder(views::CreatePaddedBorder( - views::CreateSolidSidedBorder(0, 0, kTraySeparatorWidth, 0, - kSeparatorOnDarkBackgroundColor), + views::CreateSolidSidedBorder( + 0, 0, kTraySeparatorWidth, 0, + AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnDarkBackgroundColor)), gfx::Insets(kMenuSeparatorVerticalPadding, 0, kMenuSeparatorVerticalPadding - kTraySeparatorWidth, 0))); } else { @@ -168,7 +175,9 @@ views::Separator* DetailedViewDelegate::CreateListSubHeaderSeparator() { views::Separator* separator = new views::Separator(); - separator->SetColor(kSeparatorOnDarkBackgroundColor); + separator->SetColor(AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnDarkBackgroundColor)); separator->SetBorder(views::CreateEmptyBorder( kMenuSeparatorVerticalPadding - views::Separator::kThickness, 0, 0, 0)); return separator;
diff --git a/ash/system/tray/tray_constants.h b/ash/system/tray/tray_constants.h index 73403bc..02d19531 100644 --- a/ash/system/tray/tray_constants.h +++ b/ash/system/tray/tray_constants.h
@@ -71,12 +71,6 @@ // in tray detailed views. constexpr int kTraySeparatorWidth = 0; -// Colors of separator on light/dark background. -constexpr SkColor kSeparatorOnLightBackgroundColor = - SkColorSetA(SK_ColorBLACK, 0x23); // 14% -constexpr SkColor kSeparatorOnDarkBackgroundColor = - SkColorSetA(SK_ColorWHITE, 0x23); // 14% - // Primary colors of icon on light/dark background. Color of disabled icon is // 38% of corresponding non-disabled icon. constexpr SkColor kIconOnDarkBackgroundColor = gfx::kGoogleGrey200; @@ -127,10 +121,6 @@ // The radius used to draw the corners of the rounded rect style ink drops. extern const int kTrayPopupInkDropCornerRadius; -constexpr SkColor kUnifiedMenuBackgroundColor = - SkColorSetARGB(0xf2, 0x20, 0x21, 0x24); -constexpr SkColor kUnifiedMenuBackgroundColorWithBlur = - SkColorSetA(kUnifiedMenuBackgroundColor, 0x99); constexpr float kUnifiedMenuBackgroundBlur = 30.f; constexpr SkColor kUnifiedMenuTextColor = SkColorSetRGB(0xf1, 0xf3, 0xf4); constexpr SkColor kUnifiedMenuSecondaryTextColor =
diff --git a/ash/system/tray/tray_detailed_view.cc b/ash/system/tray/tray_detailed_view.cc index 2268154..30693ed 100644 --- a/ash/system/tray/tray_detailed_view.cc +++ b/ash/system/tray/tray_detailed_view.cc
@@ -8,6 +8,8 @@ #include "ash/public/cpp/ash_view_ids.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/tray/detailed_view_delegate.h" #include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/system_menu_button.h" @@ -241,8 +243,11 @@ gfx::Canvas* canvas = recorder.canvas(); cc::PaintFlags flags; gfx::ShadowValues shadow; - shadow.emplace_back(gfx::Vector2d(0, kShadowOffsetY), kShadowBlur, - kSeparatorOnDarkBackgroundColor); + shadow.emplace_back( + gfx::Vector2d(0, kShadowOffsetY), kShadowBlur, + AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnDarkBackgroundColor)); flags.setLooper(gfx::CreateShadowDrawLooper(shadow)); flags.setAntiAlias(true); canvas->ClipRect(shadowed_area, SkClipOp::kDifference);
diff --git a/ash/system/tray/tray_popup_utils.cc b/ash/system/tray/tray_popup_utils.cc index 19c0013..797c7a1 100644 --- a/ash/system/tray/tray_popup_utils.cc +++ b/ash/system/tray/tray_popup_utils.cc
@@ -13,6 +13,8 @@ #include "ash/resources/vector_icons/vector_icons.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/size_range_layout.h" #include "ash/system/tray/tray_constants.h" @@ -228,7 +230,9 @@ views::Separator* TrayPopupUtils::CreateVerticalSeparator() { views::Separator* separator = new views::Separator(); separator->SetPreferredHeight(24); - separator->SetColor(kSeparatorOnLightBackgroundColor); + separator->SetColor(AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnLightBackgroundColor)); return separator; } @@ -313,7 +317,9 @@ views::Separator* TrayPopupUtils::CreateListItemSeparator(bool left_inset) { views::Separator* separator = new views::Separator(); - separator->SetColor(kSeparatorOnLightBackgroundColor); + separator->SetColor(AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnLightBackgroundColor)); separator->SetBorder(views::CreateEmptyBorder( kMenuSeparatorVerticalPadding - views::Separator::kThickness, left_inset
diff --git a/ash/system/unified/unified_system_info_view.cc b/ash/system/unified/unified_system_info_view.cc index 4e50093e..326a3fc6 100644 --- a/ash/system/unified/unified_system_info_view.cc +++ b/ash/system/unified/unified_system_info_view.cc
@@ -11,6 +11,8 @@ #include "ash/session/session_observer.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/enterprise/enterprise_domain_observer.h" #include "ash/system/model/clock_model.h" #include "ash/system/model/clock_observer.h" @@ -388,7 +390,10 @@ if (PowerStatus::Get()->IsBatteryPresent()) { auto* separator = new views::Separator(); - separator->SetColor(kSeparatorOnDarkBackgroundColor); + separator->SetColor( + AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnDarkBackgroundColor)); separator->SetPreferredHeight(kUnifiedSystemInfoHeight); AddChildView(separator);
diff --git a/ash/system/unified/unified_system_tray_view.cc b/ash/system/unified/unified_system_tray_view.cc index e3617b9..df0aef7d 100644 --- a/ash/system/unified/unified_system_tray_view.cc +++ b/ash/system/unified/unified_system_tray_view.cc
@@ -10,6 +10,8 @@ #include "ash/public/cpp/ash_features.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/message_center/ash_message_center_lock_screen_controller.h" #include "ash/system/message_center/unified_message_center_view.h" #include "ash/system/tray/interacted_by_tap_recorder.h" @@ -449,12 +451,19 @@ // static std::unique_ptr<views::Background> UnifiedSystemTrayView::CreateBackground() { + SkColor bg_color = gfx::kPlaceholderColor; + if (app_list_features::IsBackgroundBlurEnabled()) { + bg_color = AshColorProvider::Get()->DeprecatedGetBaseLayerColor( + AshColorProvider::BaseLayerType::kTransparentWithBlur, + kUnifiedMenuBackgroundColorWithBlur); + } else { + bg_color = AshColorProvider::Get()->DeprecatedGetBaseLayerColor( + AshColorProvider::BaseLayerType::kTransparentWithoutBlur, + kUnifiedMenuBackgroundColor); + } return views::CreateBackgroundFromPainter( - views::Painter::CreateSolidRoundRectPainter( - app_list_features::IsBackgroundBlurEnabled() - ? kUnifiedMenuBackgroundColorWithBlur - : kUnifiedMenuBackgroundColor, - kUnifiedTrayCornerRadius)); + views::Painter::CreateSolidRoundRectPainter(bg_color, + kUnifiedTrayCornerRadius)); } void UnifiedSystemTrayView::OnGestureEvent(ui::GestureEvent* event) {
diff --git a/ash/system/unified/user_chooser_view.cc b/ash/system/unified/user_chooser_view.cc index afb34553..31108a1 100644 --- a/ash/system/unified/user_chooser_view.cc +++ b/ash/system/unified/user_chooser_view.cc
@@ -13,6 +13,8 @@ #include "ash/session/session_controller_impl.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" #include "ash/system/model/enterprise_domain_model.h" #include "ash/system/model/system_tray_model.h" #include "ash/system/tray/tray_constants.h" @@ -119,7 +121,9 @@ AddChildView(child); child->SetBorder(views::CreateSolidSidedBorder( 0, 0, kUnifiedNotificationSeparatorThickness, 0, - kSeparatorOnDarkBackgroundColor)); + AshColorProvider::Get()->DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType::kSeparator, + kSeparatorOnDarkBackgroundColor))); } DISALLOW_COPY_AND_ASSIGN(Separator);
diff --git a/ash/wm/desks/close_desk_button.cc b/ash/wm/desks/close_desk_button.cc index b75a054e..0ad27a3e 100644 --- a/ash/wm/desks/close_desk_button.cc +++ b/ash/wm/desks/close_desk_button.cc
@@ -7,7 +7,7 @@ #include <utility> #include "ash/resources/vector_icons/vector_icons.h" -#include "ui/gfx/color_palette.h" +#include "ash/style/ash_color_provider.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/animation/flood_fill_ink_drop_ripple.h" @@ -21,25 +21,12 @@ namespace { -// The inkdrop opacity for the ripple effect. -// TODO(minch): Migrate to use kLightInkRippleOpacity in AshColorProvider. -constexpr float kInkDropOpacity = 0.08f; - -// The highlight opacity for the ripple effect. -// TODO(minch): Migrate to use kLightInkRippleOpacity in AshColorProvider. -constexpr float kInkDropHighlightOpacity = 0.08f; - // The corner radius of the background of the close icon. constexpr int kCornerRadius = CloseDeskButton::kCloseButtonSize / 2; // The color of the close icon. constexpr SkColor kIconColor = gfx::kGoogleGrey200; -// The background color for the close icon. -// TODO(minch): Migrate to use BaseLayerType::kTransparentWithBlur in dark mode -// in AshColorProvider. -constexpr SkColor kBackgroundColor = SkColorSetA(gfx::kGoogleGrey900, 0xBC); - } // namespace CloseDeskButton::CloseDeskButton(views::ButtonListener* listener) @@ -47,17 +34,25 @@ SetPaintToLayer(); layer()->SetFillsBoundsOpaquely(false); + SkColor icon_background_color = AshColorProvider::Get()->GetBaseLayerColor( + AshColorProvider::BaseLayerType::kTransparentWithBlur, + AshColorProvider::AshColorMode::kDark); SetImage(views::Button::STATE_NORMAL, gfx::CreateVectorIcon(kDesksCloseDeskButtonIcon, kIconColor)); SetImageHorizontalAlignment(views::ImageButton::ALIGN_CENTER); SetImageVerticalAlignment(views::ImageButton::ALIGN_MIDDLE); SetBackground( CreateBackgroundFromPainter(views::Painter::CreateSolidRoundRectPainter( - kBackgroundColor, kCornerRadius))); + icon_background_color, kCornerRadius))); + + AshColorProvider::RippleAttributes ripple_attributes = + AshColorProvider::Get()->GetRippleAttributes(icon_background_color); + highlight_opacity_ = ripple_attributes.highlight_opacity; + inkdrop_base_color_ = ripple_attributes.base_color; SetInkDropMode(InkDropMode::ON); set_has_ink_drop_action_on_click(true); - set_ink_drop_visible_opacity(kInkDropOpacity); + set_ink_drop_visible_opacity(ripple_attributes.inkdrop_opacity); SetFocusPainter(nullptr); SetEventTargeter(std::make_unique<views::ViewTargeter>(this)); @@ -86,13 +81,12 @@ std::unique_ptr<views::InkDropHighlight> CloseDeskButton::CreateInkDropHighlight() const { auto highlight = ImageButton::CreateInkDropHighlight(); - highlight->set_visible_opacity(kInkDropHighlightOpacity); + highlight->set_visible_opacity(highlight_opacity_); return highlight; } SkColor CloseDeskButton::GetInkDropBaseColor() const { - // TODO(minch): Migrate to use AshColorProvider::GetRippleAttributes(). - return color_utils::GetColorWithMaxContrast(kBackgroundColor); + return inkdrop_base_color_; } std::unique_ptr<views::InkDropMask> CloseDeskButton::CreateInkDropMask() const {
diff --git a/ash/wm/desks/close_desk_button.h b/ash/wm/desks/close_desk_button.h index 949f18a..4f464199 100644 --- a/ash/wm/desks/close_desk_button.h +++ b/ash/wm/desks/close_desk_button.h
@@ -9,6 +9,7 @@ #include "ash/ash_export.h" #include "base/macros.h" +#include "ui/gfx/color_palette.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/view_targeter_delegate.h" @@ -41,6 +42,9 @@ bool DoesIntersectScreenRect(const gfx::Rect& screen_rect) const; private: + float highlight_opacity_ = 0.f; + SkColor inkdrop_base_color_ = gfx::kPlaceholderColor; + DISALLOW_COPY_AND_ASSIGN(CloseDeskButton); };
diff --git a/ash/wm/desks/desks_bar_view.cc b/ash/wm/desks/desks_bar_view.cc index 8cedee5f..03649a97 100644 --- a/ash/wm/desks/desks_bar_view.cc +++ b/ash/wm/desks/desks_bar_view.cc
@@ -11,6 +11,7 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" #include "ash/wm/desks/desk_mini_view.h" #include "ash/wm/desks/desk_mini_view_animations.h" #include "ash/wm/desks/new_desk_button.h" @@ -34,9 +35,6 @@ constexpr int kBarHeight = 104; -// TODO(minch): Migrate this to retrieve the color from AshColorProvider. -constexpr SkColor kBarColor = SkColorSetA(gfx::kGoogleGrey900, 0xBC); // 74% - base::string16 GetMiniViewTitle(int mini_view_index) { DCHECK_GE(mini_view_index, 0); DCHECK_LT(mini_view_index, 4); @@ -127,7 +125,10 @@ background_view_->SetPaintToLayer(ui::LAYER_SOLID_COLOR); background_view_->layer()->SetFillsBoundsOpaquely(false); - background_view_->layer()->SetColor(kBarColor); + background_view_->layer()->SetColor( + AshColorProvider::Get()->GetBaseLayerColor( + AshColorProvider::BaseLayerType::kTransparentWithBlur, + AshColorProvider::AshColorMode::kDark)); AddChildView(background_view_); AddChildView(new_desk_button_);
diff --git a/ash/wm/overview/overview_grid.cc b/ash/wm/overview/overview_grid.cc index 5f05565..d8b3886 100644 --- a/ash/wm/overview/overview_grid.cc +++ b/ash/wm/overview/overview_grid.cc
@@ -69,7 +69,6 @@ constexpr float kOverviewVerticalInset = 0.1f; // Number of columns and rows for windows in tablet overview mode. -constexpr int kTabletLayoutCol = 3; constexpr int kTabletLayoutRow = 2; // Histogram names for overview enter/exit smoothness in clamshell, @@ -1422,41 +1421,49 @@ // Windows occupy vertically centered area with additional vertical insets. total_bounds.Inset(GetGridInsets(total_bounds)); - // TODO(dantonvu): Width calculation should maintain the aspect ratio of the - // window. + // TODO(sammiequon): Check why scrolling during split view stacks windows. // When the dragged item becomes an |ignored_item|, move the other windows // accordingly. |window_position| matches the positions of the windows' // indexes from |window_list_|. However, if a window turns out to be an // ignored item, |window_position| remains where the item was as to then // reposition the other window's bounds in place of that item. - // Currently, this function does not work well if overview grid bounds change - // eg: during SplitView, since the windows remain the same size and end up - // overlapping with smaller grid bounds. - // For tablet overview mode, windows are being limited to fit six per screen - - // 2 rows of 3. Additional windows are placed offscreen. This is more - // efficient performance-wise since windows out of screen would not need - // animation compared to having every window in overview mode needing - // animation. // Since the number of rows is limited, windows are laid out column-wise so // that the most recently used windows are displayed first. - const int width = total_bounds.width() / kTabletLayoutCol; const int height = total_bounds.height() / kTabletLayoutRow; - size_t window_position = 0u; + int window_position = 0; std::vector<gfx::RectF> rects; + int i = 0; for (const auto& window : window_list_) { if (window->animating_to_close() || ignored_items.contains(window.get())) { rects.push_back(gfx::RectF()); + ++i; continue; } - const int x = width * (window_position / kTabletLayoutRow) + - total_bounds.x() + scroll_offset_; + const float ratio = float{height} / window->GetWindow()->bounds().height(); + const int width = window->GetWindow()->bounds().width() * ratio; + const int y = height * (window_position % kTabletLayoutRow) + total_bounds.y(); + + // TODO(sammiequon): Remove this loop and cache the values of the last + // bounds for each row. + // Search for closest window in the same row to the + // left of where the current window would be placed and set the current + // window's |x| value to the right of the other window. + int x = total_bounds.x() + scroll_offset_; + for (int j = i - 1; j >= 0; --j) { + if (rects[j].y() == y) { + x = rects[j].right(); + break; + } + } + const gfx::RectF bounds(x, y, width, height); rects.push_back(bounds); ++window_position; + ++i; } return rects;
diff --git a/base/android/linker/DEPS b/base/android/linker/DEPS index c885334..15c3afb 100644 --- a/base/android/linker/DEPS +++ b/base/android/linker/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - # This code cannot depend on anything from base/. + # This code cannot depend on anything from base/ "-base", - "+base/android/linker", ]
diff --git a/base/android/linker/modern_linker_jni.cc b/base/android/linker/modern_linker_jni.cc index a8e631c1..284d33b 100644 --- a/base/android/linker/modern_linker_jni.cc +++ b/base/android/linker/modern_linker_jni.cc
@@ -7,36 +7,23 @@ // This source code *cannot* depend on anything from base/ or the C++ // STL, to keep the final library small, and avoid ugly dependency issues. -#include "base/android/linker/modern_linker_jni.h" +#include "modern_linker_jni.h" -#include <android/dlext.h> #include <dlfcn.h> #include <errno.h> #include <fcntl.h> #include <jni.h> #include <limits.h> #include <link.h> -#include <linux/memfd.h> #include <stddef.h> #include <string.h> #include <sys/mman.h> #include <sys/stat.h> -#include <sys/syscall.h> #include <sys/types.h> -#include <sys/utsname.h> #include <unistd.h> -#include "base/android/linker/linker_jni.h" - -// From //base/posix/eintr_wrapper.h, but we don't want to depend on //base. -#define HANDLE_EINTR(x) \ - ({ \ - decltype(x) eintr_wrapper_result; \ - do { \ - eintr_wrapper_result = (x); \ - } while (eintr_wrapper_result == -1 && errno == EINTR); \ - eintr_wrapper_result; \ - }) +#include <android/dlext.h> +#include "linker_jni.h" // Not defined on all platforms. As this linker is only supported on ARM32/64, // x86/x86_64 and MIPS, page size is always 4k. @@ -65,36 +52,6 @@ namespace chromium_android_linker { namespace { -// Returns whether memfd_create() is supported on this kernel. -bool IsMemfdSupported() { - // Check the kernel version. There is precedent of OEMs adding syscalls to - // shipping kernels with a number used on later ones, so relying on the kernel - // to return ENOSYS doesn't work. - static constexpr int kRequiredMajor = 3; - static constexpr int kRequiredMinor = 17; - struct utsname uts; - int major, minor; - - if (uname(&uts)) - return false; - - if (strcmp(uts.sysname, "Linux") != 0 || - sscanf(uts.release, "%d.%d", &major, &minor) != 2) - return false; - - if (major < kRequiredMajor || - (major == kRequiredMajor && minor < kRequiredMinor)) { - return false; - } - - return true; -} - -// Wrapper, as bionic doesn't expose it. -int memfd_create(const char* name, unsigned int flags) { - return syscall(__NR_memfd_create, name, flags); -} - // Record of the Java VM passed to JNI_OnLoad(). static JavaVM* s_java_vm = nullptr; @@ -226,98 +183,34 @@ }; // Makes sure the file descriptor is closed unless |Release()| is called. -// -// May either be backed by a memfd or a regular file, depending on the kernel. class ScopedFileDescriptor { public: - static ScopedFileDescriptor Open(const String& path); - + ScopedFileDescriptor(int fd) : fd_(fd), owned_(true) {} ~ScopedFileDescriptor() { if (owned_) Close(); } - ScopedFileDescriptor(ScopedFileDescriptor&& o) : fd_(o.fd_), owned_(o.owned_) { o.owned_ = false; } - int get() const { return fd_; } - void Release() { owned_ = false; } - void Close() { if (fd_ != -1) close(fd_); owned_ = false; } - bool ReopenReadOnly(const String& original_path); - private: - int fd_ = -1; - bool owned_ = false; - bool is_memfd_ = false; - - static ScopedFileDescriptor OpenFile(const String& path); - // Must only be called if memfd is supported on this kernel. - static ScopedFileDescriptor OpenMemfd(const String& path); - - ScopedFileDescriptor(int fd, bool is_memfd) - : fd_(fd), owned_(true), is_memfd_(is_memfd) {} + const int fd_; + bool owned_; // Move only. ScopedFileDescriptor(const ScopedFileDescriptor&) = delete; ScopedFileDescriptor& operator=(const ScopedFileDescriptor&) = delete; }; -ScopedFileDescriptor ScopedFileDescriptor::Open(const String& path) { - return IsMemfdSupported() ? ScopedFileDescriptor::OpenMemfd(path) - : ScopedFileDescriptor::OpenFile(path); -} - -ScopedFileDescriptor ScopedFileDescriptor::OpenFile(const String& path) { - int flags = O_RDWR | O_CREAT | O_EXCL; - int mode = S_IRUSR | S_IWUSR; - int fd = HANDLE_EINTR(open(path.c_str(), flags, mode)); - return {fd, false}; -} - -ScopedFileDescriptor ScopedFileDescriptor::OpenMemfd(const String& path) { - LOG_INFO("Using a memfd file descriptor."); - return {memfd_create(path.c_str(), MFD_ALLOW_SEALING), true}; -} - -bool ScopedFileDescriptor::ReopenReadOnly(const String& original_path) { - if (is_memfd_) { - // This is safe as we seal the fd before sending it to another process. - // The target process cannot do anything to alter the underlying "file". - int err = fcntl(fd_, F_ADD_SEALS, - F_SEAL_WRITE | F_SEAL_GROW | F_SEAL_SHRINK | F_SEAL_SEAL); - if (err) { - LOG_ERROR("Cannot seal the fd: %s", strerror(errno)); - return false; - } - } else { - const char* filepath = original_path.c_str(); - Close(); - fd_ = HANDLE_EINTR(open(filepath, O_RDONLY)); - if (fd_ == -1) { - LOG_ERROR("open: %s: %s", filepath, strerror(errno)); - return false; - } - - // Delete the directory entry for the RELRO file. The fd we hold ensures - // that its data remains intact. - if (unlink(filepath) == -1) { - LOG_ERROR("unlink: %s: %s", filepath, strerror(errno)); - return false; - } - } - - return true; -} - // Reserves an address space range, starting at |address|. // If successful, returns a valid mapping, otherwise returns an empty one. ScopedAnonymousMmap ScopedAnonymousMmap::ReserveAtAddress(void* address, @@ -360,6 +253,28 @@ return true; } +// Reopens |fd| that was initially opened from |path| as a read-only fd. +// Deletes the file in the process, and returns the new read only file +// descriptor in case of success, -1 otherwise. +ScopedFileDescriptor ReopenReadOnly(const String& path, + ScopedFileDescriptor original_fd) { + const char* filepath = path.c_str(); + original_fd.Close(); + ScopedFileDescriptor scoped_fd{open(filepath, O_RDONLY)}; + if (scoped_fd.get() == -1) { + LOG_ERROR("open: %s: %s", path.c_str(), strerror(errno)); + return -1; + } + + // Delete the directory entry for the RELRO file. The fd we hold ensures + // that its data remains intact. + if (unlink(filepath) == -1) { + LOG_ERROR("unlink: %s: %s", filepath, strerror(errno)); + return -1; + } + return scoped_fd; +} + // Resizes the address space reservation to the actual required size. // Failure here is only a warning, as at worst this wastes virtual address // space, not actual memory. @@ -411,10 +326,11 @@ return true; } -// Loads the library at |path| at address |wanted_address| if possible, and +// Load the library at |path| at address |wanted_address| if possible, and // creates a file with relro at |relocations_path|. // -// Returns a readonly file descriptor to the relocations, or -1 for failure; +// In case of success, returns a readonly file descriptor to the relocations, +// otherwise returns -1. int LoadCreateSharedRelocations(const String& path, void* wanted_address, const String& relocations_path) { @@ -425,9 +341,8 @@ return -1; unlink(relocations_path.c_str()); - // TODO(lizeb): Don't fallback to a file, instead don't even reach here - // when memfd is not supported, and use the system linker in Java. - ScopedFileDescriptor relro_fd = ScopedFileDescriptor::Open(relocations_path); + ScopedFileDescriptor relro_fd = ScopedFileDescriptor{open( + relocations_path.c_str(), O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)}; if (relro_fd.get() == -1) { LOG_ERROR("open: %s: %s", relocations_path.c_str(), strerror(errno)); return -1; @@ -452,14 +367,13 @@ unlink(relocations_path.c_str()); return false; } - if (!relro_fd.ReopenReadOnly(relocations_path)) - return -1; - - relro_fd.Release(); - return relro_fd.get(); + ScopedFileDescriptor scoped_fd = + ReopenReadOnly(relocations_path, std::move(relro_fd)); + scoped_fd.Release(); + return scoped_fd.get(); } -// Loads the library at |path| at address |wanted_address| if possible, and +// Load the library at |path| at address |wanted_address| if possible, and // uses the relocations in |relocations_fd| if possible. bool LoadUseSharedRelocations(const String& path, void* wanted_address,
diff --git a/base/feature_list.cc b/base/feature_list.cc index d602ce94..41e1775 100644 --- a/base/feature_list.cc +++ b/base/feature_list.cc
@@ -161,6 +161,14 @@ RegisterOverride(feature_name, override_state, field_trial); } +void FeatureList::RegisterExtraFeatureOverrides( + const std::vector<FeatureOverrideInfo>& extra_overrides) { + for (const FeatureOverrideInfo& override_info : extra_overrides) { + RegisterOverride(override_info.first.get().name, override_info.second, + /* field_trial = */ nullptr); + } +} + void FeatureList::AddFeaturesToAllocator(PersistentMemoryAllocator* allocator) { DCHECK(initialized_); @@ -223,6 +231,15 @@ // static bool FeatureList::InitializeInstance(const std::string& enable_features, const std::string& disable_features) { + return InitializeInstance(enable_features, disable_features, + std::vector<FeatureOverrideInfo>()); +} + +// static +bool FeatureList::InitializeInstance( + const std::string& enable_features, + const std::string& disable_features, + const std::vector<FeatureOverrideInfo>& extra_overrides) { // We want to initialize a new instance here to support command-line features // in testing better. For example, we initialize a dummy instance in // base/test/test_suite.cc, and override it in content/browser/ @@ -247,6 +264,7 @@ std::unique_ptr<FeatureList> feature_list(new FeatureList); feature_list->InitializeFromCommandLine(enable_features, disable_features); + feature_list->RegisterExtraFeatureOverrides(extra_overrides); FeatureList::SetInstance(std::move(feature_list)); return !instance_existed_before; }
diff --git a/base/feature_list.h b/base/feature_list.h index 883ac924..a6f39da 100644 --- a/base/feature_list.h +++ b/base/feature_list.h
@@ -96,6 +96,18 @@ FeatureList(); ~FeatureList(); + // Specifies whether a feature override enables or disables the feature. + enum OverrideState { + OVERRIDE_USE_DEFAULT, + OVERRIDE_DISABLE_FEATURE, + OVERRIDE_ENABLE_FEATURE, + }; + + // Describes a feature override. The first member is a Feature that will be + // overridden with the state given by the second member. + using FeatureOverrideInfo = + std::pair<const std::reference_wrapper<const Feature>, OverrideState>; + // Initializes feature overrides via command-line flags |enable_features| and // |disable_features|, each of which is a comma-separated list of features to // enable or disable, respectively. If a feature appears on both lists, then @@ -114,15 +126,10 @@ // of the associated field trial. void InitializeFromSharedMemory(PersistentMemoryAllocator* allocator); - // Specifies whether a feature override enables or disables the feature. - enum OverrideState { - OVERRIDE_USE_DEFAULT, - OVERRIDE_DISABLE_FEATURE, - OVERRIDE_ENABLE_FEATURE, - }; - // Returns true if the state of |feature_name| has been overridden via - // |InitializeFromCommandLine()|. + // |InitializeFromCommandLine()|. This includes features explicitly + // disabled/enabled with --disable-features and --enable-features, as well as + // any extra feature overrides that depend on command line switches. bool IsFeatureOverriddenFromCommandLine(const std::string& feature_name, OverrideState state) const; @@ -146,6 +153,15 @@ OverrideState override_state, FieldTrial* field_trial); + // Adds extra overrides (not associated with a field trial). Should be called + // before SetInstance(). + // The ordering of calls with respect to InitializeFromCommandLine(), + // RegisterFieldTrialOverride(), etc. matters. The first call wins out, + // because the |overrides_| map uses insert(), which retains the first + // inserted entry and does not overwrite it on subsequent calls to insert(). + void RegisterExtraFeatureOverrides( + const std::vector<FeatureOverrideInfo>& extra_overrides); + // Loops through feature overrides and serializes them all into |allocator|. void AddFeaturesToAllocator(PersistentMemoryAllocator* allocator); @@ -188,6 +204,14 @@ static bool InitializeInstance(const std::string& enable_features, const std::string& disable_features); + // Like the above, but also adds extra overrides. If a feature appears in + // |extra_overrides| and also |enable_features| or |disable_features|, the + // disable/enable will supersede the extra overrides. + static bool InitializeInstance( + const std::string& enable_features, + const std::string& disable_features, + const std::vector<FeatureOverrideInfo>& extra_overrides); + // Returns the singleton instance of FeatureList. Will return null until an // instance is registered via SetInstance(). static FeatureList* GetInstance();
diff --git a/base/feature_list_unittest.cc b/base/feature_list_unittest.cc index a654696..813fb252 100644 --- a/base/feature_list_unittest.cc +++ b/base/feature_list_unittest.cc
@@ -8,6 +8,7 @@ #include <algorithm> #include <utility> +#include <vector> #include "base/format_macros.h" #include "base/memory/read_only_shared_memory_region.h" @@ -378,12 +379,64 @@ } } +TEST_F(FeatureListTest, RegisterExtraFeatureOverrides) { + ClearFeatureListInstance(); + + auto feature_list = std::make_unique<FeatureList>(); + std::vector<FeatureList::FeatureOverrideInfo> overrides; + overrides.push_back({std::cref(kFeatureOnByDefault), + FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE}); + overrides.push_back({std::cref(kFeatureOffByDefault), + FeatureList::OverrideState::OVERRIDE_ENABLE_FEATURE}); + feature_list->RegisterExtraFeatureOverrides(std::move(overrides)); + RegisterFeatureListInstance(std::move(feature_list)); + + EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOnByDefault)); + EXPECT_TRUE(FeatureList::IsEnabled(kFeatureOffByDefault)); +} + +TEST_F(FeatureListTest, InitializeFromCommandLineThenRegisterExtraOverrides) { + ClearFeatureListInstance(); + + auto feature_list = std::make_unique<FeatureList>(); + feature_list->InitializeFromCommandLine(kFeatureOnByDefaultName, + kFeatureOffByDefaultName); + std::vector<FeatureList::FeatureOverrideInfo> overrides; + overrides.push_back({std::cref(kFeatureOnByDefault), + FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE}); + overrides.push_back({std::cref(kFeatureOffByDefault), + FeatureList::OverrideState::OVERRIDE_ENABLE_FEATURE}); + feature_list->RegisterExtraFeatureOverrides(std::move(overrides)); + RegisterFeatureListInstance(std::move(feature_list)); + + // The InitializeFromCommandLine supersedes the RegisterExtraFeatureOverrides + // because it was called first. + EXPECT_TRUE(FeatureList::IsEnabled(kFeatureOnByDefault)); + EXPECT_FALSE(FeatureList::IsEnabled(kFeatureOffByDefault)); + + std::string enable_features; + std::string disable_features; + FeatureList::GetInstance()->GetFeatureOverrides(&enable_features, + &disable_features); + EXPECT_EQ(kFeatureOnByDefaultName, SortFeatureListString(enable_features)); + EXPECT_EQ(kFeatureOffByDefaultName, SortFeatureListString(disable_features)); +} + TEST_F(FeatureListTest, GetFeatureOverrides) { ClearFeatureListInstance(); FieldTrialList field_trial_list(nullptr); std::unique_ptr<FeatureList> feature_list(new FeatureList); feature_list->InitializeFromCommandLine("A,X", "D"); + Feature feature_b = {"B", FEATURE_ENABLED_BY_DEFAULT}; + Feature feature_c = {"C", FEATURE_DISABLED_BY_DEFAULT}; + std::vector<FeatureList::FeatureOverrideInfo> overrides; + overrides.push_back({std::cref(feature_b), + FeatureList::OverrideState::OVERRIDE_DISABLE_FEATURE}); + overrides.push_back({std::cref(feature_c), + FeatureList::OverrideState::OVERRIDE_ENABLE_FEATURE}); + feature_list->RegisterExtraFeatureOverrides(std::move(overrides)); + FieldTrial* trial = FieldTrialList::CreateFieldTrial("Trial", "Group"); feature_list->RegisterFieldTrialOverride(kFeatureOffByDefaultName, FeatureList::OVERRIDE_ENABLE_FEATURE, @@ -395,13 +448,13 @@ std::string disable_features; FeatureList::GetInstance()->GetFeatureOverrides(&enable_features, &disable_features); - EXPECT_EQ("A,OffByDefault<Trial,X", SortFeatureListString(enable_features)); - EXPECT_EQ("D", SortFeatureListString(disable_features)); + EXPECT_EQ("A,C,OffByDefault<Trial,X", SortFeatureListString(enable_features)); + EXPECT_EQ("B,D", SortFeatureListString(disable_features)); FeatureList::GetInstance()->GetCommandLineFeatureOverrides(&enable_features, &disable_features); - EXPECT_EQ("A,X", SortFeatureListString(enable_features)); - EXPECT_EQ("D", SortFeatureListString(disable_features)); + EXPECT_EQ("A,C,X", SortFeatureListString(enable_features)); + EXPECT_EQ("B,D", SortFeatureListString(disable_features)); } TEST_F(FeatureListTest, GetFeatureOverrides_UseDefault) {
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 2efab1b..deb86fa 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -1520,6 +1520,14 @@ cflags += [ # TODO(https://crbug.com/989932): Evaluate and possibly enable. "-Wno-implicit-int-float-conversion", + + # TODO(https://crbug.com/992458): Fix and re-enable. When rolling + # past clang r368446, do *not* move this out of + # llvm_force_head_revision -- we need to fix all instances before + # rolling, else we lose a valuable pre-existing warning that got + # smarter on clang trunk. (And having a -Wno-error flag instead of + # -Wno-return-stack-address on pinned clang won't fly either.) + "-Wno-error=return-stack-address", ] } }
diff --git a/build/config/ios/ios_sdk.gni b/build/config/ios/ios_sdk.gni index 06bbfa77..0a829d6 100644 --- a/build/config/ios/ios_sdk.gni +++ b/build/config/ios/ios_sdk.gni
@@ -3,6 +3,7 @@ # found in the LICENSE file. import("//build/config/ios/ios_sdk_overrides.gni") +import("//build/toolchain/goma.gni") import("//build/toolchain/toolchain.gni") assert(use_system_xcode, "Hermetic xcode doesn't work for ios.") @@ -54,6 +55,10 @@ additional_target_cpus = [] } +# Official builds may not use goma. +assert(!(is_chrome_branded && is_official_build && target_cpu == "arm64"), + "goma use is forbidden for official iOS builds.") + assert(custom_toolchain == "" || additional_target_cpus == [], "cannot define both custom_toolchain and additional_target_cpus")
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn index 781aeaa..8406c060 100644 --- a/build/config/win/BUILD.gn +++ b/build/config/win/BUILD.gn
@@ -384,6 +384,85 @@ } } +# This is a superset of all the delayloads needed for chrome.exe, chrome.dll, +# chrome_child.dll, and chrome_elf.dll. The linker will automatically ignore +# anything which is not linked to the binary at all. +# Most of the dlls are simply not required at startup (or at all, depending +# on how the browser is used). The following dlls are interconnected and need to +# be delayloaded together to ensure user32 does not load too early or at all, +# depending on the process type: user32, gdi32, comctl32, comdlg32, cryptui, +# d3d9, dwmapi, imm32, msi, ole32, oleacc, rstrtmgr, shell32, shlwapi, and +# uxtheme. +# There are some exceptions to this list which need to be declared separately. +# Some dlls cannot be delayloaded by chrome_child.dll due to the sandbox +# restrictions that prevent them from being loaded properly. Those dlls are +# specified in the separate config below. +# This config should also be used for any test binary whose goal is to run +# tests with the full browser. +config("delayloads") { + ldflags = [ + "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll", + "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll", + "/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll", + "/DELAYLOAD:comctl32.dll", + "/DELAYLOAD:comdlg32.dll", + "/DELAYLOAD:credui.dll", + "/DELAYLOAD:cryptui.dll", + "/DELAYLOAD:d3d11.dll", + "/DELAYLOAD:d3d9.dll", + "/DELAYLOAD:dwmapi.dll", + "/DELAYLOAD:dxgi.dll", + "/DELAYLOAD:dxva2.dll", + "/DELAYLOAD:esent.dll", + "/DELAYLOAD:gdi32.dll", + "/DELAYLOAD:hid.dll", + "/DELAYLOAD:imagehlp.dll", + "/DELAYLOAD:imm32.dll", + "/DELAYLOAD:msi.dll", + "/DELAYLOAD:netapi32.dll", + "/DELAYLOAD:ncrypt.dll", + "/DELAYLOAD:ole32.dll", + "/DELAYLOAD:oleacc.dll", + "/DELAYLOAD:propsys.dll", + "/DELAYLOAD:psapi.dll", + "/DELAYLOAD:rpcrt4.dll", + "/DELAYLOAD:rstrtmgr.dll", + "/DELAYLOAD:setupapi.dll", + "/DELAYLOAD:shell32.dll", + "/DELAYLOAD:shlwapi.dll", + "/DELAYLOAD:urlmon.dll", + "/DELAYLOAD:user32.dll", + "/DELAYLOAD:usp10.dll", + "/DELAYLOAD:uxtheme.dll", + "/DELAYLOAD:wer.dll", + "/DELAYLOAD:wevtapi.dll", + "/DELAYLOAD:wininet.dll", + "/DELAYLOAD:winusb.dll", + "/DELAYLOAD:wsock32.dll", + "/DELAYLOAD:wtsapi32.dll", + ] +} + +config("delayloads_not_for_child_dll") { + ldflags = [ + "/DELAYLOAD:advapi32.dll", + "/DELAYLOAD:crypt32.dll", + "/DELAYLOAD:dbghelp.dll", + "/DELAYLOAD:dhcpcsvc.dll", + "/DELAYLOAD:dwrite.dll", + "/DELAYLOAD:iphlpapi.dll", + "/DELAYLOAD:oleaut32.dll", + "/DELAYLOAD:secur32.dll", + "/DELAYLOAD:uiautomationcore.dll", + "/DELAYLOAD:userenv.dll", + "/DELAYLOAD:winhttp.dll", + "/DELAYLOAD:winmm.dll", + "/DELAYLOAD:winspool.drv", + "/DELAYLOAD:wintrust.dll", + "/DELAYLOAD:ws2_32.dll", + ] +} + # CRT -------------------------------------------------------------------------- # Configures how the runtime library (CRT) is going to be used.
diff --git a/build/mac_toolchain.py b/build/mac_toolchain.py index 90f14a69..776b379 100755 --- a/build/mac_toolchain.py +++ b/build/mac_toolchain.py
@@ -28,16 +28,6 @@ import sys -# This can be changed after running: -# mac_toolchain upload -xcode-path path/to/Xcode.app -# The hermetic install of Xcode is used: -# 1) For sizes support -# 2) To build clang -# 3) For code-coverage support. -# These should eventually be phased out to use the new deployment of -# xcode_binaries, see InstallXcodeBinaries. https://crbug.com/984746 -MAC_TOOLCHAIN_VERSION = '9E501' - # This contains binaries from Xcode 10.12.1, along with the 10.14 SDKs. To build # this package, see comments in build/xcode_binaries.yaml MAC_BINARIES_LABEL = 'infra_internal/ios/xcode/xcode_binaries/mac-amd64' @@ -48,8 +38,6 @@ # 9E145 (Xcode 9.3) only runs on 10.13.2 and newer. MAC_MINIMUM_OS_VERSION = 17 -MAC_TOOLCHAIN_INSTALLER = 'mac_toolchain' - BASE_DIR = os.path.abspath(os.path.dirname(__file__)) TOOLCHAIN_ROOT = os.path.join(BASE_DIR, 'mac_files') TOOLCHAIN_BUILD_DIR = os.path.join(TOOLCHAIN_ROOT, 'Xcode.app') @@ -96,46 +84,6 @@ sys.stderr.flush() -def InstallXcode(xcode_build_version, installer_cmd, xcode_app_path): - """Installs the requested Xcode build version. - - Args: - xcode_build_version: (string) Xcode build version to install. - installer_cmd: (string) Path to mac_toolchain command to install Xcode. - See https://chromium.googlesource.com/infra/infra/+/master/go/src/infra/cmd/mac_toolchain/ - xcode_app_path: (string) Path to install the contents of Xcode.app. - - Returns: - True if installation was successful. False otherwise. - """ - args = [ - installer_cmd, 'install', - '-kind', 'mac', - '-xcode-version', xcode_build_version.lower(), - '-output-dir', xcode_app_path, - ] - - # Buildbot slaves need to use explicit credentials. LUCI bots should NOT set - # this variable. - creds = os.environ.get('MAC_TOOLCHAIN_CREDS') - if creds: - args.extend(['--service-account-json', creds]) - - try: - subprocess.check_call(args) - except subprocess.CalledProcessError as e: - PrintError('Xcode build version %s failed to install: %s\n' % ( - xcode_build_version, e)) - RequestCipdAuthentication() - return False - except OSError as e: - PrintError(('Xcode installer "%s" failed to execute' - ' (not on PATH or not installed).') % installer_cmd) - return False - - return True - - def InstallXcodeBinaries(): """Installs the Xcode binaries needed to build Chrome and accepts the license. @@ -230,20 +178,14 @@ print('OS version does not support toolchain.') return 0 - toolchain_version = os.environ.get('MAC_TOOLCHAIN_REVISION', - MAC_TOOLCHAIN_VERSION) - - # On developer machines, mac_toolchain tool is provided by - # depot_tools. On the bots, the recipe is responsible for installing - # it and providing the path to the executable. - installer_cmd = os.environ.get('MAC_TOOLCHAIN_INSTALLER', - MAC_TOOLCHAIN_INSTALLER) - - xcode_app_path = TOOLCHAIN_BUILD_DIR - - success = InstallXcode(toolchain_version, installer_cmd, xcode_app_path) - if not success: - return 1 + # Delete obsolete hermetic full Xcode folder, the build now uses + # build/mac_files/xcode_binaries instead. + if os.path.exists(TOOLCHAIN_BUILD_DIR): + # TODO(thakis): Remove this after it's been here for a few months. + print('Deleting obsolete build/mac_files/Xcode.app...', end='') + sys.stdout.flush() + shutil.rmtree(TOOLCHAIN_BUILD_DIR) + print('done') return InstallXcodeBinaries()
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index 7e807e5..1e1ecb1 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn
@@ -236,38 +236,19 @@ configs += [ "//build/config/win:windowed" ] } - ldflags = [ - "/DELAYLOAD:advapi32.dll", - "/DELAYLOAD:comdlg32.dll", - "/DELAYLOAD:dbghelp.dll", - "/DELAYLOAD:dwmapi.dll", - "/DELAYLOAD:imm32.dll", - "/DELAYLOAD:iphlpapi.dll", - "/DELAYLOAD:ole32.dll", - "/DELAYLOAD:oleaut32.dll", - "/DELAYLOAD:propsys.dll", - "/DELAYLOAD:psapi.dll", - "/DELAYLOAD:shell32.dll", - "/DELAYLOAD:shlwapi.dll", - "/DELAYLOAD:user32.dll", - "/DELAYLOAD:userenv.dll", - "/DELAYLOAD:uxtheme.dll", - "/DELAYLOAD:wer.dll", - "/DELAYLOAD:wevtapi.dll", - "/DELAYLOAD:winhttp.dll", - "/DELAYLOAD:wininet.dll", - "/DELAYLOAD:winmm.dll", - "/DELAYLOAD:wintrust.dll", + configs += [ + "//build/config/win:delayloads", + "//build/config/win:delayloads_not_for_child_dll", ] if (current_cpu == "x86") { # Increase the initial stack size. The default is 1MB, this is 1.5MB. # To mitigate address space pressure, |CreateThreadInternal| sets the # default back to 1MB for non-main threads. - ldflags += [ "/STACK:1572864" ] + ldflags = [ "/STACK:1572864" ] } else { # Increase the initial stack size. The default is 1MB, this is 8MB. - ldflags += [ "/STACK:8388608" ] + ldflags = [ "/STACK:8388608" ] } } @@ -432,66 +413,9 @@ "//ui/views", ] - ldflags = [ - "/DELAYLOAD:advapi32.dll", - "/DELAYLOAD:comctl32.dll", - "/DELAYLOAD:comdlg32.dll", - "/DELAYLOAD:credui.dll", - "/DELAYLOAD:crypt32.dll", - "/DELAYLOAD:cryptui.dll", - "/DELAYLOAD:d3d11.dll", - "/DELAYLOAD:d3d9.dll", - "/DELAYLOAD:dbghelp.dll", - "/DELAYLOAD:dhcpcsvc.dll", - "/DELAYLOAD:dwmapi.dll", - "/DELAYLOAD:dxgi.dll", - "/DELAYLOAD:esent.dll", - "/DELAYLOAD:gdi32.dll", - "/DELAYLOAD:hid.dll", - "/DELAYLOAD:imagehlp.dll", - "/DELAYLOAD:imm32.dll", - "/DELAYLOAD:msi.dll", - "/DELAYLOAD:netapi32.dll", - "/DELAYLOAD:ole32.dll", - "/DELAYLOAD:oleacc.dll", - "/DELAYLOAD:ncrypt.dll", - "/DELAYLOAD:propsys.dll", - "/DELAYLOAD:psapi.dll", - "/DELAYLOAD:secur32.dll", - "/DELAYLOAD:setupapi.dll", - "/DELAYLOAD:shell32.dll", - "/DELAYLOAD:shlwapi.dll", - "/DELAYLOAD:uiautomationcore.dll", - "/DELAYLOAD:urlmon.dll", - "/DELAYLOAD:user32.dll", - "/DELAYLOAD:userenv.dll", - "/DELAYLOAD:usp10.dll", - "/DELAYLOAD:uxtheme.dll", - "/DELAYLOAD:wer.dll", - "/DELAYLOAD:wevtapi.dll", - "/DELAYLOAD:winhttp.dll", - "/DELAYLOAD:wininet.dll", - "/DELAYLOAD:winspool.drv", - "/DELAYLOAD:wintrust.dll", - "/DELAYLOAD:winusb.dll", - "/DELAYLOAD:wsock32.dll", - "/DELAYLOAD:wtsapi32.dll", - "/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll", - ] - + configs += [ "//build/config/win:delayloads" ] if (is_multi_dll_chrome) { - ldflags += [ - "/DELAYLOAD:dwrite.dll", - "/DELAYLOAD:iphlpapi.dll", - "/DELAYLOAD:oleaut32.dll", - "/DELAYLOAD:winmm.dll", - "/DELAYLOAD:ws2_32.dll", - ] - } else { - ldflags += [ - "/DELAYLOAD:dxva2.dll", - "/DELAYLOAD:rstrtmgr.dll", - ] + configs += [ "//build/config/win:delayloads_not_for_child_dll" ] } if (!is_component_build) { @@ -568,29 +492,7 @@ "//services/service_manager/embedder", ] - ldflags = [ - "/DELAYLOAD:comctl32.dll", - "/DELAYLOAD:comdlg32.dll", - "/DELAYLOAD:d3d11.dll", - "/DELAYLOAD:d3d9.dll", - "/DELAYLOAD:dwmapi.dll", - "/DELAYLOAD:dxgi.dll", - "/DELAYLOAD:dxva2.dll", - "/DELAYLOAD:esent.dll", - "/DELAYLOAD:gdi32.dll", - "/DELAYLOAD:imm32.dll", - "/DELAYLOAD:ole32.dll", - "/DELAYLOAD:oleacc.dll", - "/DELAYLOAD:propsys.dll", - "/DELAYLOAD:rstrtmgr.dll", - "/DELAYLOAD:shell32.dll", - "/DELAYLOAD:shlwapi.dll", - "/DELAYLOAD:urlmon.dll", - "/DELAYLOAD:user32.dll", - "/DELAYLOAD:usp10.dll", - "/DELAYLOAD:wininet.dll", - "/DELAYLOAD:wtsapi32.dll", - ] + configs += [ "//build/config/win:delayloads" ] if (is_clang && is_official_build) { orderfile = "build/chrome_child.$target_cpu.orderfile" @@ -598,7 +500,7 @@ inputs = [ orderfile, ] - ldflags += [ + ldflags = [ "/order:@$rebased_orderfile", # Ignore warnings about missing functions or functions not in their
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 54c56eb8..cebccd0 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -2102,6 +2102,27 @@ } } +# TODO(crbug.com/989654): Add Chrome bundle as test target once the test runner +# knows how to install bundles. +instrumentation_test_apk("chrome_bundle_smoke_test") { + apk_name = "ChromeBundleSmokeTest" + android_manifest = + "javatests/src/org/chromium/chrome/test/smoke/AndroidManifest_bundle.xml" + target_sdk_version = 28 + testonly = true + java_files = [ + "javatests/src/org/chromium/chrome/test/smoke/ChromeBundleSmokeTest.java", + ] + deps = [ + "//base:base_java", + "//base:base_java_test_support", + "//chrome/test/android:chrome_java_test_pagecontroller", + "//content/public/test/android:content_java_test_support", + "//third_party/android_support_test_runner:runner_java", + "//third_party/junit", + ] +} + if (defined(expected_static_initializer_count)) { action_with_pydeps("monochrome_static_initializers") { script = "//build/android/gyp/assert_static_initializers.py"
diff --git a/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/TestingAutofillAssistantModuleEntryProvider.java b/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/TestingAutofillAssistantModuleEntryProvider.java index 6431de65..213b59bf 100644 --- a/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/TestingAutofillAssistantModuleEntryProvider.java +++ b/chrome/android/features/autofill_assistant/javatests/src/org/chromium/chrome/browser/autofill_assistant/TestingAutofillAssistantModuleEntryProvider.java
@@ -4,8 +4,6 @@ package org.chromium.chrome.browser.autofill_assistant; -import android.content.Context; - import org.chromium.base.Callback; import org.chromium.chrome.browser.tab.Tab; @@ -36,19 +34,18 @@ } @Override - public AutofillAssistantModuleEntry getModuleEntryIfInstalled(Context context) { + public AutofillAssistantModuleEntry getModuleEntryIfInstalled() { if (mNotInstalled) return null; - return super.getModuleEntryIfInstalled(context); + return super.getModuleEntryIfInstalled(); } @Override - public void getModuleEntry( - Context context, Tab tab, Callback<AutofillAssistantModuleEntry> callback) { + public void getModuleEntry(Tab tab, Callback<AutofillAssistantModuleEntry> callback) { if (mCannotInstall) { callback.onResult(null); return; } mNotInstalled = false; - super.getModuleEntry(context, tab, callback); + super.getModuleEntry(tab, callback); } }
diff --git a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantDirectActionHandler.java b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantDirectActionHandler.java index c1b53f9..9c565a3 100644 --- a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantDirectActionHandler.java +++ b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantDirectActionHandler.java
@@ -163,7 +163,7 @@ private void getDelegate( boolean installIfNecessary, Callback<AutofillAssistantActionHandler> callback) { if (mDelegate == null) { - mDelegate = createDelegate(mModuleEntryProvider.getModuleEntryIfInstalled(mContext)); + mDelegate = createDelegate(mModuleEntryProvider.getModuleEntryIfInstalled()); } if (mDelegate != null || !installIfNecessary) { callback.onResult(mDelegate); @@ -176,7 +176,7 @@ callback.onResult(null); return; } - mModuleEntryProvider.getModuleEntry(mContext, tab, (entry) -> { + mModuleEntryProvider.getModuleEntry(tab, (entry) -> { mDelegate = createDelegate(entry); callback.onResult(mDelegate); });
diff --git a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantFacade.java b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantFacade.java index e0bf2444..5e61d7e 100644 --- a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantFacade.java +++ b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantFacade.java
@@ -109,7 +109,7 @@ AutofillAssistantMetrics.recordDropOut(DropOutReason.AA_START); waitForTabWithWebContents(activity, tab -> { AutofillAssistantModuleEntryProvider.INSTANCE.getModuleEntry( - activity, tab, (moduleEntry) -> { + tab, (moduleEntry) -> { if (moduleEntry == null) { AutofillAssistantMetrics.recordDropOut( DropOutReason.DFM_INSTALL_FAILED);
diff --git a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantModuleEntryProvider.java b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantModuleEntryProvider.java index 08b77481..40715b8 100644 --- a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantModuleEntryProvider.java +++ b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantModuleEntryProvider.java
@@ -4,7 +4,6 @@ package org.chromium.chrome.browser.autofill_assistant; -import android.content.Context; import android.support.annotation.Nullable; import org.chromium.base.BundleUtils; @@ -33,9 +32,8 @@ /* Returns the AA module entry, if it is already installed. */ @Nullable - /* package */ AutofillAssistantModuleEntry getModuleEntryIfInstalled(Context context) { - // Required to access resources in DFM using this activity as context. - ModuleInstaller.getInstance().initActivity(context); + /* package */ + AutofillAssistantModuleEntry getModuleEntryIfInstalled() { if (AutofillAssistantModule.isInstalled()) { return AutofillAssistantModule.getImpl(); } @@ -43,14 +41,14 @@ } /** Gets the AA module entry, installing it if necessary. */ - /* package */ void getModuleEntry( - Context context, Tab tab, Callback<AutofillAssistantModuleEntry> callback) { - AutofillAssistantModuleEntry entry = getModuleEntryIfInstalled(context); + /* package */ + void getModuleEntry(Tab tab, Callback<AutofillAssistantModuleEntry> callback) { + AutofillAssistantModuleEntry entry = getModuleEntryIfInstalled(); if (entry != null) { callback.onResult(entry); return; } - loadDynamicModuleWithUi(context, tab, callback); + loadDynamicModuleWithUi(tab, callback); } /** @@ -85,12 +83,12 @@ } private static void loadDynamicModuleWithUi( - Context activity, Tab tab, Callback<AutofillAssistantModuleEntry> callback) { + Tab tab, Callback<AutofillAssistantModuleEntry> callback) { ModuleInstallUi ui = new ModuleInstallUi(tab, R.string.autofill_assistant_module_title, new ModuleInstallUi.FailureUiListener() { @Override public void onRetry() { - loadDynamicModuleWithUi(activity, tab, callback); + loadDynamicModuleWithUi(tab, callback); } @Override @@ -102,9 +100,6 @@ ui.showInstallStartUi(); ModuleInstaller.getInstance().install("autofill_assistant", (success) -> { if (success) { - // Clean install of chrome will have issues here without initializing - // after installation of DFM. - ModuleInstaller.getInstance().initActivity(activity); // Don't show success UI from DFM, transition to autobot UI directly. callback.onResult(AutofillAssistantModule.getImpl()); return;
diff --git a/chrome/android/java/res/layout/bookmark_widget.xml b/chrome/android/java/res/layout/bookmark_widget.xml index a0e17dfa..3ddec7a8 100644 --- a/chrome/android/java/res/layout/bookmark_widget.xml +++ b/chrome/android/java/res/layout/bookmark_widget.xml
@@ -5,9 +5,11 @@ <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/bookmarks_list" + style="@style/DarkModeCompatibleVerticalScrolling" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/bookmark_widget_background" android:divider="@null" android:drawSelectorOnTop="true" - android:listSelector="@drawable/bookmark_widget_list_selector" /> + android:listSelector="@drawable/bookmark_widget_list_selector" + android:alpha="0.9" />
diff --git a/chrome/android/java/res/layout/bookmark_widget_item.xml b/chrome/android/java/res/layout/bookmark_widget_item.xml index ecbe33b..2816f3d 100644 --- a/chrome/android/java/res/layout/bookmark_widget_item.xml +++ b/chrome/android/java/res/layout/bookmark_widget_item.xml
@@ -28,6 +28,6 @@ android:paddingEnd="16dp" android:singleLine="true" android:textAlignment="viewStart" - android:textAppearance="@style/TextAppearance.BookmarkWidgetItemText" /> + android:textAppearance="@style/TextAppearance.BlackTitle1" /> </LinearLayout>
diff --git a/chrome/android/java/res/values-v17/styles.xml b/chrome/android/java/res/values-v17/styles.xml index 5ba4933..b479863 100644 --- a/chrome/android/java/res/values-v17/styles.xml +++ b/chrome/android/java/res/values-v17/styles.xml
@@ -839,10 +839,6 @@ parent="@style/TextAppearance.AppCompat.Medium"> <item name="android:textColor">@color/standard_mode_tint</item> </style> - <style name="TextAppearance.BookmarkWidgetItemText" - parent="@style/TextAppearance.BlackTitle1"> - <item name="android:textColor">@color/default_text_color_dark</item> - </style> <!-- Download Home --> <style name="DateView"> @@ -985,4 +981,9 @@ <item name="android:textAlignment">viewStart</item> <item name="android:textAppearance">@style/TextAppearance.BlackTitle1</item> </style> + + <!-- Scrolling --> + <style name="DarkModeCompatibleVerticalScrolling"> + <item name="android:scrollbarThumbVertical">@color/default_scroll_thumb</item> + </style> </resources>
diff --git a/chrome/android/java/res/values/colors.xml b/chrome/android/java/res/values/colors.xml index 71a5271ed..faf144d7 100644 --- a/chrome/android/java/res/values/colors.xml +++ b/chrome/android/java/res/values/colors.xml
@@ -170,7 +170,7 @@ <!-- Bookmark widget colors --> <color name="bookmark_widget_pressed_highlight">@color/black_alpha_11</color> - <color name="bookmark_widget_background">#DDFFFFFF</color> + <color name="bookmark_widget_background">@color/modern_primary_color</color> <!-- Payments UI colors --> <color name="payment_request_bg">@color/sheet_bg_color</color> @@ -180,6 +180,9 @@ <!-- History Navigation UI colors --> <color name="navigation_bubble_background_color">@color/default_bg_color_elev_4</color> + <!-- Scrollbar colors --> + <color name="default_scroll_thumb">@color/modern_grey_800_alpha_38</color> + <!-- Other colors --> <color name="media_viewer_bg">#000000</color> <color name="image_viewer_bg">#0E0E0E</color>
diff --git a/chrome/android/java/res_night/values-night/colors.xml b/chrome/android/java/res_night/values-night/colors.xml index 59c0560..b9d1c92 100644 --- a/chrome/android/java/res_night/values-night/colors.xml +++ b/chrome/android/java/res_night/values-night/colors.xml
@@ -35,4 +35,7 @@ <!-- History Navigation UI colors --> <color name="navigation_bubble_background_color">@android:color/white</color> + <!-- Scrollbar colors --> + <color name="default_scroll_thumb">@color/white_alpha_20</color> + </resources>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/ReorderBookmarkItemsAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/ReorderBookmarkItemsAdapter.java index a2a212f5..26ef6ad 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/ReorderBookmarkItemsAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/ReorderBookmarkItemsAdapter.java
@@ -335,6 +335,11 @@ // SyncStateChangedListener implementation. @Override public void syncStateChanged() { + // If mDelegate is null, we will set the top level folders upon its initialization + // (see onBookmarkDelegateInitialized method above). + if (mDelegate == null) { + return; + } mTopLevelFolders.clear(); populateTopLevelFoldersList(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarkswidget/BookmarkWidgetService.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarkswidget/BookmarkWidgetService.java index e792192..eb21a9d2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarkswidget/BookmarkWidgetService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarkswidget/BookmarkWidgetService.java
@@ -35,6 +35,7 @@ import org.chromium.chrome.browser.favicon.LargeIconBridge; import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; import org.chromium.chrome.browser.init.ChromeBrowserInitializer; +import org.chromium.chrome.browser.night_mode.SystemNightModeMonitor; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.util.IntentUtils; import org.chromium.chrome.browser.util.ViewUtils; @@ -103,12 +104,21 @@ if (widgetId >= 0 && serializedFolder != null) { SharedPreferences prefs = getWidgetState(widgetId); prefs.edit().putString(PREF_CURRENT_FOLDER, serializedFolder).apply(); - AppWidgetManager.getInstance(ContextUtils.getApplicationContext()) - .notifyAppWidgetViewDataChanged(widgetId, R.id.bookmarks_list); + redrawWidget(widgetId); } } /** + * Redraws / refreshes a bookmark widget. + * + * @param widgetId The ID of the widget to redraw. + */ + static void redrawWidget(int widgetId) { + AppWidgetManager.getInstance(ContextUtils.getApplicationContext()) + .notifyAppWidgetViewDataChanged(widgetId, R.id.bookmarks_list); + } + + /** * Holds data describing a bookmark or bookmark folder. */ private static class Bookmark { @@ -267,13 +277,13 @@ /** * Provides the RemoteViews, one per bookmark, to be shown in the widget. */ - private static class BookmarkAdapter implements RemoteViewsService.RemoteViewsFactory { - + private static class BookmarkAdapter + implements RemoteViewsFactory, SystemNightModeMonitor.Observer { // Can be accessed on any thread private final Context mContext; private final int mWidgetId; private final SharedPreferences mPreferences; - private final int mIconColor; + private int mIconColor; // Accessed only on the UI thread private BookmarkModel mBookmarkModel; @@ -287,7 +297,8 @@ mWidgetId = widgetId; mPreferences = getWidgetState(mWidgetId); mIconColor = ApiCompatibilityUtils.getColor( - mContext.getResources(), R.color.default_icon_color_dark); + mContext.getResources(), R.color.default_icon_color); + SystemNightModeMonitor.getInstance().addObserver(this); } @UiThread @@ -316,7 +327,7 @@ @Override public void bookmarkModelChanged() { - refreshWidget(); + redrawWidget(mWidgetId); } }); } @@ -353,6 +364,7 @@ if (mBookmarkModel != null) mBookmarkModel.destroy(); }); deleteWidgetState(mWidgetId); + SystemNightModeMonitor.getInstance().removeObserver(this); } @BinderThread @@ -506,5 +518,12 @@ views.setOnClickFillInIntent(R.id.list_item, fillIn); return views; } + + @Override + public void onSystemNightModeChanged() { + mIconColor = ApiCompatibilityUtils.getColor( + mContext.getResources(), R.color.default_icon_color); + redrawWidget(mWidgetId); + } } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java index 22de707..62e580b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
@@ -42,6 +42,7 @@ import org.chromium.components.background_task_scheduler.BackgroundTaskSchedulerExternalUma; import org.chromium.components.crash.browser.ChildProcessCrashObserver; import org.chromium.components.minidump_uploader.CrashFileManager; +import org.chromium.components.module_installer.ModuleActivityObserver; import org.chromium.content_public.browser.BrowserStartupController; import org.chromium.content_public.browser.DeviceUtils; import org.chromium.content_public.browser.SpeechRecognition; @@ -234,8 +235,8 @@ warmUpSharedPrefs(); DeviceUtils.addDeviceSpecificUserAgentSwitch(); - ApplicationStatus.registerStateListenerForAllActivities( - createActivityStateListener()); + ApplicationStatus.registerStateListenerForAllActivities(createActivityStateListener()); + ApplicationStatus.registerStateListenerForAllActivities(new ModuleActivityObserver()); mPreInflationStartupComplete = true; }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ContentViewFocusTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ContentViewFocusTest.java index 561b3460..edebc26 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ContentViewFocusTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ContentViewFocusTest.java
@@ -9,7 +9,6 @@ import android.view.View; import org.junit.Assert; -import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -25,6 +24,7 @@ import org.chromium.chrome.browser.compositor.layouts.LayoutManager; import org.chromium.chrome.browser.compositor.layouts.eventfilter.EdgeSwipeHandler; import org.chromium.chrome.browser.compositor.layouts.eventfilter.ScrollDirection; +import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.util.ChromeTabUtils; @@ -50,7 +50,12 @@ @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) public class ContentViewFocusTest { @Rule - public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + public ChromeTabbedActivityTestRule mChromeTabbedActivityTestRule = + new ChromeTabbedActivityTestRule(); + + @Rule + public ChromeActivityTestRule<? extends ChromeActivity> mActivityTestRule = + ChromeActivityTestRule.forMainActivity(); private static final int WAIT_RESPONSE_MS = 2000; @@ -100,13 +105,14 @@ @Test @FlakyTest(message = "http://crbug.com/172473") public void testHideSelectionOnPhoneTabSwiping() throws Exception { + mChromeTabbedActivityTestRule.startMainActivityOnBlankPage(); // Setup - ChromeTabUtils.newTabsFromMenu( - InstrumentationRegistry.getInstrumentation(), mActivityTestRule.getActivity(), 2); + ChromeTabUtils.newTabsFromMenu(InstrumentationRegistry.getInstrumentation(), + mChromeTabbedActivityTestRule.getActivity(), 2); String url = UrlUtils.getIsolatedTestFileUrl( "chrome/test/data/android/content_view_focus/content_view_focus_long_text.html"); - mActivityTestRule.loadUrl(url); - View view = mActivityTestRule.getActivity().getActivityTab().getContentView(); + mChromeTabbedActivityTestRule.loadUrl(url); + View view = mChromeTabbedActivityTestRule.getActivity().getActivityTab().getContentView(); // Give the content view focus TestTouchUtils.longClickView(InstrumentationRegistry.getInstrumentation(), view, 50, 10); @@ -114,8 +120,9 @@ // Start the swipe addFocusChangedListener(view); - final EdgeSwipeHandler edgeSwipeHandler = - mActivityTestRule.getActivity().getLayoutManager().getToolbarSwipeHandler(); + final EdgeSwipeHandler edgeSwipeHandler = mChromeTabbedActivityTestRule.getActivity() + .getLayoutManager() + .getToolbarSwipeHandler(); PostTask.runOrPostTask(UiThreadTaskTraits.DEFAULT, () -> { edgeSwipeHandler.swipeStarted(ScrollDirection.RIGHT, 0, 0); edgeSwipeHandler.swipeUpdated(100, 0, 100, 0, 100, 0); @@ -125,7 +132,8 @@ new Criteria("Layout still requesting Tab Android view be attached") { @Override public boolean isSatisfied() { - LayoutManager driver = mActivityTestRule.getActivity().getLayoutManager(); + LayoutManager driver = + mChromeTabbedActivityTestRule.getActivity().getLayoutManager(); return !driver.getActiveLayout().shouldDisplayContentOverlay(); } }); @@ -141,7 +149,8 @@ new Criteria("Layout not requesting Tab Android view be attached") { @Override public boolean isSatisfied() { - LayoutManager driver = mActivityTestRule.getActivity().getLayoutManager(); + LayoutManager driver = + mChromeTabbedActivityTestRule.getActivity().getLayoutManager(); return driver.getActiveLayout().shouldDisplayContentOverlay(); } }); @@ -162,20 +171,22 @@ @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) @FlakyTest(message = "http://crbug.com/967128") public void testHideSelectionOnPhoneTabSwitcher() throws Exception { + mChromeTabbedActivityTestRule.startMainActivityOnBlankPage(); // Setup OverviewModeBehaviorWatcher showWatcher = new OverviewModeBehaviorWatcher( - mActivityTestRule.getActivity().getLayoutManager(), true, false); + mChromeTabbedActivityTestRule.getActivity().getLayoutManager(), true, false); OverviewModeBehaviorWatcher hideWatcher = new OverviewModeBehaviorWatcher( - mActivityTestRule.getActivity().getLayoutManager(), false, true); - View currentView = mActivityTestRule.getActivity().getActivityTab().getContentView(); + mChromeTabbedActivityTestRule.getActivity().getLayoutManager(), false, true); + View currentView = + mChromeTabbedActivityTestRule.getActivity().getActivityTab().getContentView(); addFocusChangedListener(currentView); // Enter the tab switcher View tabSwitcherButton = - mActivityTestRule.getActivity().findViewById(R.id.tab_switcher_button); + mChromeTabbedActivityTestRule.getActivity().findViewById(R.id.tab_switcher_button); Assert.assertNotNull("'tab_switcher_button' view is not found.", tabSwitcherButton); TouchCommon.singleClickView( - mActivityTestRule.getActivity().findViewById(R.id.tab_switcher_button)); + mChromeTabbedActivityTestRule.getActivity().findViewById(R.id.tab_switcher_button)); showWatcher.waitForBehavior(); // Make sure the view loses focus. It is immediately given focus back @@ -183,10 +194,11 @@ Assert.assertFalse("Content view didn't lose focus", blockForFocusChanged()); // Hide the tab switcher - tabSwitcherButton = mActivityTestRule.getActivity().findViewById(R.id.tab_switcher_button); + tabSwitcherButton = + mChromeTabbedActivityTestRule.getActivity().findViewById(R.id.tab_switcher_button); Assert.assertNotNull("'tab_switcher_button' view is not found.", tabSwitcherButton); TouchCommon.singleClickView( - mActivityTestRule.getActivity().findViewById(R.id.tab_switcher_button)); + mChromeTabbedActivityTestRule.getActivity().findViewById(R.id.tab_switcher_button)); hideWatcher.waitForBehavior(); Assert.assertTrue("Content view didn't regain focus", blockForFocusChanged()); @@ -201,6 +213,7 @@ @Test @MediumTest public void testPauseTriggersBlur() throws Exception { + mActivityTestRule.startMainActivityOnBlankPage(); final WebContents webContents = mActivityTestRule.getWebContents(); final CallbackHelper onTitleUpdatedHelper = new CallbackHelper(); final WebContentsObserver observer = @@ -228,9 +241,4 @@ Assert.assertEquals("focused", mTitle); mActivityTestRule.getWebContents().removeObserver(observer); } - - @Before - public void setUp() throws InterruptedException { - mActivityTestRule.startMainActivityOnBlankPage(); - } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ExampleUiCaptureTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ExampleUiCaptureTest.java index 3ad26ae..d158104a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ExampleUiCaptureTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ExampleUiCaptureTest.java
@@ -15,8 +15,8 @@ import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction; import org.chromium.chrome.browser.test.ScreenShooter; +import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; -import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.ui.test.util.UiRestriction; import java.io.IOException; @@ -29,7 +29,8 @@ @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) // Tab switcher button only exists on phones. public class ExampleUiCaptureTest { @Rule - public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + public ChromeActivityTestRule<? extends ChromeActivity> mActivityTestRule = + ChromeActivityTestRule.forMainActivity(); @Rule public ScreenShooter mScreenShooter = new ScreenShooter();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/FeaturesAnnotationsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/FeaturesAnnotationsTest.java index 7611959f..57ed9bf 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/FeaturesAnnotationsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/FeaturesAnnotationsTest.java
@@ -16,8 +16,8 @@ import org.chromium.base.CommandLine; import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; -import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.Features.DisableFeatures; import org.chromium.chrome.test.util.browser.Features.EnableFeatures; @@ -32,7 +32,8 @@ @CommandLineFlags.Add(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE) public class FeaturesAnnotationsTest { @Rule - public ChromeTabbedActivityTestRule mActivityRule = new ChromeTabbedActivityTestRule(); + public ChromeActivityTestRule<? extends ChromeActivity> mActivityRule = + ChromeActivityTestRule.forMainActivity(); /** * Tests that {@link EnableFeatures} and {@link DisableFeatures} can alter the flags registered
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/HTTPSTabsOpenedFromExternalAppTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/HTTPSTabsOpenedFromExternalAppTest.java index a30d425f..134c02e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/HTTPSTabsOpenedFromExternalAppTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/HTTPSTabsOpenedFromExternalAppTest.java
@@ -16,8 +16,8 @@ import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; +import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; -import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.net.test.EmbeddedTestServer; import org.chromium.net.test.ServerCertificate; import org.chromium.network.mojom.ReferrerPolicy; @@ -30,7 +30,8 @@ public class HTTPSTabsOpenedFromExternalAppTest { @Rule - public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + public ChromeActivityTestRule<? extends ChromeActivity> mActivityTestRule = + ChromeActivityTestRule.forMainActivity(); private EmbeddedTestServer mTestServer;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsOpenedFromExternalAppTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsOpenedFromExternalAppTest.java index ee4bf9d1..6f07013 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsOpenedFromExternalAppTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsOpenedFromExternalAppTest.java
@@ -34,8 +34,9 @@ import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tabmodel.TabModelUtils; +import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; -import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.util.ApplicationTestUtils; import org.chromium.chrome.test.util.ChromeTabUtils; import org.chromium.chrome.test.util.browser.Features.DisableFeatures; @@ -61,7 +62,8 @@ @RetryOnFailure public class TabsOpenedFromExternalAppTest { @Rule - public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + public ChromeActivityTestRule<? extends ChromeActivity> mActivityTestRule = + ChromeActivityTestRule.forMainActivity(); static final String HTTP_REFERRER = "http://chromium.org/"; @@ -194,7 +196,7 @@ * Returns when the URL has been navigated to. * @throws InterruptedException */ - private static void launchUrlFromExternalApp(ChromeTabbedActivityTestRule testRule, String url, + private static void launchUrlFromExternalApp(ChromeActivityTestRule testRule, String url, String expectedUrl, String appId, boolean createNewTab, Bundle extras, boolean firstParty) throws InterruptedException { final Intent intent = new Intent(Intent.ACTION_VIEW); @@ -215,7 +217,9 @@ final Tab originalTab = testRule.getActivity().getActivityTab(); TestThreadUtils.runOnUiThreadBlocking(() -> testRule.getActivity().onNewIntent(intent)); - if (createNewTab) { + // NoTouchMode changes external app launch behaviour depending on whether Chrome is + // foregrounded - which it is for these tests. + if (createNewTab && !FeatureUtilities.isNoTouchModeEnabled()) { CriteriaHelper.pollUiThread(new Criteria("Failed to select different tab") { @Override public boolean isSatisfied() { @@ -377,11 +381,11 @@ } /** - * Launches a tab with the given url using the given {@link ChromeTabbedActivityTestRule}, + * Launches a tab with the given url using the given {@link ChromeActivityTestRule}, * adds a {@link Referrer} with given policy and checks whether it matches the expected * referrer after loaded. */ - static void launchAndVerifyReferrerWithPolicy(String url, ChromeTabbedActivityTestRule testRule, + static void launchAndVerifyReferrerWithPolicy(String url, ChromeActivityTestRule testRule, int policy, String referrer, String expectedReferrer) throws InterruptedException { testRule.startMainActivityFromLauncher(); Bundle extras = new Bundle();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/CompositorVisibilityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/CompositorVisibilityTest.java index 0d8e880c..6b252c6 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/CompositorVisibilityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/compositor/CompositorVisibilityTest.java
@@ -18,10 +18,11 @@ import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.MinAndroidSdkLevel; +import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.compositor.layouts.LayoutRenderHost; +import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; -import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.ui.resources.ResourceManager; /** @@ -32,7 +33,8 @@ @MinAndroidSdkLevel(Build.VERSION_CODES.LOLLIPOP) public class CompositorVisibilityTest { @Rule - public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + public ChromeActivityTestRule<? extends ChromeActivity> mActivityTestRule = + ChromeActivityTestRule.forMainActivity(); private CompositorView mCompositorView;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/DirectActionAvailabilityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/DirectActionAvailabilityTest.java index 446997b3..1e4c6bc 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/DirectActionAvailabilityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/DirectActionAvailabilityTest.java
@@ -7,6 +7,7 @@ import static org.junit.Assert.assertTrue; import android.annotation.TargetApi; +import android.content.Intent; import android.os.Build; import android.support.test.InstrumentationRegistry; import android.support.test.filters.MediumTest; @@ -22,9 +23,11 @@ import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.IntentHandler; import org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule; import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils; import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.browser.webapps.WebappActivityTestRule; import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; @@ -76,9 +79,13 @@ @MediumTest @Feature({"DirectActions"}) public void testCoreDirectActionInCustomTabActivity() throws Exception { - mCustomTabActivityTestRule.startCustomTabActivityWithIntent( - CustomTabsTestUtils.createMinimalCustomTabIntent( - InstrumentationRegistry.getTargetContext(), "about:blank")); + Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent( + InstrumentationRegistry.getTargetContext(), "about:blank"); + if (FeatureUtilities.isNoTouchModeEnabled()) { + // NoTouchMode only allows CCT for 1p use-cases. + IntentHandler.addTrustedIntentExtras(intent); + } + mCustomTabActivityTestRule.startCustomTabActivityWithIntent(intent); assertThat(setupActivityAndGetDirectAction(mCustomTabActivityTestRule), Matchers.containsInAnyOrder(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/DirectActionsInActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/DirectActionsInActivityTest.java index 6f5fa42d..c3025a0 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/DirectActionsInActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/DirectActionsInActivityTest.java
@@ -27,8 +27,8 @@ import org.chromium.base.test.util.UserActionTester; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; -import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.content_public.browser.test.util.TestThreadUtils; /** @@ -42,7 +42,8 @@ @TargetApi(24) // For java.util.function.Consumer. public class DirectActionsInActivityTest { @Rule - public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + public ChromeActivityTestRule<? extends ChromeActivity> mActivityTestRule = + ChromeActivityTestRule.forMainActivity(); @Rule public DirectActionTestRule mDirectActionRule = new DirectActionTestRule();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandlerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandlerTest.java index 8439ef5..c929c53 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandlerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/directactions/MenuDirectActionHandlerTest.java
@@ -27,6 +27,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.tabmodel.SingleTabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; @@ -87,6 +88,9 @@ assertThat(getDirectActions(), Matchers.containsInAnyOrder("bookmark_this_page", "reload", "downloads", "help", "new_tab", "open_history", "preferences", "close_all_tabs")); + + // Tabs can't be closed for SingleTab Activities. + if (mTabModelSelector instanceof SingleTabModelSelector) return; TestThreadUtils.runOnUiThreadBlocking(() -> { mTabModelSelector.closeAllTabs(); }); assertThat(getDirectActions(), Matchers.containsInAnyOrder("downloads", "help", "new_tab", "preferences"));
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java index 5ce4715..d86fb65 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTest.java
@@ -33,14 +33,15 @@ import org.chromium.base.test.util.RetryOnFailure; import org.chromium.base.test.util.UrlUtils; import org.chromium.chrome.R; +import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.omnibox.UrlBar; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabStateBrowserControlsVisibilityDelegate; import org.chromium.chrome.browser.tab.TabWebContentsDelegateAndroid; +import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; -import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.util.FullscreenTestUtils; import org.chromium.chrome.test.util.OmniboxTestUtils; import org.chromium.chrome.test.util.PrerenderTestHelper; @@ -73,7 +74,8 @@ @RetryOnFailure public class FullscreenManagerTest { @Rule - public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + public ChromeActivityTestRule<? extends ChromeActivity> mActivityTestRule = + ChromeActivityTestRule.forMainActivity(); private static final String LONG_HTML_WITH_AUTO_FOCUS_INPUT_TEST_PAGE = UrlUtils.encodeHtmlDataUri("<html>"
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTestUtils.java b/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTestUtils.java index a499d75..83360ff 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTestUtils.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/fullscreen/FullscreenManagerTestUtils.java
@@ -12,7 +12,7 @@ import org.chromium.base.test.util.CallbackHelper; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager.FullscreenListener; import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.content_public.browser.GestureListenerManager; import org.chromium.content_public.browser.GestureStateListener; import org.chromium.content_public.browser.RenderCoordinates; @@ -37,7 +37,7 @@ * @param testRule The test rule for the currently running test. * @param show Whether the browser controls should be shown. */ - public static void scrollBrowserControls(ChromeTabbedActivityTestRule testRule, boolean show) { + public static void scrollBrowserControls(ChromeActivityTestRule testRule, boolean show) { ChromeFullscreenManager fullscreenManager = testRule.getActivity().getFullscreenManager(); int browserControlsHeight = fullscreenManager.getTopControlsHeight(); @@ -69,7 +69,7 @@ * @param position The desired top controls offset. */ public static void waitForBrowserControlsPosition( - ChromeTabbedActivityTestRule testRule, int position) { + ChromeActivityTestRule testRule, int position) { final ChromeFullscreenManager fullscreenManager = testRule.getActivity().getFullscreenManager(); CriteriaHelper.pollUiThread(Criteria.equals(position, new Callable<Integer>() { @@ -106,7 +106,7 @@ * @param tab The current activity tab. */ public static void waitForBrowserControlsToBeMoveable( - ChromeTabbedActivityTestRule testRule, final Tab tab) throws InterruptedException { + ChromeActivityTestRule testRule, final Tab tab) throws InterruptedException { waitForBrowserControlsPosition(testRule, 0); final CallbackHelper contentMovedCallback = new CallbackHelper(); @@ -231,7 +231,7 @@ () -> BrowserStateBrowserControlsVisibilityDelegate.disableForTesting()); } - public static void fling(ChromeTabbedActivityTestRule testRule, final int vx, final int vy) { + public static void fling(ChromeActivityTestRule testRule, final int vx, final int vy) { PostTask.runOrPostTask( UiThreadTaskTraits.DEFAULT, () -> { testRule.getWebContents().getEventForwarder().startFling(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/test/smoke/AndroidManifest_bundle.xml b/chrome/android/javatests/src/org/chromium/chrome/test/smoke/AndroidManifest_bundle.xml new file mode 100644 index 0000000..b1057ab --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/test/smoke/AndroidManifest_bundle.xml
@@ -0,0 +1,24 @@ +<!-- + * Copyright 2019 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. +--> + +<manifest + xmlns:android="http://schemas.android.com/apk/res/android" + package="org.chromium.chrome.test.smoke.bundle"> + + <uses-permission android:name="android.permission.RUN_INSTRUMENTATION" /> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> + + <!-- We add an application tag here just so that we can indicate that this + package needs to link against the android.test library, which is + needed when building test cases. --> + <application> + <uses-library android:name="android.test.runner" /> + </application> + + <instrumentation android:name="org.chromium.base.test.BaseChromiumAndroidJUnitRunner" + android:targetPackage="org.chromium.chrome.test.smoke.bundle" + android:label="Runner for org.chromium.chrome.test.smoke.bundle"/> +</manifest>
diff --git a/chrome/android/javatests/src/org/chromium/chrome/test/smoke/ChromeBundleSmokeTest.java b/chrome/android/javatests/src/org/chromium/chrome/test/smoke/ChromeBundleSmokeTest.java new file mode 100644 index 0000000..6ff3f8c2 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/test/smoke/ChromeBundleSmokeTest.java
@@ -0,0 +1,64 @@ +// Copyright 2019 The Chromium 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.test.smoke; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.support.test.InstrumentationRegistry; +import android.support.test.filters.SmallTest; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.RuleChain; +import org.junit.rules.TestRule; +import org.junit.runner.RunWith; + +import org.chromium.base.test.BaseJUnit4ClassRunner; +import org.chromium.chrome.test.pagecontroller.rules.ChromeUiApplicationTestRule; +import org.chromium.chrome.test.pagecontroller.rules.ChromeUiAutomatorTestRule; +import org.chromium.chrome.test.pagecontroller.utils.Ui2Locators; +import org.chromium.chrome.test.pagecontroller.utils.UiAutomatorUtils; + +/** Smoke Test for Chrome bundles. */ +@SmallTest +@RunWith(BaseJUnit4ClassRunner.class) +public class ChromeBundleSmokeTest { + private static final String PACKAGE_NAME_ARG = "PackageUnderTest"; + private static final String TARGET_ACTIVITY = + "org.chromium.chrome.features.test_dummy.TestDummyActivity"; + + public ChromeUiAutomatorTestRule mRule = new ChromeUiAutomatorTestRule(); + public ChromeUiApplicationTestRule mChromeUiRule = new ChromeUiApplicationTestRule(); + @Rule + public final TestRule mChain = RuleChain.outerRule(mChromeUiRule).around(mRule); + + private String mPackageName; + + @Before + public void setUp() { + // TODO (tiborg): Adjust this as needed according to https://crrev.com/c/1585142. + mPackageName = InstrumentationRegistry.getArguments().getString(PACKAGE_NAME_ARG); + Assert.assertNotNull("Must specify bundle under test", mPackageName); + mChromeUiRule.launchIntoNewTabPageOnFirstRun(); + } + + @Test + public void testModuleInstall() { + // Send intent that makes Chrome install the test dummy module. + Context context = InstrumentationRegistry.getContext(); + Intent intent = new Intent(); + intent.setComponent(new ComponentName(mPackageName, TARGET_ACTIVITY)); + intent.putExtra("test_case", 0); // Test case EXECUTE_JAVA. + intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + + // Wait for done dialog to show up. + Assert.assertTrue(UiAutomatorUtils.getInstance().getLocatorHelper().isOnScreen( + Ui2Locators.withText("Test Case 0: done"))); + } +}
diff --git a/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/NoTouchActivity.java b/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/NoTouchActivity.java index f6a4889..7edbdb21 100644 --- a/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/NoTouchActivity.java +++ b/chrome/android/touchless/java/src/org/chromium/chrome/browser/touchless/NoTouchActivity.java
@@ -183,7 +183,8 @@ public void onNewIntent(Intent intent) { mIntentHandlingTimeMs = SystemClock.uptimeMillis(); - if (DINOSAUR_GAME_INTENT.equals(intent.getComponent().getClassName())) { + if (intent.getComponent() != null + && DINOSAUR_GAME_INTENT.equals(intent.getComponent().getClassName())) { intent.setData(Uri.parse(UrlConstants.CHROME_DINO_URL)); }
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index 9b7ecd4..ecb193c 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -5193,10 +5193,10 @@ <message name="IDS_SETTINGS_SECURITY_KEYS_HIDE_PINS" desc="A tool-tip message that is shown to describe the action of an icon in the dialog where users set or enter PINs for security keys. This message indicates to the user that clicking the icon will cause the PINs to be displayed like passwords: with the characters replaced by bullet points. (Security keys are external devices used to authenticate people and PINs are short, often numeric, codes that are commonly used with, for example, ATMs.)"> Hide PINs </message> - <message name="IDS_SETTINGS_SECURITY_KEYS_CREDENTIAL_MANAGEMENT_LABEL" desc="The label for a menu item that when clicked let's the user view and erase credentials on their security key (an authentication hardware device)."> + <message name="IDS_SETTINGS_SECURITY_KEYS_CREDENTIAL_MANAGEMENT_LABEL" desc="The label for a menu item that when clicked lets the user view and erase credentials on their security key (an authentication hardware device)."> Manage sign-in data </message> - <message name="IDS_SETTINGS_SECURITY_KEYS_CREDENTIAL_MANAGEMENT_DESC" desc="The description for a menu item that when clicked let's the user view and erase credentials on their security key (an authentication hardware device)."> + <message name="IDS_SETTINGS_SECURITY_KEYS_CREDENTIAL_MANAGEMENT_DESC" desc="The description for a menu item that when clicked lets the user view and erase credentials on their security key (an authentication hardware device)."> View and delete the sign-in data stored on your security key </message> <message name="IDS_SETTINGS_SECURITY_KEYS_CREDENTIAL_MANAGEMENT_DIALOG_TITLE" desc="The title of a dialog that lets users view and erase credentials on their security key (an authentication hardware device)."> @@ -5235,4 +5235,28 @@ <message name="IDS_SETTINGS_SECURITY_KEYS_CREDENTIAL_MANAGEMENT_FAILED" desc="Label of a button that lets a user delete individual credentials on their security key (an authentication hardware device)."> Your sign-in data couldn't be deleted </message> + <message name="IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_SUBPAGE_DESCRIPTION" desc="The description for a menu item that when clicked lets the user view, add, rename, and delete fingerprints on their security key (an authentication hardware device)."> + Add, rename, and delete fingerprints saved on your device + </message> + <message name="IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_DIALOG_TITLE" desc="The title of a dialog that lets users view, add, rename, and delete fingerprints on their security key (an authentication hardware device)."> + Manage fingerprints + </message> + <message name="IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_TOUCH" desc="A label instructing the user to physically touch the activation button on their security key (an authentication hardware device)."> + To manage your fingerprints, insert and touch your security key. + </message> + <message name="IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_PIN_PROMPT" desc="A label instructing the user to enter the PIN (short, often numeric codes that are often used with, for example, ATM cards) for their security key (an authentication hardware device)."> + To manage your fingerprints, enter the PIN for your security key. If you don’t know the PIN, you’ll need to reset the security key. + </message> + <message name="IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_NO_ENROLLMENTS" desc="A label informing the user that there are no fingerprints stored on their security key (authentication hardware device)."> + Your security key has no fingerprints stored. + </message> + <message name="IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_LABEL" desc="A label informing the user that they may add, remove, or rename fingerprints on their security key (authentication hardware device)."> + You may add, remove, or rename fingerprints here. + </message> + <message name="IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_ENROLLING_LABEL" desc="A label instructing the user to repeatedly touch the fingerprint sensor on their security key (authentication hardware device) to take samples for a new fingerprint."> + Keep touching your security key to save your fingerprint. + </message> + <message name="IDS_SETTINGS_SECURITY_KEYS_NO_BIOMETRIC_ENROLLMENT" desc="An error message shown when a user attempts to use the fingerprint sensor on their security key (an authentication hardware device) but the security key is not capable of storing fingerprints, or does not have a fingerprint sensor."> + Your security key can't store fingerprints + </message> </grit-part>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 06b0ffd..dc50ca3 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -3353,13 +3353,14 @@ "serial/serial_chooser_context.h", "serial/serial_chooser_context_factory.cc", "serial/serial_chooser_context_factory.h", - "sharing/click_to_call/click_to_call_constants.h", "sharing/click_to_call/click_to_call_context_menu_observer.cc", "sharing/click_to_call/click_to_call_context_menu_observer.h", "sharing/click_to_call/click_to_call_sharing_dialog_controller.cc", "sharing/click_to_call/click_to_call_sharing_dialog_controller.h", "sharing/click_to_call/click_to_call_utils.cc", "sharing/click_to_call/click_to_call_utils.h", + "sharing/shared_clipboard/shared_clipboard_ui_controller.cc", + "sharing/shared_clipboard/shared_clipboard_ui_controller.h", "sharing/sharing_dialog.h", "sharing/sharing_dialog_controller.cc", "sharing/sharing_dialog_controller.h", @@ -5403,6 +5404,8 @@ "search_engines/template_url_service_test_util.h", "signin/chrome_signin_client_test_util.cc", "signin/chrome_signin_client_test_util.h", + "signin/e2e_tests/test_accounts_util.cc", + "signin/e2e_tests/test_accounts_util.h", "signin/identity_test_environment_profile_adaptor.cc", "signin/identity_test_environment_profile_adaptor.h", "signin/scoped_account_consistency.cc",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 4c173e4f..cae9577 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -2047,6 +2047,9 @@ {"webxr-hit-test", flag_descriptions::kWebXrHitTestName, flag_descriptions::kWebXrHitTestDescription, kOsAll, FEATURE_VALUE_TYPE(features::kWebXrHitTest)}, + {"webxr-anchors", flag_descriptions::kWebXrAnchorsName, + flag_descriptions::kWebXrAnchorsDescription, kOsAll, + FEATURE_VALUE_TYPE(features::kWebXrPlaneDetection)}, {"webxr-plane-detection", flag_descriptions::kWebXrPlaneDetectionName, flag_descriptions::kWebXrPlaneDetectionDescription, kOsAll, FEATURE_VALUE_TYPE(features::kWebXrPlaneDetection)},
diff --git a/chrome/browser/about_flags_unittest.cc b/chrome/browser/about_flags_unittest.cc index de09cde..c4293582b 100644 --- a/chrome/browser/about_flags_unittest.cc +++ b/chrome/browser/about_flags_unittest.cc
@@ -6,9 +6,11 @@ #include <stddef.h> +#include <algorithm> #include <map> #include <set> #include <string> +#include <utility> #include "base/base_paths.h" #include "base/feature_list.h" @@ -28,8 +30,8 @@ namespace { -typedef base::HistogramBase::Sample Sample; -typedef std::map<std::string, Sample> SwitchToIdMap; +using Sample = base::HistogramBase::Sample; +using SwitchToIdMap = std::map<std::string, Sample>; // Get all associated switches corresponding to defined about_flags.cc entries. std::set<std::string> GetAllSwitchesAndFeaturesForTesting() { @@ -68,6 +70,34 @@ return result; } +enum class FlagFile { kFlagMetadata, kFlagNeverExpire }; + +std::string FlagFileName(FlagFile file) { + switch (file) { + case FlagFile::kFlagMetadata: + return "flag-metadata.json"; + case FlagFile::kFlagNeverExpire: + return "flag-never-expire-list.json"; + } +} + +base::Value FileContents(FlagFile file) { + std::string filename = FlagFileName(file); + + base::FilePath metadata_path; + base::PathService::Get(base::DIR_SOURCE_ROOT, &metadata_path); + JSONFileValueDeserializer deserializer( + metadata_path.AppendASCII("chrome").AppendASCII("browser").AppendASCII( + filename)); + int error_code; + std::string error_message; + std::unique_ptr<base::Value> json = + deserializer.Deserialize(&error_code, &error_message); + DCHECK(json) << "Failed to load " << filename << ": " << error_code << " " + << error_message; + return std::move(*json); +} + struct FlagMetadataEntry { std::vector<std::string> owners; int expiry_milestone; @@ -76,20 +106,10 @@ using FlagMetadataMap = std::map<std::string, FlagMetadataEntry>; FlagMetadataMap LoadFlagMetadata() { - FlagMetadataMap metadata; - base::FilePath metadata_path; - base::PathService::Get(base::DIR_SOURCE_ROOT, &metadata_path); - JSONFileValueDeserializer deserializer( - metadata_path.AppendASCII("chrome").AppendASCII("browser").AppendASCII( - "flag-metadata.json")); - int error_code; - std::string error_message; - std::unique_ptr<base::Value> metadata_json = - deserializer.Deserialize(&error_code, &error_message); - DCHECK(metadata_json) << "Failed to load flag metadata: " << error_code << " " - << error_message; + base::Value metadata_json = FileContents(FlagFile::kFlagMetadata); - for (const auto& entry : metadata_json->GetList()) { + FlagMetadataMap metadata; + for (const auto& entry : metadata_json.GetList()) { std::string name = entry.FindKey("name")->GetString(); std::vector<std::string> owners; if (const base::Value* e = entry.FindKey("owners")) { @@ -104,20 +124,10 @@ } std::vector<std::string> LoadFlagNeverExpireList() { - base::FilePath list_path; - base::PathService::Get(base::DIR_SOURCE_ROOT, &list_path); - JSONFileValueDeserializer deserializer( - list_path.AppendASCII("chrome").AppendASCII("browser").AppendASCII( - "flag-never-expire-list.json")); - int error_code; - std::string error_message; - std::unique_ptr<base::Value> list_json = - deserializer.Deserialize(&error_code, &error_message); - DCHECK(list_json) << "Failed to load flag never expire list: " << error_code - << " " << error_message; + base::Value list_json = FileContents(FlagFile::kFlagNeverExpire); std::vector<std::string> result; - for (const auto& entry : list_json->GetList()) { + for (const auto& entry : list_json.GetList()) { result.push_back(entry.GetString()); } return result; @@ -191,6 +201,69 @@ << "Flags missing owners: " << base::JoinString(sad_flags, "\n "); } +namespace { + +void EnsureNamesAreAlphabetical( + const std::vector<std::string>& normalized_names, + const std::vector<std::string>& names, + FlagFile file) { + if (normalized_names.size() < 2) + return; + + for (size_t i = 1; i < normalized_names.size(); ++i) { + if (i == normalized_names.size() - 1) { + // The last item on the list has less context. + EXPECT_TRUE(normalized_names[i - 1] < normalized_names[i]) + << "Correct alphabetical order does not place '" << names[i] + << "' after '" << names[i - 1] << "' in " << FlagFileName(file); + } else { + EXPECT_TRUE(normalized_names[i - 1] < normalized_names[i] && + normalized_names[i] < normalized_names[i + 1]) + << "Correct alphabetical order does not place '" << names[i] + << "' between '" << names[i - 1] << "' and '" << names[i + 1] + << "' in " << FlagFileName(file); + } + } +} + +std::string NormalizeName(const std::string& name) { + std::string normalized_name = base::ToLowerASCII(name); + std::replace(normalized_name.begin(), normalized_name.end(), '_', '-'); + + return normalized_name; +} + +} // namespace + +// For some bizarre reason, far too many people see a file filled with +// alphabetically-ordered items and think "hey, let me drop this new item into a +// random location!" Prohibit such behavior in the flags files. +TEST(AboutFlagsTest, FlagsListedInAlphabeticalOrder) { + base::Value metadata_json = FileContents(FlagFile::kFlagMetadata); + + std::vector<std::string> normalized_names; + std::vector<std::string> names; + for (const auto& entry : metadata_json.GetList()) { + normalized_names.push_back( + NormalizeName(entry.FindKey("name")->GetString())); + names.push_back(entry.FindKey("name")->GetString()); + } + + EnsureNamesAreAlphabetical(normalized_names, names, FlagFile::kFlagMetadata); + + base::Value expiration_json = FileContents(FlagFile::kFlagNeverExpire); + + normalized_names.clear(); + names.clear(); + for (const auto& entry : expiration_json.GetList()) { + normalized_names.push_back(NormalizeName(entry.GetString())); + names.push_back(entry.GetString()); + } + + EnsureNamesAreAlphabetical(normalized_names, names, + FlagFile::kFlagNeverExpire); +} + class AboutFlagsHistogramTest : public ::testing::Test { protected: // This is a helper function to check that all IDs in enum LoginCustomFlags in
diff --git a/chrome/browser/android/vr/arcore_device/arcore_shim.cc b/chrome/browser/android/vr/arcore_device/arcore_shim.cc index 4ee8a62f2..6ae60827 100644 --- a/chrome/browser/android/vr/arcore_device/arcore_shim.cc +++ b/chrome/browser/android/vr/arcore_device/arcore_shim.cc
@@ -13,6 +13,14 @@ // Run CALL macro for every function defined in the API. #define FOR_EACH_API_FN \ + CALL(ArAnchorList_acquireItem) \ + CALL(ArAnchorList_create) \ + CALL(ArAnchorList_destroy) \ + CALL(ArAnchorList_getSize) \ + CALL(ArAnchor_detach) \ + CALL(ArAnchor_getPose) \ + CALL(ArAnchor_getTrackingState) \ + CALL(ArAnchor_release) \ CALL(ArCamera_getDisplayOrientedPose) \ CALL(ArCamera_getProjectionMatrix) \ CALL(ArCamera_getTrackingState) \ @@ -22,6 +30,7 @@ CALL(ArFrame_acquireCamera) \ CALL(ArFrame_create) \ CALL(ArFrame_destroy) \ + CALL(ArFrame_getUpdatedAnchors) \ CALL(ArFrame_getUpdatedTrackables) \ CALL(ArFrame_hitTestRay) \ CALL(ArFrame_transformCoordinates2d) \ @@ -43,10 +52,12 @@ CALL(ArPose_destroy) \ CALL(ArPose_getMatrix) \ CALL(ArPose_getPoseRaw) \ + CALL(ArSession_acquireNewAnchor) \ CALL(ArSession_configure) \ CALL(ArSession_create) \ CALL(ArSession_destroy) \ CALL(ArSession_enableIncognitoMode_private) \ + CALL(ArSession_getAllAnchors) \ CALL(ArSession_getAllTrackables) \ CALL(ArSession_pause) \ CALL(ArSession_resume) \ @@ -115,6 +126,50 @@ #undef FOR_EACH_API_FN +void ArAnchorList_acquireItem(const ArSession* session, + const ArAnchorList* anchor_list, + int32_t index, + ArAnchor** out_anchor) { + arcore_api->impl_ArAnchorList_acquireItem(session, anchor_list, index, + out_anchor); +} + +void ArAnchorList_create(const ArSession* session, + ArAnchorList** out_anchor_list) { + arcore_api->impl_ArAnchorList_create(session, out_anchor_list); +} + +void ArAnchorList_destroy(ArAnchorList* anchor_list) { + arcore_api->impl_ArAnchorList_destroy(anchor_list); +} + +void ArAnchorList_getSize(const ArSession* session, + const ArAnchorList* anchor_list, + int32_t* out_size) { + arcore_api->impl_ArAnchorList_getSize(session, anchor_list, out_size); +} + +void ArAnchor_detach(ArSession* session, ArAnchor* anchor) { + arcore_api->impl_ArAnchor_detach(session, anchor); +} + +void ArAnchor_getPose(const ArSession* session, + const ArAnchor* anchor, + ArPose* out_pose) { + arcore_api->impl_ArAnchor_getPose(session, anchor, out_pose); +} + +void ArAnchor_getTrackingState(const ArSession* session, + const ArAnchor* anchor, + ArTrackingState* out_tracking_state) { + arcore_api->impl_ArAnchor_getTrackingState(session, anchor, + out_tracking_state); +} + +void ArAnchor_release(ArAnchor* anchor) { + arcore_api->impl_ArAnchor_release(anchor); +} + void ArCamera_getDisplayOrientedPose(const ArSession* session, const ArCamera* camera, ArPose* out_pose) { @@ -164,6 +219,12 @@ arcore_api->impl_ArFrame_destroy(frame); } +void ArFrame_getUpdatedAnchors(const ArSession* session, + const ArFrame* frame, + ArAnchorList* out_anchor_list) { + arcore_api->impl_ArFrame_getUpdatedAnchors(session, frame, out_anchor_list); +} + void ArFrame_getUpdatedTrackables(const ArSession* session, const ArFrame* frame, ArTrackableType filter_type, @@ -338,6 +399,12 @@ arcore_api->impl_ArPose_getPoseRaw(session, pose, out_pose_raw); } +ArStatus ArSession_acquireNewAnchor(ArSession* session, + const ArPose* pose, + ArAnchor** out_anchor) { + return arcore_api->impl_ArSession_acquireNewAnchor(session, pose, out_anchor); +} + ArStatus ArSession_configure(ArSession* session, const ArConfig* config) { return arcore_api->impl_ArSession_configure(session, config); } @@ -357,6 +424,11 @@ arcore_api->impl_ArSession_enableIncognitoMode_private(session); } +void ArSession_getAllAnchors(const ArSession* session, + ArAnchorList* out_anchor_list) { + arcore_api->impl_ArSession_getAllAnchors(session, out_anchor_list); +} + void ArSession_getAllTrackables(const ArSession* session, ArTrackableType filter_type, ArTrackableList* out_trackable_list) {
diff --git a/chrome/browser/autofill/captured_sites_test_utils.cc b/chrome/browser/autofill/captured_sites_test_utils.cc index 5631a2c..896627e 100644 --- a/chrome/browser/autofill/captured_sites_test_utils.cc +++ b/chrome/browser/autofill/captured_sites_test_utils.cc
@@ -471,13 +471,13 @@ if (!RunWebPageReplayCmd("replay", args, &web_page_replay_server_)) return false; - // Sleep 20 seconds to wait for the web page replay server to start. + // Sleep 5 seconds to wait for the web page replay server to start. // TODO(crbug.com/847910): create a process std stream reader class to use the // process output to determine when the server is ready base::RunLoop wpr_launch_waiter; base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( FROM_HERE, wpr_launch_waiter.QuitClosure(), - base::TimeDelta::FromSeconds(20)); + base::TimeDelta::FromSeconds(5)); wpr_launch_waiter.Run(); if (!web_page_replay_server_.IsValid()) { @@ -1232,7 +1232,7 @@ const std::string* expected_value = FindPopulateString(action, "expectedValue", "validation expected value"); - if(!expected_value) + if (!expected_value) return false; VLOG(1) << "Checking the field `" << xpath << "`.";
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index f7e1e64..6a6942a4 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -5275,6 +5275,10 @@ if (!current_navigation_url.SchemeIsHTTPOrHTTPS()) return content::PREVIEWS_OFF; + // Check if initial state specifies no previews should be considered. + if (initial_state == content::PREVIEWS_OFF) + return initial_state; + // Do not allow previews on POST navigations since the primary opt-out // mechanism is to reload the page. Because POST navigations are not // idempotent, we do not want to show a preview on a POST navigation where
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index b3b33a3..2cd2b42c 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -1248,6 +1248,8 @@ "login/login_auth_recorder.h", "login/login_client_cert_usage_observer.cc", "login/login_client_cert_usage_observer.h", + "login/login_screen_extensions_lifetime_manager.cc", + "login/login_screen_extensions_lifetime_manager.h", "login/login_wizard.h", "login/mojo_system_info_dispatcher.cc", "login/mojo_system_info_dispatcher.h",
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc b/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc index 5dabecf..99ee12aa 100644 --- a/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc +++ b/chrome/browser/chromeos/accessibility/accessibility_manager_browsertest.cc
@@ -9,7 +9,9 @@ #include "base/bind_helpers.h" #include "base/command_line.h" #include "base/macros.h" +#include "chrome/browser/chromeos/login/mixin_based_in_process_browser_test.h" #include "chrome/browser/chromeos/login/session/user_session_manager.h" +#include "chrome/browser/chromeos/login/test/guest_session_mixin.h" #include "chrome/browser/chromeos/login/test/oobe_base_test.h" #include "chrome/browser/chromeos/preferences.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" @@ -17,10 +19,10 @@ #include "chrome/browser/prefs/pref_service_syncable_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/supervised_user/logged_in_user_mixin.h" #include "chrome/browser/supervised_user/supervised_user_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/test/base/in_process_browser_test.h" #include "chromeos/constants/chromeos_switches.h" #include "components/account_id/account_id.h" #include "components/policy/core/common/mock_configuration_policy_provider.h" @@ -54,10 +56,6 @@ constexpr int kTestAutoclickDelayMs = 2000; -// Test user name for supervised user. The domain part must be matched with -// user_manager::kSupervisedUserDomain. -constexpr char kTestSupervisedUserName[] = "test@locally-managed.localhost"; - class MockAccessibilityObserver { public: MockAccessibilityObserver() { @@ -239,7 +237,7 @@ } // namespace // For user session accessibility manager tests. -class AccessibilityManagerTest : public InProcessBrowserTest { +class AccessibilityManagerTest : public MixinBasedInProcessBrowserTest { protected: AccessibilityManagerTest() : disable_animations_( @@ -248,6 +246,7 @@ void SetUpOnMainThread() override { default_autoclick_delay_ = GetAutoclickDelay(); + MixinBasedInProcessBrowserTest::SetUpOnMainThread(); } int default_autoclick_delay() const { return default_autoclick_delay_; } @@ -637,34 +636,24 @@ EXPECT_TRUE(IsMonoAudioEnabled()); } -class AccessibilityManagerUserTypeTest : public AccessibilityManagerTest, - public WithParamInterface<AccountId> { +class AccessibilityManagerUserTypeTest + : public AccessibilityManagerTest, + public WithParamInterface<user_manager::UserType> { protected: - AccessibilityManagerUserTypeTest() = default; - virtual ~AccessibilityManagerUserTypeTest() = default; + AccessibilityManagerUserTypeTest() { + if (GetParam() == user_manager::USER_TYPE_GUEST) { + guest_session_ = std::make_unique<GuestSessionMixin>(&mixin_host_); + } else if (GetParam() == user_manager::USER_TYPE_CHILD) { + logged_in_user_mixin_ = std::make_unique<LoggedInUserMixin>( + &mixin_host_, LoggedInUserMixin::LogInType::kChild, + embedded_test_server()); + } + } + ~AccessibilityManagerUserTypeTest() override = default; void SetUpCommandLine(base::CommandLine* command_line) override { - if (GetParam() == user_manager::GuestAccountId()) { - command_line->AppendSwitch(chromeos::switches::kGuestSession); - command_line->AppendSwitch(::switches::kIncognito); - command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, - "hash"); - command_line->AppendSwitchASCII( - chromeos::switches::kLoginUser, - user_manager::GuestAccountId().GetUserEmail()); - } else if (GetParam() == - AccountId::FromUserEmail(kTestSupervisedUserName)) { - command_line->AppendSwitchASCII(::switches::kSupervisedUserId, - supervised_users::kChildAccountSUID); -#if defined(OS_CHROMEOS) - command_line->AppendSwitchASCII( - chromeos::switches::kLoginUser, - "supervised_user@locally-managed.localhost"); - command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, - "hash"); -#endif - } AccessibilityManager::SetBrailleControllerForTest(&braille_controller_); + AccessibilityManagerTest::SetUpCommandLine(command_line); } void TearDownOnMainThread() override { @@ -678,22 +667,26 @@ *braille_controller_.GetDisplayState()); } + std::unique_ptr<GuestSessionMixin> guest_session_; + + std::unique_ptr<LoggedInUserMixin> logged_in_user_mixin_; + MockBrailleController braille_controller_; private: DISALLOW_COPY_AND_ASSIGN(AccessibilityManagerUserTypeTest); }; -// TODO(yoshiki): Enable a test for retail mode (i.e. RetailAccountId). -INSTANTIATE_TEST_SUITE_P( - UserTypeInstantiation, - AccessibilityManagerUserTypeTest, - ::testing::Values(AccountId::FromUserEmailGaiaId(kTestUserName, - kTestUserGaiaId), - user_manager::GuestAccountId(), - AccountId::FromUserEmail(kTestSupervisedUserName))); +INSTANTIATE_TEST_SUITE_P(UserTypeInstantiation, + AccessibilityManagerUserTypeTest, + ::testing::Values(user_manager::USER_TYPE_REGULAR, + user_manager::USER_TYPE_GUEST, + user_manager::USER_TYPE_CHILD)); IN_PROC_BROWSER_TEST_P(AccessibilityManagerUserTypeTest, BrailleWhenLoggedIn) { + if (GetParam() == user_manager::USER_TYPE_CHILD) + logged_in_user_mixin_->LogInUser(); + // This object watches for IME preference changes and reflects those in // the IME framework state. chromeos::Preferences prefs; @@ -718,11 +711,11 @@ // enabled. KeyEvent event; event.command = extensions::api::braille_display_private::KEY_COMMAND_DOTS; - event.braille_dots.reset(new int(0)); + event.braille_dots = std::make_unique<int>(0); braille_controller_.GetObserver()->OnBrailleKeyEvent(event); EXPECT_TRUE(IsBrailleImeCurrent()); - // Unplug the display. Spolken feedback remains on, but the Braille IME + // Unplug the display. Spoken feedback remains on, but the Braille IME // should get deactivated. SetBrailleDisplayAvailability(false); EXPECT_TRUE(IsSpokenFeedbackEnabled());
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index d40af48..f666c9977 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -74,6 +74,7 @@ #include "chrome/browser/chromeos/login/demo_mode/demo_session.h" #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/lock/screen_locker.h" +#include "chrome/browser/chromeos/login/login_screen_extensions_lifetime_manager.h" #include "chrome/browser/chromeos/login/login_wizard.h" #include "chrome/browser/chromeos/login/session/chrome_session_manager.h" #include "chrome/browser/chromeos/login/session/user_session_manager.h" @@ -1002,6 +1003,9 @@ crosvm_metrics_ = std::make_unique<crostini::CrosvmMetrics>(); crosvm_metrics_->Start(); + login_screen_extensions_lifetime_manager_ = + std::make_unique<LoginScreenExtensionsLifetimeManager>(); + ChromeBrowserMainPartsLinux::PostProfileInit(); } @@ -1140,6 +1144,7 @@ lock_to_single_user_manager_.reset(); wilco_dtc_supportd_manager_.reset(); gnubby_notification_.reset(); + login_screen_extensions_lifetime_manager_.reset(); // Detach D-Bus clients before DBusThreadManager is shut down. idle_action_warning_observer_.reset();
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.h b/chrome/browser/chromeos/chrome_browser_main_chromeos.h index 30f6a16..217b01ad 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.h +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.h
@@ -49,6 +49,7 @@ class FastTransitionObserver; class GnubbyNotification; class IdleActionWarningObserver; +class LoginScreenExtensionsLifetimeManager; class LowDiskNotification; class NetworkChangeManagerClient; class NetworkPrefStateObserver; @@ -178,6 +179,8 @@ std::unique_ptr<SessionTerminationManager> session_termination_manager_; std::unique_ptr<policy::LockToSingleUserManager> lock_to_single_user_manager_; std::unique_ptr<WilcoDtcSupportdManager> wilco_dtc_supportd_manager_; + std::unique_ptr<LoginScreenExtensionsLifetimeManager> + login_screen_extensions_lifetime_manager_; std::unique_ptr<GnubbyNotification> gnubby_notification_;
diff --git a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc index 11395fd2..ddeb3fa4 100644 --- a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc +++ b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc
@@ -106,7 +106,7 @@ if (int_value > policy::AutoEnrollmentClient::kMaximumPower) { LOG(ERROR) << "Switch \"" << switch_name << "\" can't be greater than " << policy::AutoEnrollmentClient::kMaximumPower << ". Using " - << policy::AutoEnrollmentClient::kMaximumPower; + << policy::AutoEnrollmentClient::kMaximumPower << "."; return policy::AutoEnrollmentClient::kMaximumPower; } return int_value; @@ -334,7 +334,8 @@ if (command_line_mode == kForcedReEnrollmentNever) return false; - LOG(FATAL) << "Unknown auto-enrollment mode for FRE " << command_line_mode; + LOG(FATAL) << "Unknown auto-enrollment mode for FRE: " << command_line_mode + << "."; return false; } @@ -358,8 +359,8 @@ if (command_line_mode == kInitialEnrollmentNever) return false; - LOG(FATAL) << "Unknown auto-enrollment mode for initial enrollment " - << command_line_mode; + LOG(FATAL) << "Unknown auto-enrollment mode for initial enrollment: " + << command_line_mode << "."; return false; } @@ -553,7 +554,7 @@ void AutoEnrollmentController::DetermineAutoEnrollmentCheckType() { // Skip everything if neither FRE nor Initial Enrollment are enabled. if (!IsEnabled()) { - LOGIN_LOG(EVENT) << "Auto-enrollment disabled"; + LOGIN_LOG(EVENT) << "Auto-enrollment disabled."; auto_enrollment_check_type_ = AutoEnrollmentCheckType::kNone; return; } @@ -570,20 +571,20 @@ fre_requirement_ = GetFRERequirement(); LOGIN_LOG(EVENT) << FRERequirementToString(fre_requirement_); if (fre_requirement_ == FRERequirement::kExplicitlyNotRequired) { - LOGIN_LOG(EVENT) << "Auto-enrollment disabled: VPD"; + LOGIN_LOG(EVENT) << "Auto-enrollment disabled: VPD."; auto_enrollment_check_type_ = AutoEnrollmentCheckType::kNone; return; } if (ShouldDoFRECheck(command_line, fre_requirement_)) { // FRE has precedence over Initial Enrollment. - LOGIN_LOG(EVENT) << "Proceeding with FRE check"; + LOGIN_LOG(EVENT) << "Proceeding with FRE check."; auto_enrollment_check_type_ = AutoEnrollmentCheckType::kFRE; return; } if (ShouldDoInitialEnrollmentCheck()) { - LOGIN_LOG(EVENT) << "Proceeding with Initial Enrollment check"; + LOGIN_LOG(EVENT) << "Proceeding with Initial Enrollment check."; auto_enrollment_check_type_ = AutoEnrollmentCheckType::kInitialEnrollment; return; } @@ -598,13 +599,13 @@ // Skip FRE check if modulus configuration is not present. if (!command_line->HasSwitch(switches::kEnterpriseEnrollmentInitialModulus) && !command_line->HasSwitch(switches::kEnterpriseEnrollmentModulusLimit)) { - LOGIN_LOG(EVENT) << "FRE disabled: command line (config)"; + LOGIN_LOG(EVENT) << "FRE disabled through command line (config)."; return false; } // Skip FRE check if it is not enabled by command-line switches. if (!IsFREEnabled()) { - LOGIN_LOG(EVENT) << "FRE disabled"; + LOGIN_LOG(EVENT) << "FRE disabled."; return false; } @@ -672,7 +673,7 @@ void AutoEnrollmentController::StartClientForFRE( const std::vector<std::string>& state_keys) { if (state_keys.empty()) { - LOG(ERROR) << "No state keys available"; + LOG(ERROR) << "No state keys available."; if (fre_requirement_ == FRERequirement::kExplicitlyRequired) { if (request_state_keys_tries_ >= kMaxRequestStateKeysTries) { if (safeguard_timer_.IsRunning())
diff --git a/chrome/browser/chromeos/login/login_screen_extensions_lifetime_manager.cc b/chrome/browser/chromeos/login/login_screen_extensions_lifetime_manager.cc new file mode 100644 index 0000000..9c8b866 --- /dev/null +++ b/chrome/browser/chromeos/login/login_screen_extensions_lifetime_manager.cc
@@ -0,0 +1,110 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/login/login_screen_extensions_lifetime_manager.h" + +#include <string> +#include <vector> + +#include "base/logging.h" +#include "base/values.h" +#include "chrome/browser/chromeos/profiles/profile_helper.h" +#include "chrome/browser/extensions/extension_service.h" +#include "chrome/browser/profiles/profile.h" +#include "components/prefs/pref_service.h" +#include "components/session_manager/core/session_manager.h" +#include "components/session_manager/session_manager_types.h" +#include "extensions/browser/disable_reason.h" +#include "extensions/browser/extension_system.h" +#include "extensions/browser/pref_names.h" +#include "extensions/browser/process_manager.h" + +namespace chromeos { + +namespace { + +std::vector<std::string> GetLoginScreenPolicyExtensionIds() { + DCHECK(ProfileHelper::IsSigninProfileInitialized()); + + const PrefService* const prefs = + ProfileHelper::GetSigninProfile()->GetPrefs(); + DCHECK_EQ(prefs->GetAllPrefStoresInitializationStatus(), + PrefService::INITIALIZATION_STATUS_SUCCESS); + + const PrefService::Preference* const pref = + prefs->FindPreference(extensions::pref_names::kLoginScreenExtensions); + if (!pref || !pref->IsManaged() || + pref->GetType() != base::Value::Type::DICTIONARY) { + return {}; + } + std::vector<std::string> extension_ids; + for (const auto& item : pref->GetValue()->DictItems()) + extension_ids.push_back(item.first); + return extension_ids; +} + +void DisableLoginScreenPolicyExtensions() { + DCHECK(ProfileHelper::IsSigninProfileInitialized()); + + extensions::ExtensionService* const extension_service = + extensions::ExtensionSystem::Get(ProfileHelper::GetSigninProfile()) + ->extension_service(); + for (const std::string& extension_id : GetLoginScreenPolicyExtensionIds()) { + extension_service->DisableExtension( + extension_id, extensions::disable_reason::DISABLE_BLOCKED_BY_POLICY); + } +} + +void EnableLoginScreenPolicyExtensions() { + DCHECK(ProfileHelper::IsSigninProfileInitialized()); + + Profile* const signin_profile = ProfileHelper::GetSigninProfile(); + extensions::ExtensionService* const extension_service = + extensions::ExtensionSystem::Get(signin_profile)->extension_service(); + // This reapplies the policy. For the extensions that were previously disabled + // due to |DISABLE_BLOCKED_BY_POLICY|, this unsets this disable reason and + // reenables the extension. + extension_service->CheckManagementPolicy(); + + // Make sure the event pages for the login-screen extensions are loaded back, + // since they may need to do some operations on the Login/Lock Screen but are + // likely to have missed the session state change notification. + extensions::ProcessManager* extensions_process_manager = + extensions::ProcessManager::Get(signin_profile->GetOriginalProfile()); + for (const std::string& extension_id : GetLoginScreenPolicyExtensionIds()) + extensions_process_manager->WakeEventPage(extension_id, base::DoNothing()); +} + +bool ShouldEnableLoginScreenPolicyExtensions() { + // Note that extensions are intentionally allowed during the intermediate + // transition states between the login screen and the user session, since the + // user may still see some pieces of the login screen that rely on these + // extensions. + return session_manager::SessionManager::Get()->session_state() != + session_manager::SessionState::ACTIVE; +} + +void UpdateLoginScreenPolicyExtensionsState() { + if (ShouldEnableLoginScreenPolicyExtensions()) + EnableLoginScreenPolicyExtensions(); + else + DisableLoginScreenPolicyExtensions(); +} + +} // namespace + +LoginScreenExtensionsLifetimeManager::LoginScreenExtensionsLifetimeManager() { + UpdateLoginScreenPolicyExtensionsState(); + session_manager::SessionManager::Get()->AddObserver(this); +} + +LoginScreenExtensionsLifetimeManager::~LoginScreenExtensionsLifetimeManager() { + session_manager::SessionManager::Get()->RemoveObserver(this); +} + +void LoginScreenExtensionsLifetimeManager::OnSessionStateChanged() { + UpdateLoginScreenPolicyExtensionsState(); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/login/login_screen_extensions_lifetime_manager.h b/chrome/browser/chromeos/login/login_screen_extensions_lifetime_manager.h new file mode 100644 index 0000000..70ed80a --- /dev/null +++ b/chrome/browser/chromeos/login/login_screen_extensions_lifetime_manager.h
@@ -0,0 +1,33 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_SCREEN_EXTENSIONS_LIFETIME_MANAGER_H_ +#define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_SCREEN_EXTENSIONS_LIFETIME_MANAGER_H_ + +#include "components/session_manager/core/session_manager_observer.h" + +namespace chromeos { + +// Manages the lifetime of the login-screen policy-installed extensions and +// apps, making sure that they are stopped during an active user session. +// +// TODO(crbug.com/990484): Handle policy changes correctly, so that extensions +// are kept disabled even after the policy is reapplied. +class LoginScreenExtensionsLifetimeManager final + : public session_manager::SessionManagerObserver { + public: + LoginScreenExtensionsLifetimeManager(); + LoginScreenExtensionsLifetimeManager( + const LoginScreenExtensionsLifetimeManager&) = delete; + LoginScreenExtensionsLifetimeManager& operator=( + const LoginScreenExtensionsLifetimeManager&) = delete; + ~LoginScreenExtensionsLifetimeManager() override; + + // session_manager::SessionManagerObserver: + void OnSessionStateChanged() override; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_SCREEN_EXTENSIONS_LIFETIME_MANAGER_H_
diff --git a/chrome/browser/chromeos/login/security_token_pin_dialog_host_ash_impl.cc b/chrome/browser/chromeos/login/security_token_pin_dialog_host_ash_impl.cc index a6203d3e..783a5bb1 100644 --- a/chrome/browser/chromeos/login/security_token_pin_dialog_host_ash_impl.cc +++ b/chrome/browser/chromeos/login/security_token_pin_dialog_host_ash_impl.cc
@@ -45,7 +45,7 @@ bool enable_user_input, SecurityTokenPinErrorLabel error_label, int attempts_left, - const base::Optional<AccountId>& /*authenticating_user_account_id*/, + const base::Optional<AccountId>& authenticating_user_account_id, SecurityTokenPinEnteredCallback pin_entered_callback, SecurityTokenPinDialogClosedCallback pin_dialog_closed_callback) { DCHECK(!enable_user_input || attempts_left); @@ -55,10 +55,18 @@ Reset(); + if (!authenticating_user_account_id) { + // This class only supports requests associated with user authentication + // attempts. + std::move(pin_dialog_closed_callback).Run(); + return; + } + pin_entered_callback_ = std::move(pin_entered_callback); pin_dialog_closed_callback_ = std::move(pin_dialog_closed_callback); ash::SecurityTokenPinRequest request; + request.account_id = *authenticating_user_account_id; request.code_type = code_type; request.enable_user_input = enable_user_input; request.error_label = error_label;
diff --git a/chrome/browser/chromeos/login/test/login_manager_mixin.cc b/chrome/browser/chromeos/login/test/login_manager_mixin.cc index efe9c53..94b6bd66 100644 --- a/chrome/browser/chromeos/login/test/login_manager_mixin.cc +++ b/chrome/browser/chromeos/login/test/login_manager_mixin.cc
@@ -32,6 +32,9 @@ namespace { +// Ensure LoginManagerMixin is only created once. +bool g_instance_created = false; + // Chrome main extra part used for login manager tests to set up initially // registered users. The main part injects itself into browser startup after // local state has been set up, but before the user manager instance is created. @@ -98,9 +101,14 @@ LoginManagerMixin::LoginManagerMixin( InProcessBrowserTestMixinHost* host, const std::vector<TestUserInfo>& initial_users) - : InProcessBrowserTestMixin(host), initial_users_(initial_users) {} + : InProcessBrowserTestMixin(host), initial_users_(initial_users) { + DCHECK(!g_instance_created); + g_instance_created = true; +} -LoginManagerMixin::~LoginManagerMixin() = default; +LoginManagerMixin::~LoginManagerMixin() { + g_instance_created = false; +} void LoginManagerMixin::SetDefaultLoginSwitches( const std::vector<test::SessionFlagsManager::Switch>& switches) {
diff --git a/chrome/browser/chromeos/policy/auto_enrollment_client_impl.cc b/chrome/browser/chromeos/policy/auto_enrollment_client_impl.cc index f33a6f7..44b4720f 100644 --- a/chrome/browser/chromeos/policy/auto_enrollment_client_impl.cc +++ b/chrome/browser/chromeos/policy/auto_enrollment_client_impl.cc
@@ -94,7 +94,7 @@ } // Return is required to avoid compiler warning. - NOTREACHED() << "Bad restore_mode=" << restore_mode; + NOTREACHED() << "Bad restore_mode=" << restore_mode << "."; return std::string(); } @@ -324,7 +324,10 @@ // Logging as "WARNING" to make sure it's preserved in the logs. LOG(WARNING) << "Received initial_enrollment_mode=" - << state_response.initial_enrollment_mode(); + << state_response.initial_enrollment_mode() << ". " + << (state_response.is_license_packaged_with_device() + ? "Device has a packaged license for management." + : "No packaged license."); return true; }
diff --git a/chrome/browser/download/download_manager_utils.cc b/chrome/browser/download/download_manager_utils.cc index 1657c464..32240c9 100644 --- a/chrome/browser/download/download_manager_utils.cc +++ b/chrome/browser/download/download_manager_utils.cc
@@ -27,8 +27,7 @@ // A map for owning InProgressDownloadManagers before DownloadManagerImpl gets // created. using InProgressManagerMap = - std::map<SimpleFactoryKey*, - std::unique_ptr<download::InProgressDownloadManager>>; + std::map<ProfileKey*, std::unique_ptr<download::InProgressDownloadManager>>; InProgressManagerMap& GetInProgressManagerMap() { static base::NoDestructor<InProgressManagerMap> map; @@ -55,15 +54,14 @@ // static download::InProgressDownloadManager* DownloadManagerUtils::RetrieveInProgressDownloadManager(Profile* profile) { - SimpleFactoryKey* key = profile->GetProfileKey(); + ProfileKey* key = profile->GetProfileKey(); GetInProgressDownloadManager(key); auto& map = GetInProgressManagerMap(); return map[key].release(); } // static -void DownloadManagerUtils::InitializeSimpleDownloadManager( - SimpleFactoryKey* key) { +void DownloadManagerUtils::InitializeSimpleDownloadManager(ProfileKey* key) { #if defined(OS_ANDROID) if (!g_browser_process) { GetInProgressDownloadManager(key); @@ -82,7 +80,7 @@ // static download::InProgressDownloadManager* -DownloadManagerUtils::GetInProgressDownloadManager(SimpleFactoryKey* key) { +DownloadManagerUtils::GetInProgressDownloadManager(ProfileKey* key) { auto& map = GetInProgressManagerMap(); auto it = map.find(key); // Create the InProgressDownloadManager if it hasn't been created yet. @@ -91,6 +89,7 @@ auto in_progress_manager = std::make_unique<download::InProgressDownloadManager>( nullptr, key->IsOffTheRecord() ? base::FilePath() : key->GetPath(), + key->GetProtoDatabaseProvider(), base::BindRepeating(&IgnoreOriginSecurityCheck), base::BindRepeating(&content::DownloadRequestUtils::IsURLSafe), connector);
diff --git a/chrome/browser/download/download_manager_utils.h b/chrome/browser/download/download_manager_utils.h index d9294070..79dc4a1 100644 --- a/chrome/browser/download/download_manager_utils.h +++ b/chrome/browser/download/download_manager_utils.h
@@ -8,7 +8,7 @@ #include "base/macros.h" class Profile; -class SimpleFactoryKey; +class ProfileKey; namespace download { class InProgressDownloadManager; @@ -22,12 +22,12 @@ // Initializes the SimpleDownloadManager that is associated with |key| whenver // possible. - static void InitializeSimpleDownloadManager(SimpleFactoryKey* key); + static void InitializeSimpleDownloadManager(ProfileKey* key); // Creates an InProgressDownloadManager for a particular |key| if it doesn't // exist and return the pointer. static download::InProgressDownloadManager* GetInProgressDownloadManager( - SimpleFactoryKey* key); + ProfileKey* key); private: DISALLOW_COPY_AND_ASSIGN(DownloadManagerUtils);
diff --git a/chrome/browser/download/download_service_factory.cc b/chrome/browser/download/download_service_factory.cc index 5d9f825..16678267 100644 --- a/chrome/browser/download/download_service_factory.cc +++ b/chrome/browser/download/download_service_factory.cc
@@ -185,7 +185,7 @@ // and cause the download service to fail. Call // InitializeSimpleDownloadManager() to initialize the DownloadManager // whenever profile becomes available. - DownloadManagerUtils::InitializeSimpleDownloadManager(key); + DownloadManagerUtils::InitializeSimpleDownloadManager(profile_key); leveldb_proto::ProtoDatabaseProvider* proto_db_provider = profile_key->GetProtoDatabaseProvider(); return download::BuildDownloadService(
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 58715bb..e64d6723 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -29,36 +29,11 @@ [ { - "name": "BundledConnectionHelp", - "owners": [ "carlosil" ], - "expiry_milestone": 76 - }, - { - "name": "PasswordImport", - "owners": [ "vasilii" ], - "expiry_milestone": 76 - }, - { - "name": "SupervisedUserCommittedInterstitials", - "owners": [ "carlosil" ], - "expiry_milestone": 77 - }, - { "name": "account-consistency", "owners": [ "droger", "msarda" ], "expiry_milestone": 80 }, { - "name": "force-dice-migration", - "owners": [ "msalama" ], - "expiry_milestone": 85 - }, - { - "name": "show-sync-paused-reason-cookies-cleared-on-exit", - "owners": [ "msalama" ], - "expiry_milestone": 85 - }, - { "name": "allow-insecure-localhost", "owners": [ "security-dev" ], "expiry_milestone": 76 @@ -272,11 +247,6 @@ "expiry_milestone": 74 }, { - "name": "autofill-prune-suggestions", - "owners": ["ftirelo", "tmartino"], - "expiry_milestone": 78 - }, - { "name": "autofill-no-local-save-on-unmask-success", "owners": [ "jsaul@google.com" ], // Must wait for the Autofill Auth Project to be launched. @@ -289,6 +259,11 @@ "expiry_milestone": 84 }, { + "name": "autofill-off-no-server-data", + "owners": [ "seblalancette" ], + "expiry_milestone": 79 + }, + { "name": "autofill-profile-client-validation", "owners": [ "parastoog" ], "expiry_milestone": 77 @@ -299,6 +274,11 @@ "expiry_milestone": 77 }, { + "name": "autofill-prune-suggestions", + "owners": ["ftirelo", "tmartino"], + "expiry_milestone": 78 + }, + { "name": "autofill-reject-company-birthyear", "owners": [ "parastoog" ], "expiry_milestone": 79 @@ -314,11 +294,6 @@ "expiry_milestone": 76 }, { - "name": "omnibox-local-entity-suggestions", - "owners": [ "manukh", "chrome-omnibox-team@google.com" ], - "expiry_milestone": 80 - }, - { "name": "autofill-use-improved-label-disambiguation", "owners": [ "ftirelo", "tmartino" ], "expiry_milestone": 77 @@ -329,31 +304,6 @@ "expiry_milestone": 79 }, { - "name": "enable-ambient-authentication-in-incognito", - "owners": ["rhalavati", "chrome-privacy-core@google.com"], - "expiry_milestone": 87 - }, - { - "name": "enable-ambient-authentication-in-guest-session", - "owners": ["rhalavati", "chrome-privacy-core@google.com"], - "expiry_milestone": 87 - }, - { - "name": "enable-autofill-save-card-show-no-thanks", - "owners": ["siashah", "jsaul@google.com"], - "expiry_milestone": 82 - }, - { - "name": "enable-autofill-updated-card-unmask-prompt-ui", - "owners": ["siyua", "payments-autofill-team@google.com"], - "expiry_milestone": 87 - }, - { - "name": "enable-force-dark", - "owners": [ "gilmanmh@google.com" ], - "expiry_milestone": 80 - }, - { "name": "background-task-component-update", "owners": [ "sorin", "waffles", "tiborg" ], "expiry_milestone": 76 @@ -364,6 +314,11 @@ "expiry_milestone": 80 }, { + "name": "BundledConnectionHelp", + "owners": [ "carlosil" ], + "expiry_milestone": 76 + }, + { "name": "bypass-app-banner-engagement-checks", "owners": [ "dominickn" ], "expiry_milestone": 78 @@ -371,7 +326,7 @@ { "name": "calculate-native-win-occlusion", "owners": [ "davidbienvenu", "fdoray" ], - "expiry_milestone": 76 + "expiry_milestone": 81 }, { "name": "camera-system-web-app", @@ -464,6 +419,11 @@ "expiry_milestone": 80 }, { + "name": "contextual-search-definitions", + "owners": [ "//chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/OWNERS" ], + "expiry_milestone": 77 + }, + { "name": "contextual-search-longpress-resolve", "owners": [ "//chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/OWNERS" ], "expiry_milestone": 78 @@ -474,11 +434,6 @@ "expiry_milestone": 76 }, { - "name": "contextual-search-definitions", - "owners": [ "//chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/OWNERS" ], - "expiry_milestone": 77 - }, - { "name": "contextual-search-ranker-query", "owners": [ "//chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/OWNERS" ], "expiry_milestone": 76 @@ -529,11 +484,6 @@ "expiry_milestone": 77 }, { - "name": "crostini-webui-installer", - "owners": [ "lxj", "timloh", "benwells" ], - "expiry_milestone": 82 - }, - { "name": "crostini-gpu-support", "owners": [ "nverne", "benwells" ], "expiry_milestone": 78 @@ -549,6 +499,11 @@ "expiry_milestone": 76 }, { + "name": "crostini-webui-installer", + "owners": [ "lxj", "timloh", "benwells" ], + "expiry_milestone": 82 + }, + { "name": "cryptauth-v2-enrollment", "owners": [ "khorimoto", "nohle" ], "expiry_milestone": 82 @@ -729,6 +684,11 @@ "expiry_milestone": 80 }, { + "name": "download-auto-resumption-native", + "owners": [ "shaktisahu", "qinmin" ], + "expiry_milestone": 76 + }, + { "name": "download-home-v2", "owners": [ "shaktisahu", "xingliu", "dtrainor" ], "expiry_milestone": 76 @@ -749,6 +709,11 @@ "expiry_milestone": 80 }, { + "name": "drag-to-pin-tabs", + "owners": ["chrome-desktop-ui-seattle@google.com", "cyan", "tbergquist"], + "expiry_milestone": 82 + }, + { "name": "draw-vertically-edge-to-edge", "owners": [ "chrome-android-app@chromium.org" ], "expiry_milestone": 88 @@ -769,6 +734,16 @@ "expiry_milestone": 80 }, { + "name": "enable-ambient-authentication-in-guest-session", + "owners": ["rhalavati", "chrome-privacy-core@google.com"], + "expiry_milestone": 87 + }, + { + "name": "enable-ambient-authentication-in-incognito", + "owners": ["rhalavati", "chrome-privacy-core@google.com"], + "expiry_milestone": 87 + }, + { "name": "enable-android-autofill-accessibility", "owners": [ "ftirelo" ], "expiry_milestone": 73 @@ -799,11 +774,6 @@ "expiry_milestone": 78 }, { - "name": "enable-search-box-selection", - "owners": [ "ginko", "newcomer" ], - "expiry_milestone": 78 - }, - { "name": "enable-app-list-search-autocomplete", "owners": [ "newcomer" ], "expiry_milestone": 75 @@ -829,16 +799,6 @@ "expiry_milestone": 76 }, { - "name": "enable-assistant-launcher-integration", - "owners": [ "croissant-eng" ], - "expiry_milestone": 78 - }, - { - "name": "enable-assistant-media-session-integration", - "owners": [ "croissant-eng" ], - "expiry_milestone": 78 - }, - { "name": "enable-assistant-app-support", "owners": [ "croissant-eng" ], "expiry_milestone": 78 @@ -854,9 +814,14 @@ "expiry_milestone": 78 }, { - "name": "enable-assistant-stereo-input", + "name": "enable-assistant-launcher-integration", "owners": [ "croissant-eng" ], - "expiry_milestone": 76 + "expiry_milestone": 78 + }, + { + "name": "enable-assistant-media-session-integration", + "owners": [ "croissant-eng" ], + "expiry_milestone": 78 }, { "name": "enable-assistant-routines", @@ -864,6 +829,11 @@ "expiry_milestone": 82 }, { + "name": "enable-assistant-stereo-input", + "owners": [ "croissant-eng" ], + "expiry_milestone": 76 + }, + { "name": "enable-async-dns", "owners": [ "ericorth", "net-dev" ], "expiry_milestone": 81 @@ -942,14 +912,19 @@ "expiry_milestone": 78 }, { + "name": "enable-autofill-save-card-show-no-thanks", + "owners": ["siashah", "jsaul@google.com"], + "expiry_milestone": 82 + }, + { "name": "enable-autofill-save-credit-card-uses-improved-messaging", "owners": [ "siyua@chromium.org", "payments-autofill-team@google.com" ], "expiry_milestone": 80 }, { - "name": "autofill-off-no-server-data", - "owners": [ "seblalancette" ], - "expiry_milestone": 79 + "name": "enable-autofill-updated-card-unmask-prompt-ui", + "owners": ["siyua", "payments-autofill-team@google.com"], + "expiry_milestone": 87 }, { "name": "enable-avoid-flash-between-navigation", @@ -957,11 +932,41 @@ "expiry_milestone": 76 }, { + "name": "enable-backdrop-filter", + "owners": [ "masonfreed", "paint-dev@chromium.org" ], + "expiry_milestone": 78 + }, + { "name": "enable-background-blur", "owners": [ "newcomer" ], "expiry_milestone": 86 }, { + "name": "enable-blink-gen-property-trees", + "owners": [ "paint-dev@chromium.org" ], + "expiry_milestone": 74 + }, + { + "name": "enable-bookmark-reorder", + "owners": ["jhimawan@google.com", "twellington" ], + "expiry_milestone": 80 + }, + { + "name": "enable-built-in-module-all", + "owners": [ "hiroshige", "domenic" ], + "expiry_milestone": 80 + }, + { + "name": "enable-built-in-module-infra", + "owners": [ "hiroshige", "domenic" ], + "expiry_milestone": 80 + }, + { + "name": "enable-built-in-module-kv-storage", + "owners": [ "hiroshige", "domenic" ], + "expiry_milestone": 80 + }, + { "name": "enable-bulk-printers", "owners": [ "skau" ], "expiry_milestone": 76 @@ -1004,11 +1009,6 @@ "expiry_milestone": -1 }, { - "name": "enable-immersive-fullscreen-toolbar", - "owners": [ "sdy", "chrome/browser/ui/cocoa/OWNERS" ], - "expiry_milestone": 76 - }, - { "name": "enable-credit-card-assist", "owners": [ "ftirelo", "gogerald" ], "expiry_milestone": 76 @@ -1045,6 +1045,21 @@ "expiry_milestone": 79 }, { + "name": "enable-dbus-and-x11-status-icons", + "owners": [ "thestig", "thomasanderson" ], + "expiry_milestone": 80 + }, + { + "name": "enable-defer-all-script", + "owners": [ "//components/data_reduction_proxy/OWNERS" ], + "expiry_milestone": 82 + }, + { + "name": "enable-defer-all-script-without-optimization-hints", + "owners": [ "//components/data_reduction_proxy/OWNERS" ], + "expiry_milestone": 82 + }, + { "name": "enable-desktop-pwas-local-updating", "owners": [ "desktop-pwas-team@google.com" ], "expiry_milestone": 80 @@ -1076,6 +1091,16 @@ "expiry_milestone": 80 }, { + "name": "enable-experimental-accessibility-autoclick", + "owners": [ "katie", "dmazzoni", "dtseng" ], + "expiry_milestone": 78 + }, + { + "name": "enable-experimental-accessibility-chromevox-language-switching", + "owners": [ "akihiroota", "dmazzoni", "dtseng" ], + "expiry_milestone": 78 + }, + { "name": "enable-experimental-accessibility-features", "owners": [ "//ui/accessibility/OWNERS" ], "expiry_milestone": 76 @@ -1096,16 +1121,6 @@ "expiry_milestone": 80 }, { - "name": "enable-experimental-accessibility-autoclick", - "owners": [ "katie", "dmazzoni", "dtseng" ], - "expiry_milestone": 78 - }, - { - "name": "enable-experimental-accessibility-chromevox-language-switching", - "owners": [ "akihiroota", "dmazzoni", "dtseng" ], - "expiry_milestone": 78 - }, - { "name": "enable-experimental-kernel-vm-support", "owners": [ "jflat", "zwisler" ], "expiry_milestone": 78 @@ -1128,11 +1143,21 @@ "expiry_milestone": 78 }, { + "name": "enable-filtering-scroll-events", + "owners": [ "axantoine", "eirage", "nzolghadr", "input-dev" ], + "expiry_milestone": 80 + }, + { "name": "enable-forbid-sync-xhr-in-page-dismissal", "owners": [ "kdillon@chromium.org" ], "expiry_milestone": 82 }, { + "name": "enable-force-dark", + "owners": [ "gilmanmh@google.com" ], + "expiry_milestone": 80 + }, + { "name": "enable-fs-nosymfollow", "owners": [ "mortonm@chromium.org" ], "expiry_milestone": 76 @@ -1145,11 +1170,6 @@ "expiry_milestone": -1 }, { - "name": "enable-winrt-sensor-implementation", - "owners": [ "wensh@microsoft.com" ], - "expiry_milestone": 80 - }, - { "name": "enable-generic-sensor", "owners": [ "reillyg@chromium.org", "raphael.kubo.da.costa@intel.com" ], "expiry_milestone": 72 @@ -1183,23 +1203,24 @@ // way to turn off graphics features. "expiry_milestone": -1 }, - { "name": "enable-heuristic-stylus-palm-rejection", - "owners": ["robsc", "napper"], - // We add a heuristic that changes the way fingers are handled. We should - // always let users switch it off if needed. However, for now, during - // experiments, we set milestone deep into future. - "expiry_milestone": 90}, { - "name": "enable-history-favicons-google-server-query", - "owners": ["victorvianna", "jkrcal"], - "expiry_milestone": 78 - }, + "name": "enable-heuristic-stylus-palm-rejection", + "owners": ["robsc", "napper"], + // We add a heuristic that changes the way fingers are handled. We should + // always let users switch it off if needed. However, for now, during + // experiments, we set milestone deep into future. + "expiry_milestone": 90}, { "name": "enable-hide-arc-media-notifications", "owners": [ "beccahughes", "media-dev" ], "expiry_milestone": 80 }, { + "name": "enable-history-favicons-google-server-query", + "owners": ["victorvianna", "jkrcal"], + "expiry_milestone": 78 + }, + { "name": "enable-history-manipulation-intervention", "owners": [ "shivanisha" ], "expiry_milestone": 76 @@ -1220,14 +1241,9 @@ "expiry_milestone": 77 }, { - "name": "identity-disc", - "owners": ["//chrome/android/java/src/org/chromium/chrome/browser/toolbar/OWNERS"], - "expiry_milestone": 78 - }, - { - "name": "enable-dbus-and-x11-status-icons", - "owners": [ "thestig", "thomasanderson" ], - "expiry_milestone": 80 + "name": "enable-immersive-fullscreen-toolbar", + "owners": [ "sdy", "chrome/browser/ui/cocoa/OWNERS" ], + "expiry_milestone": 76 }, { "name": "enable-implicit-root-scroller", @@ -1256,41 +1272,6 @@ "expiry_milestone": -1 }, { - "name": "enable-built-in-module-all", - "owners": [ "hiroshige", "domenic" ], - "expiry_milestone": 80 - }, - { - "name": "enable-built-in-module-infra", - "owners": [ "hiroshige", "domenic" ], - "expiry_milestone": 80 - }, - { - "name": "enable-built-in-module-kv-storage", - "owners": [ "hiroshige", "domenic" ], - "expiry_milestone": 80 - }, - { - "name": "enable-blink-gen-property-trees", - "owners": [ "paint-dev@chromium.org" ], - "expiry_milestone": 74 - }, - { - "name": "enable-backdrop-filter", - "owners": [ "masonfreed", "paint-dev@chromium.org" ], - "expiry_milestone": 78 - }, - { - "name": "enable-defer-all-script", - "owners": [ "//components/data_reduction_proxy/OWNERS" ], - "expiry_milestone": 82 - }, - { - "name": "enable-defer-all-script-without-optimization-hints", - "owners": [ "//components/data_reduction_proxy/OWNERS" ], - "expiry_milestone": 82 - }, - { "name": "enable-layout-ng", "owners": [ "layout-dev@chromium.org" ], "expiry_milestone": 80 @@ -1312,11 +1293,6 @@ "expiry_milestone": -1 }, { - "name": "enable-url-loader-lite-page-server-previews", - "owners": [ "//components/data_reduction_proxy/OWNERS" ], - "expiry_milestone": 79 - }, - { "name": "enable-lock-screen-notification", "owners": [ "tengs" ], "expiry_milestone": 80 @@ -1355,14 +1331,19 @@ "expiry_milestone": 76 }, { + "name": "enable_messages_web_push", + "owners": [ "azeemarshad", "jlklein", "khorimoto" ], + "expiry_milestone": 76 + }, + { "name": "enable-myfiles-volume", "owners": [ "lucmult", "noel" ], "expiry_milestone": 76 }, { - "name": "enable-nacl", - "owners": [ "dschuff", "native-client-dev@googlegroups.com" ], - "expiry_milestone": 87 + "name": "enable-nacl", + "owners": [ "dschuff", "native-client-dev@googlegroups.com" ], + "expiry_milestone": 87 }, { "name": "enable-native-controls", @@ -1392,16 +1373,6 @@ "expiry_milestone": -1 }, { - "name": "download-auto-resumption-native", - "owners": [ "shaktisahu", "qinmin" ], - "expiry_milestone": 76 - }, - { - "name": "drag-to-pin-tabs", - "owners": ["chrome-desktop-ui-seattle@google.com", "cyan", "tbergquist"], - "expiry_milestone": 82 - }, - { "name": "enable-new-download-backend", "owners": [ "shaktisahu", "dtrainor" ], "expiry_milestone": 76 @@ -1454,13 +1425,6 @@ "expiry_milestone": 76 }, { - "name" : "enable-parental-controls-settings", - "owners" : [ "danan", "michaelpg" ], - // This flag is used to enable parental controls options in ChromeOS - // settings. - "expiry_milestone" : 79 - }, - { "name": "enable-parallel-downloading", "owners": [ "qinmin", "xingliu", "dtrainor" ], // This flag is used by dev teams on Android to disable this feature, since @@ -1468,6 +1432,13 @@ "expiry_milestone": -1 }, { + "name" : "enable-parental-controls-settings", + "owners" : [ "danan", "michaelpg" ], + // This flag is used to enable parental controls options in ChromeOS + // settings. + "expiry_milestone" : 79 + }, + { "name": "enable-pixel-canvas-recording", "owners": [ "malaykeshav", "oshima" ], "expiry_milestone": 77 @@ -1533,11 +1504,6 @@ "expiry_milestone": 80 }, { - "name": "enable-filtering-scroll-events", - "owners": [ "axantoine", "eirage", "nzolghadr", "input-dev" ], - "expiry_milestone": 80 - }, - { "name": "enable-resource-load-scheduler", "owners": [ "toyoshim" ], "expiry_milestone": 78 @@ -1570,6 +1536,11 @@ "expiry_milestone": 76 }, { + "name": "enable-search-box-selection", + "owners": [ "ginko", "newcomer" ], + "expiry_milestone": 78 + }, + { "name": "enable-search-ready-omnibox", "owners": [ "mdjones" ], "expiry_milestone": 75 @@ -1611,16 +1582,16 @@ "expiry_milestone": 77 }, { - "name": "enable-shill-sandboxing", - "owners": [ "mortonm" ], - "expiry_milestone": 77 - }, - { "name": "enable-sharing-device-registration", "owners": [ "//chrome/browser/sharing/OWNERS" ], "expiry_milestone": 79 }, { + "name": "enable-shill-sandboxing", + "owners": [ "mortonm" ], + "expiry_milestone": 77 + }, + { "name": "enable-show-autofill-signatures", "owners": [ "kolos" ], // Used for debugging and QA by the autofill team for the indefinite future. @@ -1650,6 +1621,16 @@ "expiry_milestone": 78 }, { + "name": "enable-start-surface", + "owners": [ "gogerald"], + "expiry_milestone": 83 + }, + { + "name": "enable-streamlined-usb-printer-setup", + "owners": [ "baileyberro" ], + "expiry_milestone": 77 + }, + { "name": "enable-suggestions-with-substring-match", "owners": [ "tmartino" ], "expiry_milestone": 77 @@ -1665,12 +1646,12 @@ "expiry_milestone": 76 }, { - "name": "enable-sxg-subresource-prefetching", + "name": "enable-sxg-prefetch-cache-for-navigations", "owners": [ "horo", "//content/browser/web_package/OWNERS" ], "expiry_milestone": 80 }, { - "name": "enable-sxg-prefetch-cache-for-navigations", + "name": "enable-sxg-subresource-prefetching", "owners": [ "horo", "//content/browser/web_package/OWNERS" ], "expiry_milestone": 80 }, @@ -1695,6 +1676,11 @@ "expiry_milestone": 78 }, { + "name": "enable-tab-engagement-reporting", + "owners": [ "memex-team@google.com" ], + "expiry_milestone": 82 + }, + { "name": "enable-tab-grid-layout", "owners": [ "memex-team@google.com" ], "expiry_milestone": 76 @@ -1715,11 +1701,6 @@ "expiry_milestone": 76 }, { - "name": "enable-tab-engagement-reporting", - "owners": [ "memex-team@google.com" ], - "expiry_milestone": 82 - }, - { "name": "enable-tab-to-gts-animation", "owners": [ "memex-team@google.com" ], "expiry_milestone": 80 @@ -1747,9 +1728,11 @@ "expiry_milestone": -1 }, { - "name": "enable-start-surface", - "owners": [ "gogerald"], - "expiry_milestone": 83 + "name": "enable-ui-devtools", + "owners": [ "//components/ui_devtools/OWNERS" ], + // Convenience debugging flag for non-stable ChromeOS Builds. + // Devtools spins up a server which is not appropriate in the default case. + "expiry_milestone": -1 }, { "name": "enable-unsafe-webgpu", @@ -1757,11 +1740,9 @@ "expiry_milestone": 82 }, { - "name": "enable-ui-devtools", - "owners": [ "//components/ui_devtools/OWNERS" ], - // Convenience debugging flag for non-stable ChromeOS Builds. - // Devtools spins up a server which is not appropriate in the default case. - "expiry_milestone": -1 + "name": "enable-url-loader-lite-page-server-previews", + "owners": [ "//components/data_reduction_proxy/OWNERS" ], + "expiry_milestone": 79 }, { "name": "enable-usbguard", @@ -1784,6 +1765,12 @@ "expiry_milestone": 79 }, { + "name": "enable-virtual-desks", + "owners": [ "afakhry" ], + // This is a flag to enable or disable the Virtual Desks feature. + "expiry_milestone": 79 + }, + { "name": "enable-virtual-keyboard", "owners": [ "//ash/keyboard/OWNERS" ], // Useful for debugging the virtual keyboard on non-tablet devices. @@ -1810,17 +1797,17 @@ "expiry_milestone": 80 }, { + "name": "enable-web-authentication-pin-support", + "owners": [ "webauthn-team@google.com" ], + "expiry_milestone": 77 + }, + { "name": "enable-web-authentication-testing-api", "owners": [ "webauthn-team@google.com" ], // This is required for testing. "expiry_milestone": -1 }, { - "name": "enable-web-authentication-pin-support", - "owners": [ "webauthn-team@google.com" ], - "expiry_milestone": 77 - }, - { "name": "enable-web-payments-experimental-features", "owners": [ "danyao", "rouslan", "paymentrequest@google.com" ], // This flag is used by early adoption partners to test new Web Payments @@ -1853,11 +1840,6 @@ "expiry_milestone": 83 }, { - "name": "enable-webgl2-compute-context", - "owners": [ "webgl-team@google.com" ], - "expiry_milestone": 77 - }, - { "name": "enable-webgl-draft-extensions", "owners": [ "webgl-team@google.com" ], // This flag is the only way for end users to test upcoming WebGL @@ -1865,6 +1847,11 @@ "expiry_milestone": -1 }, { + "name": "enable-webgl2-compute-context", + "owners": [ "webgl-team@google.com" ], + "expiry_milestone": 77 + }, + { "name": "enable-webnfc", "owners": [ "rijubrata.bhaumik@intel.com","reillyg" ], "expiry_milestone": 79 @@ -1925,6 +1912,11 @@ "expiry_milestone": 79 }, { + "name": "enable-winrt-sensor-implementation", + "owners": [ "wensh@microsoft.com" ], + "expiry_milestone": 80 + }, + { "name": "enable-zero-copy", "owners": [ "ccameron", "chrome-gpu@google.com" ], // This flag is commonly used when asking users to help gather debug info. @@ -1941,26 +1933,6 @@ "expiry_milestone": 75 }, { - "name": "updated_cellular_activation_ui", - "owners": [ "azeemarshad", "khorimoto" ], - "expiry_milestone": 80 - }, - { - "name": "use_messages_google_com_domain", - "owners": [ "azeemarshad", "khorimoto" ], - "expiry_milestone": 76 - }, - { - "name": "use_messages_staging_url", - "owners": [ "azeemarshad", "khorimoto" ], - "expiry_milestone": 76 - }, - { - "name": "enable_messages_web_push", - "owners": [ "azeemarshad", "jlklein", "khorimoto" ], - "expiry_milestone": 76 - }, - { "name": "enforce-tls13-downgrade", "owners": [ "davidben", "svaldez" ], "expiry_milestone": 76 @@ -1996,11 +1968,6 @@ "expiry_milestone": 76 }, { - "name": "extensions-toolbar-menu", - "owners": [ "//extensions/OWNERS", "pbos" ], - "expiry_milestone": 80 - }, - { "name": "extensions-on-chrome-urls", "owners": [ "//extensions/OWNERS" ], // This enables the use of extensions on chrome:// URLs. This is useful for @@ -2008,14 +1975,9 @@ "expiry_milestone": -1 }, { - "name": "font-src-local-matching", - "owners": [ "drott", "layout-dev" ], - "expiry_milestone": 82 - }, - { - "name": "force-use-chrome-camera", - "owners": [ "shik", "chromeos-camera-app-eng@google.com" ], - "expiry_milestone": 76 + "name": "extensions-toolbar-menu", + "owners": [ "//extensions/OWNERS", "pbos" ], + "expiry_milestone": 80 }, { "name": "fcm-invalidations", @@ -2059,11 +2021,21 @@ "expiry_milestone": 76 }, { + "name": "font-src-local-matching", + "owners": [ "drott", "layout-dev" ], + "expiry_milestone": 82 + }, + { "name": "force-color-profile", "owners": [ "ccameron" ], "expiry_milestone": 81 }, { + "name": "force-dice-migration", + "owners": [ "msalama" ], + "expiry_milestone": 85 + }, + { "name": "force-effective-connection-type", "owners": [ "//components/data_reduction_proxy/OWNERS" ], // ECT is a baked-in feature of Chrome. This flag is used for frequent @@ -2107,7 +2079,12 @@ "owners": [ "//chrome/android/java/src/org/chromium/chrome/browser/omaha/OWNERS" ], // This is required by test teams to verify functionality on devices which // have no access to commandline flags. - "expiry_milestone": -1 + "expiry_milestone": -1 + }, + { + "name": "force-use-chrome-camera", + "owners": [ "shik", "chromeos-camera-app-eng@google.com" ], + "expiry_milestone": 76 }, { "name": "foreground-notification-manager", @@ -2176,6 +2153,11 @@ "expiry_milestone": 77 }, { + "name": "identity-disc", + "owners": ["//chrome/android/java/src/org/chromium/chrome/browser/toolbar/OWNERS"], + "expiry_milestone": 78 + }, + { "name": "ignore-gpu-blacklist", "owners": [ "kbr", "zmo" ], // A debugging flag intended for end-users where there may not be any other @@ -2183,6 +2165,11 @@ "expiry_milestone": -1 }, { + "name": "ignore-litepage-redirect-optimization-blacklist", + "owners": [ "//components/data_reduction_proxy/OWNERS" ], + "expiry_milestone": 79 + }, + { "name": "ignore-previews-blocklist", "owners": [ "//components/data_reduction_proxy/OWNERS" ], // Previews is a baked-in feature of Chrome. This flag is used for frequent @@ -2190,11 +2177,6 @@ "expiry_milestone": -1 }, { - "name": "ignore-litepage-redirect-optimization-blacklist", - "owners": [ "//components/data_reduction_proxy/OWNERS" ], - "expiry_milestone": 79 - }, - { "name": "in-product-help-demo-mode-choice", "owners": [ "dtrainor", "nyquist" ], // This flag is used by teams as they develop in-product help integrations, @@ -2258,13 +2240,13 @@ "expiry_milestone": 80 }, { - "name": "mac-v2-gpu-sandbox", - "owners": [ "kerrnel@google.com" ], + "name": "mac-system-media-permissions-info-ui", + "owners": [ "grunell", "engedy", "hkamila" ], "expiry_milestone": 78 }, { - "name": "mac-system-media-permissions-info-ui", - "owners": [ "grunell", "engedy", "hkamila" ], + "name": "mac-v2-gpu-sandbox", + "owners": [ "kerrnel@google.com" ], "expiry_milestone": 78 }, { @@ -2504,6 +2486,11 @@ "expiry_milestone": 78 }, { + "name": "omnibox-local-entity-suggestions", + "owners": [ "manukh", "chrome-omnibox-team@google.com" ], + "expiry_milestone": 80 + }, + { "name": "omnibox-material-design-weather-icons", "owners": [ "manukh", "chromium-omnibox-team" ], "expiry_milestone": 76 @@ -2619,13 +2606,13 @@ "expiry_milestone": 81 }, { - "name": "only-new-password-form-parsing", - "owners": [ "dvadym" ], + "name": "on-the-fly-mhtml-hash-computation", + "owners": [ "mtlieuu", "offline-dev@chromium.org" ], "expiry_milestone": 76 }, { - "name": "on-the-fly-mhtml-hash-computation", - "owners": [ "mtlieuu", "offline-dev@chromium.org" ], + "name": "only-new-password-form-parsing", + "owners": [ "dvadym" ], "expiry_milestone": 76 }, { @@ -2696,6 +2683,11 @@ "expiry_milestone": 80 }, { + "name": "PasswordImport", + "owners": [ "vasilii" ], + "expiry_milestone": 76 + }, + { "name": "pdf-annotations", "owners": [ "dstockwell@google.com" ], "expiry_milestone": 76 @@ -2721,11 +2713,6 @@ "expiry_milestone": 80 }, { - "name": "prefetch-redirect-error", - "owners": [ "dom", "yhirano" ], - "expiry_milestone": 83 - }, - { "name": "policy-atomic-group-enabled", "owners": [ "ydago" ], "expiry_milestone": 80 @@ -2736,6 +2723,11 @@ "expiry_milestone": 76 }, { + "name": "prefetch-redirect-error", + "owners": [ "dom", "yhirano" ], + "expiry_milestone": 83 + }, + { "name": "proactive-tab-freeze-and-discard", "owners": [ "fdoray" ], "expiry_milestone": 75 @@ -2761,6 +2753,11 @@ "expiry_milestone": 78 }, { + "name": "release-notes", + "owners": [ "yulunwu" ], + "expiry_milestone": 79 + }, + { "name": "rewrite-leveldb-on-deletion", "owners": [ "dullweber" ], "expiry_milestone": 75 @@ -2786,6 +2783,11 @@ "expiry_milestone": 77 }, { + "name": "scrollable-tabstrip", + "owners": ["chrome-desktop-ui-seattle@google.com", "tbergquist"], + "expiry_milestone": 82 + }, + { "name": "security-interstitials-dark-mode", "owners": ["estark"], "expiry_milestone": 79 @@ -2855,6 +2857,11 @@ "expiry_milestone": 80 }, { + "name": "show-sync-paused-reason-cookies-cleared-on-exit", + "owners": [ "msalama" ], + "expiry_milestone": 85 + }, + { "name": "show-taps", "owners": [ "//ash/OWNERS" ], // This is a debug flag, so that video bug reports can show input taps to @@ -2869,17 +2876,6 @@ "expiry_milestone": -1 }, { - "name": "enable-bookmark-reorder", - "owners": ["jhimawan@google.com", "twellington" ], - "expiry_milestone": 80 - }, - { - "name": "enable-virtual-desks", - "owners": [ "afakhry" ], - // This is a flag to enable or disable the Virtual Desks feature. - "expiry_milestone": 79 - }, - { "name": "silent-debugger-extension-api", "owners": [ "//extensions/OWNERS" ], "expiry_milestone": 77 @@ -2902,11 +2898,6 @@ "expiry_milestone": 78 }, { - "name": "release-notes", - "owners": [ "yulunwu" ], - "expiry_milestone": 79 - }, - { "name": "smart-dim-model-v3", "owners": [ "amoylan", "jiameng" ], "expiry_milestone": 80 @@ -2942,6 +2933,11 @@ "expiry_milestone": 80 }, { + "name": "SupervisedUserCommittedInterstitials", + "owners": [ "carlosil" ], + "expiry_milestone": 77 + }, + { "name": "sync-support-secondary-account", "owners": [ "treib", "//components/sync/OWNERS" ], "expiry_milestone": 76 @@ -2967,13 +2963,13 @@ "expiry_milestone": 82 }, { - "name": "tab-hover-cards", - "owners": [ "corising", "//chrome/browser/ui/views/tabs/OWNERS" ], + "name": "tab-hover-card-images", + "owners": [ "dfried", "corising", "//chrome/browser/ui/views/tabs/OWNERS" ], "expiry_milestone": 82 }, { - "name": "tab-hover-card-images", - "owners": [ "dfried", "corising", "//chrome/browser/ui/views/tabs/OWNERS" ], + "name": "tab-hover-cards", + "owners": [ "corising", "//chrome/browser/ui/views/tabs/OWNERS" ], "expiry_milestone": 82 }, { @@ -2992,16 +2988,6 @@ "expiry_milestone": 82 }, { - "name": "treat-unsafe-downloads-as-active-content", - "owners": [ "jdeblasio", "cthomp" ], - "expiry_milestone": 79 - }, - { - "name": "scrollable-tabstrip", - "owners": ["chrome-desktop-ui-seattle@google.com", "tbergquist"], - "expiry_milestone": 82 - }, - { "name": "tint-gl-composited-content", "owners": [ "chromeos-gfx@google.com" ], // This flag is used for QA & development on ChromeOS, which has no way to @@ -3056,6 +3042,11 @@ "expiry_milestone": 78 }, { + "name": "treat-unsafe-downloads-as-active-content", + "owners": [ "jdeblasio", "cthomp" ], + "expiry_milestone": 79 + }, + { "name": "trim-on-all-frames-frozen", "owners": [ "bgeffon", "sonnyrao" ], "expiry_milestone": 81 @@ -3105,6 +3096,11 @@ "expiry_milestone": 76 }, { + "name": "update-hover-at-begin-frame", + "owners": [ "lanwei", "input-dev" ], + "expiry_milestone": 81 + }, + { "name": "update-menu-item-custom-summary", "owners": [ "//chrome/android/java/src/org/chromium/chrome/browser/omaha/OWNERS" ], // This is required by test teams to verify functionality on devices which @@ -3112,6 +3108,11 @@ "expiry_milestone": -1 }, { + "name": "updated_cellular_activation_ui", + "owners": [ "azeemarshad", "khorimoto" ], + "expiry_milestone": 80 + }, + { "name": "usage-stats", "owners": [ "pnoland", "chromeshine@google.com" ], "expiry_milestone": 80 @@ -3126,6 +3127,16 @@ "expiry_milestone": -1 }, { + "name": "use_messages_google_com_domain", + "owners": [ "azeemarshad", "khorimoto" ], + "expiry_milestone": 76 + }, + { + "name": "use_messages_staging_url", + "owners": [ "azeemarshad", "khorimoto" ], + "expiry_milestone": 76 + }, + { "name": "use-multilogin-endpoint", "owners": [ "droger", "msarda" ], "expiry_milestone": 78 @@ -3182,7 +3193,7 @@ { "name": "web-contents-occlusion", "owners": [ "davidbienvenu" ], - "expiry_milestone": 77 + "expiry_milestone": 81 }, { "name": "webxr", @@ -3190,6 +3201,11 @@ "expiry_milestone": 79 }, { + "name": "webxr-anchors", + "owners": [ "//third_party/blink/renderer/modules/xr/OWNERS", "xr-dev@chromium.org" ], + "expiry_milestone": 79 + }, + { "name": "webxr-hit-test", "owners": [ "//third_party/blink/renderer/modules/xr/OWNERS", "xr-dev@chromium.org" ], "expiry_milestone": 79 @@ -3218,18 +3234,5 @@ "name": "xr-sandbox", "owners": [ "//chrome/services/isolated_xr_device/OWNERS", "xr-dev@chromium.org" ], "expiry_milestone": 79 - }, - { - "name": "enable-streamlined-usb-printer-setup", - "owners": [ "baileyberro" ], - "expiry_milestone": 77 - }, - { - "name": "update-hover-at-begin-frame", - "owners": [ "lanwei", "input-dev" ], - "expiry_milestone": 81 } - - // This is an alphabetized list; please do your part to keep it organized by - // inserting your entry in alphabetical order. ]
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 7baa396e..1b38b1a5 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -2110,6 +2110,10 @@ "Enables access to experimental APIs to interact with Virtual Reality (VR) " "and Augmented Reality (AR) devices."; +const char kWebXrAnchorsName[] = "WebXR Anchors"; +const char kWebXrAnchorsDescription[] = + "Enables access to anchors via WebXR API."; + const char kWebXrHitTestName[] = "WebXR Hit Test"; const char kWebXrHitTestDescription[] = "Enables access to raycasting against estimated XR scene geometry.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 78b6e77b..d085dee 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1248,6 +1248,9 @@ extern const char kWebXrHitTestName[]; extern const char kWebXrHitTestDescription[]; +extern const char kWebXrAnchorsName[]; +extern const char kWebXrAnchorsDescription[]; + extern const char kWebXrPlaneDetectionName[]; extern const char kWebXrPlaneDetectionDescription[];
diff --git a/chrome/browser/metrics/chrome_feature_list_creator.cc b/chrome/browser/metrics/chrome_feature_list_creator.cc index c0694512..94212d4 100644 --- a/chrome/browser/metrics/chrome_feature_list_creator.cc +++ b/chrome/browser/metrics/chrome_feature_list_creator.cc
@@ -41,6 +41,7 @@ #include "components/variations/pref_names.h" #include "components/variations/service/variations_service.h" #include "components/variations/variations_crash_keys.h" +#include "content/public/common/content_switch_dependent_feature_overrides.h" #include "services/service_manager/embedder/result_codes.h" #include "ui/base/resource/resource_bundle.h" @@ -194,6 +195,8 @@ variations_service->SetupFieldTrials( cc::switches::kEnableGpuBenchmarking, switches::kEnableFeatures, switches::kDisableFeatures, unforceable_field_trials, variation_ids, + content::GetSwitchDependentFeatureOverrides( + *base::CommandLine::ForCurrentProcess()), std::move(feature_list), browser_field_trials_.get()); variations::InitCrashKeys();
diff --git a/chrome/browser/net/network_context_configuration_browsertest.cc b/chrome/browser/net/network_context_configuration_browsertest.cc index 5073db2..a6ae8a9 100644 --- a/chrome/browser/net/network_context_configuration_browsertest.cc +++ b/chrome/browser/net/network_context_configuration_browsertest.cc
@@ -38,6 +38,10 @@ #include "components/content_settings/core/common/pref_names.h" #include "components/language/core/browser/pref_names.h" #include "components/network_session_configurator/common/network_switches.h" +#include "components/policy/core/browser/browser_policy_connector.h" +#include "components/policy/core/common/mock_configuration_policy_provider.h" +#include "components/policy/core/common/policy_map.h" +#include "components/policy/policy_constants.h" #include "components/prefs/pref_service.h" #include "components/proxy_config/proxy_config_dictionary.h" #include "components/proxy_config/proxy_config_pref_names.h" @@ -216,6 +220,12 @@ ~NetworkContextConfigurationBrowserTest() override {} + void SetUpInProcessBrowserTestFixture() override { + EXPECT_CALL(provider_, IsInitializationComplete(testing::_)) + .WillRepeatedly(testing::Return(true)); + policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); + } + void SetUpOnMainThread() override { // Used in a bunch of proxy tests. Should not resolve. host_resolver()->AddSimulatedFailure("does.not.resolve.test"); @@ -626,6 +636,73 @@ content::IsInProcessNetworkService(); } + enum class WayToEnableSSLConfig { kViaPrefs, kViaPolicy }; + + // This helper function enables the kSSLVersionMin pref and tests that this + // pref is respected. kSSLVersionMin can be set in two ways: over prefs + // directly or over a policy. |way_to_enable| is used to determine the way to + // set the pref. + void TestEnablingSSLVersionMin(WayToEnableSSLConfig way_to_enable) { + // Start a TLS 1.0 server. + net::EmbeddedTestServer ssl_server(net::EmbeddedTestServer::TYPE_HTTPS); + net::SSLServerConfig ssl_config; + ssl_config.version_min = net::SSL_PROTOCOL_VERSION_TLS1; + ssl_config.version_max = net::SSL_PROTOCOL_VERSION_TLS1; + ssl_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config); + ssl_server.AddDefaultHandlers(GetChromeTestDataDir()); + ASSERT_TRUE(ssl_server.Start()); + + std::unique_ptr<network::ResourceRequest> request = + std::make_unique<network::ResourceRequest>(); + request->url = ssl_server.GetURL("/echo"); + content::SimpleURLLoaderTestHelper simple_loader_helper; + std::unique_ptr<network::SimpleURLLoader> simple_loader = + network::SimpleURLLoader::Create(std::move(request), + TRAFFIC_ANNOTATION_FOR_TESTS); + simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( + loader_factory(), simple_loader_helper.GetCallback()); + simple_loader_helper.WaitForCallback(); + ASSERT_TRUE(simple_loader_helper.response_body()); + EXPECT_EQ(*simple_loader_helper.response_body(), "Echo"); + + if (way_to_enable == WayToEnableSSLConfig::kViaPrefs) { + // Disallow TLS 1.0 via prefs. + g_browser_process->local_state()->SetString(prefs::kSSLVersionMin, + switches::kSSLVersionTLSv11); + } else { + // Disallow TLS 1.0 via policy. + policy::PolicyMap values; + values.Set(policy::key::kSSLVersionMin, policy::POLICY_LEVEL_MANDATORY, + policy::POLICY_SCOPE_MACHINE, policy::POLICY_SOURCE_CLOUD, + std::make_unique<base::Value>(switches::kSSLVersionTLSv11), + nullptr); + + base::RunLoop run_loop; + PrefChangeRegistrar pref_change_registrar; + pref_change_registrar.Init(g_browser_process->local_state()); + pref_change_registrar.Add(prefs::kSSLVersionMin, run_loop.QuitClosure()); + provider_.UpdateChromePolicy(values); + + run_loop.Run(); + } + + g_browser_process->system_network_context_manager() + ->FlushSSLConfigManagerForTesting(); + + // With the new prefs, requests to the server should be blocked. + request = std::make_unique<network::ResourceRequest>(); + request->url = ssl_server.GetURL("/echo"); + content::SimpleURLLoaderTestHelper simple_loader_helper2; + simple_loader = network::SimpleURLLoader::Create( + std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); + simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( + loader_factory(), simple_loader_helper2.GetCallback()); + simple_loader_helper2.WaitForCallback(); + EXPECT_FALSE(simple_loader_helper2.response_body()); + EXPECT_EQ(net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH, + simple_loader->NetError()); + } + private: void SimulateNetworkServiceCrashIfNecessary() { if (GetParam().network_service_state != NetworkServiceState::kRestarted || @@ -654,6 +731,7 @@ std::unique_ptr<net::test_server::ControllableHttpResponse> controllable_http_response_; + policy::MockConfigurationPolicyProvider provider_; // Used in tests that need a live request during browser shutdown. std::unique_ptr<network::SimpleURLLoader> live_during_shutdown_simple_loader_; std::unique_ptr<content::SimpleURLLoaderTestHelper> @@ -1096,47 +1174,7 @@ IN_PROC_BROWSER_TEST_P(NetworkContextConfigurationBrowserTest, PRE_SSLConfig) { if (IsRestartStateWithInProcessNetworkService()) return; - // Start a TLS 1.0 server. - net::EmbeddedTestServer ssl_server(net::EmbeddedTestServer::TYPE_HTTPS); - net::SSLServerConfig ssl_config; - ssl_config.version_min = net::SSL_PROTOCOL_VERSION_TLS1; - ssl_config.version_max = net::SSL_PROTOCOL_VERSION_TLS1; - ssl_server.SetSSLConfig(net::EmbeddedTestServer::CERT_OK, ssl_config); - ssl_server.AddDefaultHandlers(GetChromeTestDataDir()); - ASSERT_TRUE(ssl_server.Start()); - - std::unique_ptr<network::ResourceRequest> request = - std::make_unique<network::ResourceRequest>(); - request->url = ssl_server.GetURL("/echo"); - content::SimpleURLLoaderTestHelper simple_loader_helper; - std::unique_ptr<network::SimpleURLLoader> simple_loader = - network::SimpleURLLoader::Create(std::move(request), - TRAFFIC_ANNOTATION_FOR_TESTS); - simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper.GetCallback()); - simple_loader_helper.WaitForCallback(); - ASSERT_TRUE(simple_loader_helper.response_body()); - EXPECT_EQ(*simple_loader_helper.response_body(), "Echo"); - - // Disallow TLS 1.0 via prefs. - g_browser_process->local_state()->SetString(prefs::kSSLVersionMin, - switches::kSSLVersionTLSv11); - // Flush the changes to the network process, to avoid a race between updating - // the config and the next request. - g_browser_process->system_network_context_manager() - ->FlushSSLConfigManagerForTesting(); - - // With the new prefs, requests to the server should be blocked. - request = std::make_unique<network::ResourceRequest>(); - request->url = ssl_server.GetURL("/echo"); - content::SimpleURLLoaderTestHelper simple_loader_helper2; - simple_loader = network::SimpleURLLoader::Create( - std::move(request), TRAFFIC_ANNOTATION_FOR_TESTS); - simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - loader_factory(), simple_loader_helper2.GetCallback()); - simple_loader_helper2.WaitForCallback(); - EXPECT_FALSE(simple_loader_helper2.response_body()); - EXPECT_EQ(net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH, simple_loader->NetError()); + TestEnablingSSLVersionMin(WayToEnableSSLConfig::kViaPrefs); } IN_PROC_BROWSER_TEST_P(NetworkContextConfigurationBrowserTest, SSLConfig) { @@ -1166,6 +1204,16 @@ EXPECT_EQ(net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH, simple_loader->NetError()); } +// This test does the same as +// 'NetworkContextConfigurationBrowserTest.PRE_SSLConfig' but with the +// difference that the SSLVersionMin is set via a policy (not via the prefs). +IN_PROC_BROWSER_TEST_P(NetworkContextConfigurationBrowserTest, + SSLVersionMinSetViaPolicy) { + if (IsRestartStateWithInProcessNetworkService()) + return; + TestEnablingSSLVersionMin(WayToEnableSSLConfig::kViaPolicy); +} + IN_PROC_BROWSER_TEST_P(NetworkContextConfigurationBrowserTest, ProxyConfig) { if (IsRestartStateWithInProcessNetworkService()) return;
diff --git a/chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc b/chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc index 2a2473b5..fb1674a 100644 --- a/chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc +++ b/chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc
@@ -113,6 +113,10 @@ WebFeature::kDownloadInAdFrame, WebFeature::kDownloadInSandbox, WebFeature::kDownloadWithoutUserGesture, + WebFeature::kLazyLoadFrameLoadingAttributeLazy, + WebFeature::kLazyLoadFrameLoadingAttributeEager, + WebFeature::kLazyLoadImageLoadingAttributeLazy, + WebFeature::kLazyLoadImageLoadingAttributeEager, })); return *opt_in_features; }
diff --git a/chrome/browser/previews/defer_all_script_browsertest.cc b/chrome/browser/previews/defer_all_script_browsertest.cc index dcbf2c90..73e015c 100644 --- a/chrome/browser/previews/defer_all_script_browsertest.cc +++ b/chrome/browser/previews/defer_all_script_browsertest.cc
@@ -96,6 +96,7 @@ https_url_ = https_server_->GetURL("/defer_all_script_test.html"); ASSERT_TRUE(https_url_.SchemeIs(url::kHttpsScheme)); + client_redirect_url_ = https_server_->GetURL("/client_redirect_base.html"); InProcessBrowserTest::SetUpOnMainThread(); } @@ -162,6 +163,8 @@ virtual const GURL& https_url() const { return https_url_; } + const GURL& client_redirect_url() const { return client_redirect_url_; } + std::string GetScriptLog() { std::string script_log; EXPECT_TRUE(ExecuteScriptAndExtractString( @@ -185,6 +188,7 @@ std::unique_ptr<net::EmbeddedTestServer> https_server_; GURL https_url_; + GURL client_redirect_url_; DISALLOW_COPY_AND_ASSIGN(DeferAllScriptBrowserTest); }; @@ -319,3 +323,32 @@ test_ukm_recorder.ExpectEntryMetric(entry, UkmEntry::kdefer_all_scriptName, true); } + +IN_PROC_BROWSER_TEST_F( + DeferAllScriptBrowserTest, + DISABLE_ON_WIN_MAC_CHROMESOS(DeferAllScriptClientRedirectLoopStopped)) { + GURL url = https_url(); + + // Whitelist DeferAllScript for any path for the url's host. + SetDeferAllScriptHintWithPageWithPattern(url, "*"); + + base::HistogramTester histogram_tester; + ukm::TestAutoSetUkmRecorder test_ukm_recorder; + + // The client_redirect_url (/client_redirect_base.html) performs a client + // redirect to "/client_redirect_loop_with_defer_all_script.html" which + // peforms a client redirect back to the initial client_redirect_url if + // and only if script execution is deferred. This emulates the navigation + // pattern seen in crbug.com/987062 + ui_test_utils::NavigateToURL(browser(), client_redirect_url()); + + RetryForHistogramUntilCountReached( + &histogram_tester, "PageLoad.DocumentTiming.NavigationToLoadEventFired", + 1); + + // Client redirect loop is broken on 2nd pass around the loop so expect 3 + // previews before previews turned off to stop loop. + histogram_tester.ExpectTotalCount( + "Navigation.ClientRedirectCycle.RedirectToReferrer", 2); + histogram_tester.ExpectTotalCount("Previews.PageEndReason.DeferAllScript", 3); +}
diff --git a/chrome/browser/resources/chromeos/login/sync_consent.html b/chrome/browser/resources/chromeos/login/sync_consent.html index e16984c..94fa8072 100644 --- a/chrome/browser/resources/chromeos/login/sync_consent.html +++ b/chrome/browser/resources/chromeos/login/sync_consent.html
@@ -31,8 +31,9 @@ </img> <div class="overview-list-item-text flex layout vertical center-justified"> - <div class="overview-list-item-title" consent-description> - [[i18nDynamic(locale, 'syncConsentScreenChromeSyncName')]] + <div role="heading" aria-level="2" class="overview-list-item-title" + consent-description> + [[i18nDynamic(locale, 'syncConsentScreenChromeSyncName')]] </div> <div class="overview-list-item-description" consent-description> [[i18nDynamic(locale, 'syncConsentScreenChromeSyncDescription')]] @@ -45,9 +46,10 @@ </hd-iron-icon> <div class="overview-list-item-text flex layout vertical center-justified"> - <div class="overview-list-item-title" consent-description> - [[i18nDynamic(locale, - 'syncConsentScreenPersonalizeGoogleServicesName')]] + <div role ="heading" aria-level="2" class="overview-list-item-title" + consent-description> + [[i18nDynamic(locale, + 'syncConsentScreenPersonalizeGoogleServicesName')]] </div> <div class="overview-list-item-description" consent-description> [[i18nDynamic(locale,
diff --git a/chrome/browser/resources/local_ntp/customize.js b/chrome/browser/resources/local_ntp/customize.js index 019c0c9f3..d9f6188 100644 --- a/chrome/browser/resources/local_ntp/customize.js +++ b/chrome/browser/resources/local_ntp/customize.js
@@ -1003,10 +1003,10 @@ customize.selectedOptions.background = tile; customize.selectedOptions.backgroundData = { id: tile.id, - url: tile.dataset.url, - attr1: tile.dataset.attributionLine1, - attr2: tile.dataset.attributionLine2, - attrUrl: tile.dataset.attributionActionUrl, + url: tile.dataset.url || '', + attr1: tile.dataset.attributionLine1 || '', + attr2: tile.dataset.attributionLine2 || '', + attrUrl: tile.dataset.attributionActionUrl || '', collectionId: '', }; customize.richerPicker_applySelectedState(tile); @@ -1061,8 +1061,10 @@ * @param {boolean} toggledOn True if the toggle has been enabled. */ customize.richerPicker_toggleRefreshDaily = function(toggledOn) { - $(customize.IDS.MENU_DONE).disabled = !toggledOn; + $(customize.IDS.REFRESH_TOGGLE).checked = toggledOn; if (!toggledOn) { + customize.richerPicker_selectBackgroundTile( + $(customize.IDS.BACKGROUNDS_DEFAULT)); return; } @@ -1240,23 +1242,28 @@ }); } + customize.currentCollectionId = collImg[0].collectionId; + $(customize.IDS.REFRESH_TOGGLE).checked = false; // If an image tile was previously selected re-select it now. if (customize.selectedOptions.backgroundData) { const selected = $(customize.selectedOptions.backgroundData.id); if (selected) { customize.richerPicker_selectBackgroundTile(selected); + } else if ( + customize.selectedOptions.backgroundData.collectionId === + customize.currentCollectionId) { + $(customize.IDS.REFRESH_TOGGLE).checked = true; } } else { customize.richerPicker_preselectBackgroundOption(); } + $(customize.IDS.REFRESH_DAILY_WRAPPER).hidden = false; if (configData.richerPicker) { $(customize.IDS.BACKGROUNDS_IMAGE_MENU).focus(); } else { $(customize.IDS.TILES).focus(); } - customize.currentCollectionId = collImg[0].collectionId; - $(customize.IDS.REFRESH_DAILY_WRAPPER).hidden = false; }; /** @@ -1438,6 +1445,11 @@ // Local image. customize.preselectedOptions.backgroundsMenuTile = $(customize.IDS.BACKGROUNDS_UPLOAD); + } else if ( + themeInfo.collectionId !== '' && + customize.currentCollectionId == themeInfo.collectionId) { + // Daily refresh. + $(customize.IDS.REFRESH_TOGGLE).checked = true; } else if (!customize.selectedOptions.backgroundData) { // Image tile. Only if another background hasn't already been selected. customize.preselectedOptions.backgroundsMenuTile =
diff --git a/chrome/browser/resources/settings/privacy_page/BUILD.gn b/chrome/browser/resources/settings/privacy_page/BUILD.gn index 6db1f51..028266d95 100644 --- a/chrome/browser/resources/settings/privacy_page/BUILD.gn +++ b/chrome/browser/resources/settings/privacy_page/BUILD.gn
@@ -9,6 +9,7 @@ ":personalization_options", ":privacy_page", ":privacy_page_browser_proxy", + ":security_keys_bio_enroll_dialog", ":security_keys_credential_management_dialog", ":security_keys_reset_dialog", ":security_keys_set_pin_dialog", @@ -104,3 +105,13 @@ ] externs_list = [ "$externs_path/settings_private.js" ] } + +js_library("security_keys_bio_enroll_dialog") { + deps = [ + ":security_keys_browser_proxy", + ":security_keys_pin_field", + "//ui/webui/resources/cr_elements/cr_fingerprint:cr_fingerprint_progress_arc", + "//ui/webui/resources/js:i18n_behavior", + ] + externs_list = [ "$externs_path/settings_private.js" ] +}
diff --git a/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.html b/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.html new file mode 100644 index 0000000..436f622 --- /dev/null +++ b/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.html
@@ -0,0 +1,110 @@ +<link rel="import" href="chrome://resources/html/polymer.html"> + +<link rel="import" href="chrome://resources/html/assert.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_fingerprint/cr_fingerprint_progress_arc.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html"> +<link rel="import" href="chrome://resources/html/i18n_behavior.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/iron-pages/iron-pages.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html"> +<link rel="import" href="../i18n_setup.html"> +<link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="../site_favicon.html"> +<link rel="import" href="security_keys_browser_proxy.html"> +<link rel="import" href="security_keys_pin_field.html"> + +<dom-module id="settings-security-keys-bio-enroll-dialog"> + <template> + <style include="settings-shared"> + #header { + display: flex; + } + + iron-icon { + padding-inline-end: 12px; + } + + .name { + flex: 3; + } + </style> + + <cr-dialog id="dialog" close-text="$i18n{cancel}" ignore-popstate + on-close="onDialogClosed_"> + <div slot="title">$i18n{securityKeysBioEnrollmentDialogTitle}</div> + + <div slot="body"> + <iron-pages attr-for-selected="id" selected="[[dialogPage_]]" + on-iron-select="onIronSelect_"> + <div id="initial"> + <p>$i18n{securityKeysBioEnrollmentTouch}</p> + <paper-spinner-lite style="padding-bottom: 16px;" active> + </paper-spinner-lite> + </div> + + <div id="pinPrompt"> + <p>$i18n{securityKeysBioEnrollmentPinPrompt}</p> + <settings-security-keys-pin-field id="pin"> + </settings-security-keys-pin-field> + </div> + + <div id="enrollments"> + <div class="settings-box first"> + <p class="start" hidden="[[hasSome_(enrollments_)]]"> + $i18n{securityKeysBioEnrollmentNoEnrollments}</p> + <p class="start" hidden="[[!hasSome_(enrollments_)]]"> + $i18n{securityKeysBioEnrollmentLabel}</p> + <cr-button id="addButton" on-click="addButtonClick_" + hidden="[[!addButtonVisible_]]" + class="secondary-button header-aligned-button"> + $i18n{add} + </cr-button> + </div> + <div id="container"> + <iron-list id="enrollmentList" items="[[enrollments_]]" + class="cr-separators"> + <template> + <div class="list-item"> + <iron-icon icon="cr-fingerprint-icon:enrollment-done"> + </iron-icon> + <div class="name" aria-label="[[item.name]]"> + [[item.name]] + </div> + </div> + </template> + </iron-list> + </div> + </div> + + <div id="enroll"> + <p>$i18n{securityKeysBioEnrollmentEnrollingLabel}</p> + <cr-fingerprint-progress-arc id="arc"> + </cr-fingerprint-progress-arc> + </div> + + <div id="error">[[errorMsg_]]</div> + </iron-pages> + </div> + + <div slot="button-container"> + <cr-button id="cancelButton" class="cancel-button" + on-click="cancel_" hidden="[[!cancelButtonVisible_]]"> + $i18n{cancel} + </cr-button> + <cr-button id="okButton" class="action-button" + on-click="okButtonClick_" hidden="[[!okButtonVisible_]]"> + $i18n{ok} + </cr-button> + <cr-button id="doneButton" class="action-button" + on-click="done_" hidden="[[!doneButtonVisible_]]"> + $i18n{done} + </cr-button> + </div> + </cr-dialog> + + </template> + <script src="security_keys_bio_enroll_dialog.js"></script> +</dom-module>
diff --git a/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.js b/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.js new file mode 100644 index 0000000..cce9de63 --- /dev/null +++ b/chrome/browser/resources/settings/privacy_page/security_keys_bio_enroll_dialog.js
@@ -0,0 +1,254 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +(function() { +'use strict'; + +/** + * @fileoverview 'settings-security-keys-bio-enroll-dialog' is a dialog for + * listing, adding, renaming, and deleting biometric enrollments stored on a + * security key. + */ +Polymer({ + is: 'settings-security-keys-bio-enroll-dialog', + + behaviors: [ + I18nBehavior, + WebUIListenerBehavior, + ], + + properties: { + /** + * The ID of the element currently shown in the dialog. + * @private + */ + dialogPage_: { + type: String, + value: 'initial', + observer: 'dialogPageChanged_', + }, + + /** + * The list of enrollments displayed. + * @private {!Array<!Enrollment>} + */ + enrollments_: Array, + + /** @private */ + addButtonVisible_: Boolean, + + /** @private */ + cancelButtonVisible_: Boolean, + + /** @private */ + okButtonVisible_: Boolean, + + /** @private */ + doneButtonVisible_: Boolean, + }, + + /** @private {?settings.SecurityKeysBioEnrollProxyImpl} */ + browserProxy_: null, + + /** @private */ + maxSamples_: Number, + + /** @override */ + attached: function() { + this.$.dialog.showModal(); + this.addWebUIListener( + 'security-keys-bio-enroll-error', this.onError_.bind(this)); + this.addWebUIListener( + 'security-keys-bio-enroll-status', this.onEnrolling_.bind(this)); + this.browserProxy_ = settings.SecurityKeysBioEnrollProxyImpl.getInstance(); + this.browserProxy_.startBioEnroll().then( + this.collectPIN_.bind(this), () => {}); + }, + + /** @private */ + collectPIN_: function() { + this.dialogPage_ = 'pinPrompt'; + this.$.pin.focus(); + }, + + /** + * @private + * @param {string} error + */ + onError_: function(error) { + this.errorMsg_ = error; + this.dialogPage_ = 'error'; + }, + + /** @private */ + submitPIN_: function() { + if (!this.$.pin.validate()) { + return; + } + this.browserProxy_.providePIN(this.$.pin.value).then((retries) => { + if (retries != null) { + this.$.pin.showIncorrectPINError(retries); + return; + } + + this.browserProxy_.enumerateEnrollments().then( + this.onEnrollments_.bind(this)); + }, () => {}); + }, + + /** + * @private + * @param {!Array<!Enrollment>} enrollments + */ + onEnrollments_: function(enrollments) { + this.enrollments_ = enrollments; + this.$.enrollmentList.fire('iron-resize'); + this.dialogPage_ = 'enrollments'; + }, + + /** @private */ + dialogPageChanged_: function() { + switch (this.dialogPage_) { + case 'initial': + this.addButtonVisible_ = false; + this.cancelButtonVisible_ = true; + this.okButtonVisible_ = false; + this.doneButtonVisible_ = false; + break; + case 'pinPrompt': + this.addButtonVisible_ = false; + this.cancelButtonVisible_ = true; + this.okButtonVisible_ = true; + this.doneButtonVisible_ = false; + break; + case 'enrollments': + this.addButtonVisible_ = true; + this.cancelButtonVisible_ = false; + this.okButtonVisible_ = false; + this.doneButtonVisible_ = true; + break; + case 'enroll': + this.addButtonVisible_ = false; + this.cancelButtonVisible_ = true; + this.okButtonVisible_ = false; + this.doneButtonVisible_ = false; + break; + case 'error': + this.addButtonVisible_ = false; + this.cancelButtonVisible_ = false; + this.okButtonVisible_ = false; + this.doneButtonVisible_ = true; + break; + default: + assertNotReached(); + } + this.fire('bio-enroll-dialog-ready-for-testing'); + }, + + /** @private */ + addButtonClick_: function() { + assert(this.dialogPage_ == 'enrollments'); + + this.maxSamples_ = -1; // Reset maxSamples_ before enrolling starts. + this.$.arc.reset(); + this.cancelButtonVisible_ = true; + this.okButtonVisible_ = false; + + this.dialogPage_ = 'enroll'; + this.browserProxy_.startEnrolling().then( + this.onEnrolling_.bind(this), () => {}); + }, + + /** + * @private + * @param {!EnrollmentStatus} response + */ + onEnrolling_: function(response) { + if (this.maxSamples_ == -1 && response.status != null) { + if (response.status == 0) { + // If the first sample is valid, remaining is one less than max samples + // required. + this.maxSamples_ = response.remaining + 1; + } else { + // If the first sample failed for any reason (timed out, key full, etc), + // the remaining number of samples is the max samples required. + this.maxSamples_ = response.remaining; + } + } + // If 0 samples remain, the enrollment has finished in some state. + // Currently not checking response['code'] for an error. + this.$.arc.setProgress( + 100 - (100 * (response.remaining + 1) / this.maxSamples_), + 100 - (100 * response.remaining / this.maxSamples_), + response.remaining == 0); + if (response.remaining == 0) { + this.cancelButtonVisible_ = false; + this.okButtonVisible_ = true; + } + this.fire('bio-enroll-dialog-ready-for-testing'); + }, + + /** @private */ + okButtonClick_: function() { + switch (this.dialogPage_) { + case 'pinPrompt': + this.submitPIN_(); + break; + case 'enroll': + this.browserProxy_.enumerateEnrollments().then( + this.onEnrollments_.bind(this), () => {}); + break; + default: + assertNotReached(); + } + }, + + /** @private */ + cancel_: function() { + if (this.dialogPage_ == 'enroll') { + this.browserProxy_.cancelEnrollment().then( + this.cancelEnroll_.bind(this), () => {}); + } else { + this.done_(); + } + }, + + /** @private */ + cancelEnroll_: function() { + // Cancelling from the enrolling screen redirects to the enrollments + // list, so request another enumeration to display. + this.browserProxy_.enumerateEnrollments().then( + this.onEnrollments_.bind(this), () => {}); + }, + + /** @private */ + done_: function() { + this.$.dialog.close(); + }, + + /** @private */ + onDialogClosed_: function() { + this.browserProxy_.close(); + }, + + /** + * @private + * @param {!Event} e + */ + onIronSelect_: function(e) { + // Prevent this event from bubbling since it is unnecessarily triggering the + // listener within settings-animated-pages. + e.stopPropagation(); + }, + + /** + * @private + * @param {?Array} list + * @return {boolean} true if the list exists and has items. + */ + hasSome_: function(list) { + return !!(list && list.length); + }, +}); +})();
diff --git a/chrome/browser/resources/settings/privacy_page/security_keys_browser_proxy.js b/chrome/browser/resources/settings/privacy_page/security_keys_browser_proxy.js index 0d6f5fb..2fd3f69 100644 --- a/chrome/browser/resources/settings/privacy_page/security_keys_browser_proxy.js +++ b/chrome/browser/resources/settings/privacy_page/security_keys_browser_proxy.js
@@ -26,6 +26,31 @@ */ let Credential; +/** + * EnrollmentStatus represents the current status of an enrollment suboperation, + * where 'remaining' indicates the number of samples left, 'status' indicates + * the last enrollment status, and 'code' indicates the CtapDeviceResponseCode. + * For each enrollment sample, 'status' is set - when the enrollment operation + * reaches an end state, 'code' is set. A 'code' of CtapDeviceResponseCode 0 + * indicates successful enrollment. + * + * @typedef {{status: ?number, + * code: ?number, + * remaining: number}} + * @see chrome/browser/ui/webui/settings/settings_security_key_handler.cc + */ +let EnrollmentStatus; + +/** + * Enrollment represents a valid fingerprint template stored on a security key, + * which can be used in a user verification request. + * + * @typedef {{name: string, + * id: string}} + * @see chrome/browser/ui/webui/settings/settings_security_key_handler.cc + */ +let Enrollment; + cr.define('settings', function() { /** @interface */ class SecurityKeysPINBrowserProxy { @@ -118,6 +143,70 @@ close() {} } + /** @interface */ + class SecurityKeysBioEnrollProxy { + /** + * Starts a biometric enrollment operation. + * + * Callers must listen to errors that can occur during this operation via a + * 'security-keys-bio-enrollment-error' WebUIListener. Values received via + * this listener are localized error strings. The WebListener may fire at + * any point during the operation (enrolling, deleting, etc) and when it + * fires, the operation must be considered terminated. + * + * @return {!Promise} resolves when the handler is ready for the + * authentcation PIN to be provided. + */ + startBioEnroll() {} + + /** + * Provides a PIN for a biometric enrollment operation. The startBioEnroll() + * Promise must have resolved before this method may be called. + * + * @return {!Promise<?number>} resolves with null if the PIN was correct, + * the number of retries remaining otherwise. + */ + providePIN(pin) {} + + /** + * Enumerates enrollments on the authenticator. A correct PIN must have + * previously been supplied via bioEnrollProvidePIN() before this method may + * be called. + * + * @return {!Promise<!Array<!Enrollment>>} + */ + enumerateEnrollments() {} + + /** + * Move the operation into enrolling mode, which instructs the authenticator + * to start sampling for touches. + * + * Callers must listen to status updates that will occur during this + * suboperation via a 'security-keys-bio-enroll-status' WebListener. Values + * received via this listener are DictionaryValues with two elements (see + * below). When the WebListener fires, the authenticator has either timed + * out waiting for a touch, or has successfully processed a touch. Any + * errors will fire the 'security-keys-bio-enrollment-error' WebListener. + * + * @return {!Promise<!EnrollmentStatus>} resolves when the enrollment + * operation is finished successfully. + */ + startEnrolling() {} + + /** + * Cancel an ongoing enrollment suboperation. This can safely be called at + * any time and only has an impact when the authenticator is currently + * sampling. + * + * @return {!Promise} resolves when the ongoing enrollment suboperation has + * been cancelled. + */ + cancelEnrollment() {} + + /** Cancels all outstanding operations. */ + close() {} + } + /** @implements {settings.SecurityKeysPINBrowserProxy} */ class SecurityKeysPINBrowserProxyImpl { /** @override */ @@ -182,11 +271,45 @@ } } + /** @implements {settings.SecurityKeysBioEnrollProxy} */ + class SecurityKeysBioEnrollProxyImpl { + /** @override */ + startBioEnroll() { + return cr.sendWithPromise('securityKeyBioEnrollStart'); + } + + /** @override */ + providePIN(pin) { + return cr.sendWithPromise('securityKeyBioEnrollProvidePIN', pin); + } + + /** @override */ + enumerateEnrollments() { + return cr.sendWithPromise('securityKeyBioEnrollEnumerate'); + } + + /** @override */ + startEnrolling() { + return cr.sendWithPromise('securityKeyBioEnrollStartEnrolling'); + } + + /** @override */ + cancelEnrollment() { + return cr.sendWithPromise('securityKeyBioEnrollCancel'); + } + + /** @override */ + close() { + return chrome.send('securityKeyBioEnrollClose'); + } + } + // The singleton instance_ is replaced with a test version of this wrapper // during testing. cr.addSingletonGetter(SecurityKeysPINBrowserProxyImpl); cr.addSingletonGetter(SecurityKeysCredentialBrowserProxyImpl); cr.addSingletonGetter(SecurityKeysResetBrowserProxyImpl); + cr.addSingletonGetter(SecurityKeysBioEnrollProxyImpl); return { SecurityKeysPINBrowserProxy: SecurityKeysPINBrowserProxy, @@ -196,5 +319,7 @@ SecurityKeysCredentialBrowserProxyImpl, SecurityKeysResetBrowserProxy: SecurityKeysResetBrowserProxy, SecurityKeysResetBrowserProxyImpl: SecurityKeysResetBrowserProxyImpl, + SecurityKeysBioEnrollProxy: SecurityKeysBioEnrollProxy, + SecurityKeysBioEnrollProxyImpl: SecurityKeysBioEnrollProxyImpl, }; });
diff --git a/chrome/browser/resources/settings/privacy_page/security_keys_subpage.html b/chrome/browser/resources/settings/privacy_page/security_keys_subpage.html index e1d58b3..8f242c4 100644 --- a/chrome/browser/resources/settings/privacy_page/security_keys_subpage.html +++ b/chrome/browser/resources/settings/privacy_page/security_keys_subpage.html
@@ -6,6 +6,7 @@ <link rel="import" href="../settings_shared_css.html"> <link rel="import" href="security_keys_credential_management_dialog.html"> +<link rel="import" href="security_keys_bio_enroll_dialog.html"> <link rel="import" href="security_keys_set_pin_dialog.html"> <link rel="import" href="security_keys_reset_dialog.html"> @@ -32,6 +33,14 @@ label="$i18n{securityKeysReset}" sub-label="$i18n{securityKeysResetDesc}" on-click="onReset_"></cr-link-row> + <template is="dom-if" if="[[enableBioEnrollment_]]"> + <cr-link-row + id="bioEnrollButton" + class="hr" + label="$i18n{securityKeysBioEnrollmentDialogTitle}" + sub-label="$i18n{securityKeysBioEnrollmentSubpageDescription}" + on-click="onBioEnroll_"></cr-link-row> + </template> <template is="dom-if" if="[[showSetPINDialog_]]" restamp> <settings-security-keys-set-pin-dialog on-close="onSetPINDialogClosed_"> @@ -49,6 +58,12 @@ </settings-security-keys-reset-dialog> </template> + <template is="dom-if" if="[[showBioEnrollDialog_]]" restamp> + <settings-security-keys-bio-enroll-dialog + on-close="onBioEnrollDialogClosed_"> + </settings-security-keys-bio-enroll-dialog> + </template> + </template> <script src="security_keys_subpage.js"></script> </dom-module>
diff --git a/chrome/browser/resources/settings/privacy_page/security_keys_subpage.js b/chrome/browser/resources/settings/privacy_page/security_keys_subpage.js index 53b441f..414f107 100644 --- a/chrome/browser/resources/settings/privacy_page/security_keys_subpage.js +++ b/chrome/browser/resources/settings/privacy_page/security_keys_subpage.js
@@ -21,6 +21,15 @@ }, /** @private */ + enableBioEnrollment_: { + type: Boolean, + readOnly: true, + value: function() { + return loadTimeData.getBoolean('enableSecurityKeysBioEnrollment'); + } + }, + + /** @private */ showSetPINDialog_: { type: Boolean, value: false, @@ -35,6 +44,11 @@ type: Boolean, value: false, }, + /** @private */ + showBioEnrollDialog_: { + type: Boolean, + value: false, + }, }, /** @private */ @@ -69,4 +83,15 @@ this.showResetDialog_ = false; cr.ui.focusWithoutInk(this.$.resetButton); }, + + /** @private */ + onBioEnroll_: function() { + this.showBioEnrollDialog_ = true; + }, + + /** @private */ + onBioEnrollDialogClosed_: function() { + this.showBioEnrollDialog_ = false; + cr.ui.focusWithoutInk(assert(this.$$('#bioEnrollButton'))); + }, });
diff --git a/chrome/browser/resources/settings/settings_resources.grd b/chrome/browser/resources/settings/settings_resources.grd index 6fad16b..fe8d5047 100644 --- a/chrome/browser/resources/settings/settings_resources.grd +++ b/chrome/browser/resources/settings/settings_resources.grd
@@ -424,6 +424,12 @@ <structure name="IDR_SETTINGS_SECURITY_KEYS_RESET_DIALOG_JS" file="privacy_page/security_keys_reset_dialog.js" type="chrome_html"/> + <structure name="IDR_SETTINGS_SECURITY_KEYS_BIO_ENROLL_DIALOG_HTML" + file="privacy_page/security_keys_bio_enroll_dialog.html" + type="chrome_html" /> + <structure name="IDR_SETTINGS_SECURITY_KEYS_BIO_ENROLL_DIALOG_JS" + file="privacy_page/security_keys_bio_enroll_dialog.js" + type="chrome_html" /> <structure name="IDR_SETTINGS_SECURITY_KEYS_DIALOG_BROWSER_PROXY_HTML" file="privacy_page/security_keys_browser_proxy.html" type="chrome_html" />
diff --git a/chrome/browser/sharing/click_to_call/click_to_call_browsertest.cc b/chrome/browser/sharing/click_to_call/click_to_call_browsertest.cc index abf3e4e..59938922 100644 --- a/chrome/browser/sharing/click_to_call/click_to_call_browsertest.cc +++ b/chrome/browser/sharing/click_to_call/click_to_call_browsertest.cc
@@ -16,9 +16,9 @@ #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/gcm/gcm_profile_service_factory.h" #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h" -#include "chrome/browser/sharing/click_to_call/click_to_call_constants.h" #include "chrome/browser/sharing/click_to_call/feature.h" #include "chrome/browser/sharing/features.h" +#include "chrome/browser/sharing/sharing_constants.h" #include "chrome/browser/sharing/sharing_device_info.h" #include "chrome/browser/sharing/sharing_device_registration_result.h" #include "chrome/browser/sharing/sharing_service.h"
diff --git a/chrome/browser/sharing/click_to_call/click_to_call_constants.h b/chrome/browser/sharing/click_to_call/click_to_call_constants.h deleted file mode 100644 index 119a78c..0000000 --- a/chrome/browser/sharing/click_to_call/click_to_call_constants.h +++ /dev/null
@@ -1,24 +0,0 @@ -// Copyright 2019 The Chromium 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_SHARING_CLICK_TO_CALL_CLICK_TO_CALL_CONSTANTS_H_ -#define CHROME_BROWSER_SHARING_CLICK_TO_CALL_CLICK_TO_CALL_CONSTANTS_H_ - -#include "base/time/time.h" - -// Time limit for click to call message expiration. -constexpr base::TimeDelta kSharingClickToCallMessageTTL = - base::TimeDelta::FromSeconds(10); - -// Maximum number of devices to be shown in dialog and context menu. -constexpr int kMaxDevicesShown = 10; - -// Command id for first device shown in submenu. -constexpr int kSubMenuFirstDeviceCommandId = 2150; - -// Command id for last device shown in submenu. -constexpr int kSubMenuLastDeviceCommandId = - kSubMenuFirstDeviceCommandId + kMaxDevicesShown - 1; - -#endif // CHROME_BROWSER_SHARING_CLICK_TO_CALL_CLICK_TO_CALL_CONSTANTS_H_
diff --git a/chrome/browser/sharing/click_to_call/click_to_call_context_menu_observer.cc b/chrome/browser/sharing/click_to_call/click_to_call_context_menu_observer.cc index f21caf65c..5cb2d9c 100644 --- a/chrome/browser/sharing/click_to_call/click_to_call_context_menu_observer.cc +++ b/chrome/browser/sharing/click_to_call/click_to_call_context_menu_observer.cc
@@ -9,9 +9,9 @@ #include "build/build_config.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" -#include "chrome/browser/sharing/click_to_call/click_to_call_constants.h" #include "chrome/browser/sharing/click_to_call/click_to_call_sharing_dialog_controller.h" #include "chrome/browser/sharing/click_to_call/feature.h" +#include "chrome/browser/sharing/sharing_constants.h" #include "chrome/browser/sharing/sharing_metrics.h" #include "chrome/browser/sharing/sharing_service.h" #include "chrome/browser/sharing/sharing_service_factory.h"
diff --git a/chrome/browser/sharing/click_to_call/click_to_call_context_menu_observer_unittest.cc b/chrome/browser/sharing/click_to_call/click_to_call_context_menu_observer_unittest.cc index 87d5fa2..29b3a84b 100644 --- a/chrome/browser/sharing/click_to_call/click_to_call_context_menu_observer_unittest.cc +++ b/chrome/browser/sharing/click_to_call/click_to_call_context_menu_observer_unittest.cc
@@ -14,8 +14,8 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/renderer_context_menu/mock_render_view_context_menu.h" -#include "chrome/browser/sharing/click_to_call/click_to_call_constants.h" #include "chrome/browser/sharing/click_to_call/feature.h" +#include "chrome/browser/sharing/sharing_constants.h" #include "chrome/browser/sharing/sharing_device_info.h" #include "chrome/browser/sharing/sharing_fcm_handler.h" #include "chrome/browser/sharing/sharing_fcm_sender.h" @@ -170,9 +170,8 @@ item.command_id); // Emulate click on the device. - EXPECT_CALL(*service(), - SendMessageToDevice(Eq(guid), Eq(kSharingClickToCallMessageTTL), - ProtoEquals(sharing_message), _)) + EXPECT_CALL(*service(), SendMessageToDevice(Eq(guid), Eq(kSharingMessageTTL), + ProtoEquals(sharing_message), _)) .Times(1); menu_.ExecuteCommand(IDC_CONTENT_CONTEXT_SHARING_CLICK_TO_CALL_SINGLE_DEVICE, 0); @@ -210,10 +209,9 @@ // assigned. for (int i = 0; i < kMaxDevicesShown; i++) { if (i < device_count) { - EXPECT_CALL( - *service(), - SendMessageToDevice(Eq(guids[i]), Eq(kSharingClickToCallMessageTTL), - ProtoEquals(sharing_message), _)) + EXPECT_CALL(*service(), + SendMessageToDevice(Eq(guids[i]), Eq(kSharingMessageTTL), + ProtoEquals(sharing_message), _)) .Times(1); } else { EXPECT_CALL(*service(), SendMessageToDevice(_, _, _, _)).Times(0); @@ -256,10 +254,9 @@ // range too. for (int i = 0; i < device_count; i++) { if (i < kMaxDevicesShown) { - EXPECT_CALL( - *service(), - SendMessageToDevice(Eq(guids[i]), Eq(kSharingClickToCallMessageTTL), - ProtoEquals(sharing_message), _)) + EXPECT_CALL(*service(), + SendMessageToDevice(Eq(guids[i]), Eq(kSharingMessageTTL), + ProtoEquals(sharing_message), _)) .Times(1); } else { EXPECT_CALL(*service(), SendMessageToDevice(_, _, _, _)).Times(0);
diff --git a/chrome/browser/sharing/click_to_call/click_to_call_sharing_dialog_controller.cc b/chrome/browser/sharing/click_to_call/click_to_call_sharing_dialog_controller.cc index f683792..9130241 100644 --- a/chrome/browser/sharing/click_to_call/click_to_call_sharing_dialog_controller.cc +++ b/chrome/browser/sharing/click_to_call/click_to_call_sharing_dialog_controller.cc
@@ -9,7 +9,7 @@ #include "base/strings/strcat.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/external_protocol/external_protocol_handler.h" -#include "chrome/browser/sharing/click_to_call/click_to_call_constants.h" +#include "chrome/browser/sharing/sharing_constants.h" #include "chrome/browser/sharing/sharing_device_info.h" #include "chrome/browser/sharing/sharing_dialog.h" #include "chrome/browser/sharing/sharing_service.h" @@ -116,7 +116,7 @@ unescaped_phone_number.length()))); sharing_service_->SendMessageToDevice( - device.guid(), kSharingClickToCallMessageTTL, std::move(sharing_message), + device.guid(), kSharingMessageTTL, std::move(sharing_message), base::Bind(&ClickToCallSharingDialogController::OnMessageSentToDevice, weak_ptr_factory_.GetWeakPtr(), last_dialog_id_)); }
diff --git a/chrome/browser/sharing/click_to_call/click_to_call_sharing_dialog_controller_unittest.cc b/chrome/browser/sharing/click_to_call/click_to_call_sharing_dialog_controller_unittest.cc index 54b85d0..e0ac7a6 100644 --- a/chrome/browser/sharing/click_to_call/click_to_call_sharing_dialog_controller_unittest.cc +++ b/chrome/browser/sharing/click_to_call/click_to_call_sharing_dialog_controller_unittest.cc
@@ -10,8 +10,8 @@ #include "base/memory/ptr_util.h" #include "base/strings/strcat.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/sharing/click_to_call/click_to_call_constants.h" #include "chrome/browser/sharing/fake_local_device_info_provider.h" +#include "chrome/browser/sharing/sharing_constants.h" #include "chrome/browser/sharing/sharing_device_info.h" #include "chrome/browser/sharing/sharing_fcm_handler.h" #include "chrome/browser/sharing/sharing_fcm_sender.h" @@ -115,9 +115,9 @@ chrome_browser_sharing::SharingMessage sharing_message; sharing_message.mutable_click_to_call_message()->set_phone_number( kExpectedPhoneNumber); - EXPECT_CALL(*service(), SendMessageToDevice(Eq(kReceiverGuid), - Eq(kSharingClickToCallMessageTTL), - ProtoEquals(sharing_message), _)); + EXPECT_CALL(*service(), + SendMessageToDevice(Eq(kReceiverGuid), Eq(kSharingMessageTTL), + ProtoEquals(sharing_message), _)); click_to_call_sharing_dialog_controller_->OnDeviceChosen(sharing_device_info); }
diff --git a/chrome/browser/sharing/shared_clipboard/shared_clipboard_ui_controller.cc b/chrome/browser/sharing/shared_clipboard/shared_clipboard_ui_controller.cc new file mode 100644 index 0000000..9f49852 --- /dev/null +++ b/chrome/browser/sharing/shared_clipboard/shared_clipboard_ui_controller.cc
@@ -0,0 +1,112 @@ +// Copyright 2019 The Chromium 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/sharing/shared_clipboard/shared_clipboard_ui_controller.h" + +#include <utility> + +#include "base/strings/strcat.h" +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/external_protocol/external_protocol_handler.h" +#include "chrome/browser/sharing/sharing_constants.h" +#include "chrome/browser/sharing/sharing_device_info.h" +#include "chrome/browser/sharing/sharing_dialog.h" +#include "chrome/browser/sharing/sharing_service.h" +#include "chrome/browser/sharing/sharing_service_factory.h" +#include "chrome/browser/shell_integration.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_finder.h" +#include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/page_action/page_action_icon_container.h" +#include "chrome/browser/ui/singleton_tabs.h" +#include "chrome/common/url_constants.h" +#include "components/sync_device_info/device_info.h" +#include "components/vector_icons/vector_icons.h" +#include "content/public/browser/web_contents.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/strings/grit/ui_strings.h" +#include "url/url_util.h" + +using App = SharingDialogController::App; + +// static +SharedClipboardUiController* +SharedClipboardUiController::GetOrCreateFromWebContents( + content::WebContents* web_contents) { + SharedClipboardUiController::CreateForWebContents(web_contents); + return SharedClipboardUiController::FromWebContents(web_contents); +} + +// static +void SharedClipboardUiController::DeviceSelected( + content::WebContents* web_contents, + const base::string16 text, + const SharingDeviceInfo& device) { + auto* controller = GetOrCreateFromWebContents(web_contents); + controller->text_ = text; + controller->OnDeviceChosen(device); +} + +SharedClipboardUiController::SharedClipboardUiController( + content::WebContents* web_contents) + : SharingDialogController(web_contents), + sharing_service_(SharingServiceFactory::GetForBrowserContext( + web_contents->GetBrowserContext())) {} + +SharedClipboardUiController::~SharedClipboardUiController() = default; + +base::string16 SharedClipboardUiController::GetTitle() { + // There is no left click dialog - so no title + return base::string16(); +} + +std::vector<SharingDeviceInfo> SharedClipboardUiController::GetSyncedDevices() { + // TODO(yasmo): change it to kSharedClipboard when cl 1745473 is submitted. + return sharing_service_->GetDeviceCandidates( + static_cast<int>(SharingDeviceCapability::kNone)); +} + +// No need for apps for shared clipboard feature +std::vector<App> SharedClipboardUiController::GetApps() { + return std::vector<App>(); +} + +// No left click dialog +SharingDialog* SharedClipboardUiController::DoShowDialog( + BrowserWindow* window) { + return nullptr; +} + +void SharedClipboardUiController::OnDeviceChosen( + const SharingDeviceInfo& device) { + StartLoading(); + + chrome_browser_sharing::SharingMessage sharing_message; + sharing_message.mutable_shared_clipboard_message()->set_text( + base::UTF16ToUTF8(text_)); + + sharing_service_->SendMessageToDevice( + device.guid(), kSharingMessageTTL, std::move(sharing_message), + base::Bind(&SharedClipboardUiController::OnMessageSentToDevice, + weak_ptr_factory_.GetWeakPtr(), 0)); +} + +void SharedClipboardUiController::OnMessageSentToDevice(int dialog_id, + bool success) { + // Do nothing +} + +void SharedClipboardUiController::OnAppChosen(const App& app) { + // Do nothing - there is no apps +} + +void SharedClipboardUiController::OnHelpTextClicked() { + // No help text +} + +PageActionIconType SharedClipboardUiController::GetIconType() { + return PageActionIconType::kSendTabToSelf; +} + +WEB_CONTENTS_USER_DATA_KEY_IMPL(SharedClipboardUiController)
diff --git a/chrome/browser/sharing/shared_clipboard/shared_clipboard_ui_controller.h b/chrome/browser/sharing/shared_clipboard/shared_clipboard_ui_controller.h new file mode 100644 index 0000000..eaa104c --- /dev/null +++ b/chrome/browser/sharing/shared_clipboard/shared_clipboard_ui_controller.h
@@ -0,0 +1,72 @@ +// Copyright 2019 The Chromium 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_SHARING_SHARED_CLIPBOARD_SHARED_CLIPBOARD_UI_CONTROLLER_H_ +#define CHROME_BROWSER_SHARING_SHARED_CLIPBOARD_SHARED_CLIPBOARD_UI_CONTROLLER_H_ + +#include <string> +#include <vector> + +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "chrome/browser/sharing/sharing_dialog_controller.h" +#include "chrome/browser/sharing/sharing_service.h" +#include "chrome/browser/ui/page_action/page_action_icon_container.h" +#include "content/public/browser/web_contents_user_data.h" +#include "url/gurl.h" + +namespace content { +class WebContents; +} // namespace content + +class SharingDeviceInfo; + +class SharedClipboardUiController + : public SharingDialogController, + public content::WebContentsUserData<SharedClipboardUiController> { + public: + static SharedClipboardUiController* GetOrCreateFromWebContents( + content::WebContents* web_contents); + static void DeviceSelected(content::WebContents* web_contents, + const base::string16 text, + const SharingDeviceInfo& device); + + ~SharedClipboardUiController() override; + + // Overridden from SharingDialogController: + base::string16 GetTitle() override; + std::vector<SharingDeviceInfo> GetSyncedDevices() override; + std::vector<App> GetApps() override; + void OnDeviceChosen(const SharingDeviceInfo& device) override; + void OnAppChosen(const App& app) override; + PageActionIconType GetIconType() override; + + // Called by the SharedClipboardDialogView when the help text got clicked. + void OnHelpTextClicked(); + + protected: + explicit SharedClipboardUiController(content::WebContents* web_contents); + SharingDialog* DoShowDialog(BrowserWindow* window) override; + + private: + friend class content::WebContentsUserData<SharedClipboardUiController>; + + // Called after a message got sent to a device. Shows a new error dialog if + // |success| is false and updates the omnibox icon. + void OnMessageSentToDevice(int dialog_id, bool success); + + content::WebContents* web_contents_ = nullptr; + SharingService* sharing_service_ = nullptr; + + base::string16 text_; + bool hide_default_handler_ = false; + + base::WeakPtrFactory<SharedClipboardUiController> weak_ptr_factory_{this}; + + WEB_CONTENTS_USER_DATA_KEY_DECL(); + + DISALLOW_COPY_AND_ASSIGN(SharedClipboardUiController); +}; + +#endif // CHROME_BROWSER_SHARING_SHARED_CLIPBOARD_SHARED_CLIPBOARD_UI_CONTROLLER_H_
diff --git a/chrome/browser/sharing/shared_clipboard/shared_clipboard_ui_controller_unittest.cc b/chrome/browser/sharing/shared_clipboard/shared_clipboard_ui_controller_unittest.cc new file mode 100644 index 0000000..319b032 --- /dev/null +++ b/chrome/browser/sharing/shared_clipboard/shared_clipboard_ui_controller_unittest.cc
@@ -0,0 +1,132 @@ +// Copyright 2019 The Chromium 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/sharing/shared_clipboard/shared_clipboard_ui_controller.h" + +#include <memory> + +#include "base/guid.h" +#include "base/memory/ptr_util.h" +#include "base/strings/strcat.h" +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/sharing/fake_local_device_info_provider.h" +#include "chrome/browser/sharing/sharing_constants.h" +#include "chrome/browser/sharing/sharing_device_info.h" +#include "chrome/browser/sharing/sharing_fcm_handler.h" +#include "chrome/browser/sharing/sharing_fcm_sender.h" +#include "chrome/browser/sharing/sharing_service.h" +#include "chrome/browser/sharing/sharing_service_factory.h" +#include "chrome/browser/sharing/sharing_sync_preference.h" +#include "chrome/browser/sharing/vapid_key_manager.h" +#include "chrome/test/base/testing_profile.h" +#include "components/gcm_driver/fake_gcm_driver.h" +#include "components/gcm_driver/instance_id/instance_id_driver.h" +#include "components/sync/protocol/sync.pb.h" +#include "components/sync_device_info/fake_device_info_tracker.h" +#include "components/sync_preferences/testing_pref_service_syncable.h" +#include "content/public/test/test_browser_thread_bundle.h" +#include "content/public/test/web_contents_tester.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" + +using namespace testing; +using namespace instance_id; + +namespace { + +const char kText[] = "Text to be copied"; +const char kExpectedText[] = "Text to be copied"; +const char kReceiverGuid[] = "test_receiver_guid"; +const char kReceiverName[] = "test_receiver_name"; + +class MockSharingService : public SharingService { + public: + explicit MockSharingService(std::unique_ptr<SharingFCMHandler> fcm_handler) + : SharingService(/* sync_prefs= */ nullptr, + /* vapid_key_manager= */ nullptr, + /* sharing_device_registration= */ nullptr, + /* fcm_sender= */ nullptr, + std::move(fcm_handler), + /* gcm_driver= */ nullptr, + /* device_info_tracker= */ nullptr, + /* local_device_info_provider= */ nullptr, + /* sync_service */ nullptr) {} + + ~MockSharingService() override = default; + + MOCK_CONST_METHOD1(GetDeviceCandidates, + std::vector<SharingDeviceInfo>(int required_capabilities)); + + MOCK_METHOD4(SendMessageToDevice, + void(const std::string& device_guid, + base::TimeDelta time_to_live, + chrome_browser_sharing::SharingMessage message, + SharingService::SendMessageCallback callback)); +}; + +class SharedClipboardUiControllerTest : public testing::Test { + public: + SharedClipboardUiControllerTest() = default; + + void SetUp() override { + web_contents_ = + content::WebContentsTester::CreateTestWebContents(&profile_, nullptr); + SharingServiceFactory::GetInstance()->SetTestingFactory( + &profile_, base::BindRepeating([](content::BrowserContext* context) + -> std::unique_ptr<KeyedService> { + return std::make_unique<NiceMock<MockSharingService>>( + std::make_unique<SharingFCMHandler>(nullptr, nullptr)); + })); + SharingDeviceInfo sharing_device_info( + kReceiverGuid, base::UTF8ToUTF16(kReceiverName), + sync_pb::SyncEnums::TYPE_PHONE, base::Time::Now(), 1); + SharedClipboardUiController::DeviceSelected( + web_contents_.get(), base::UTF8ToUTF16(kText), sharing_device_info); + shared_clipboard_sharing_dialog_controller_ = + SharedClipboardUiController::GetOrCreateFromWebContents( + web_contents_.get()); + } + + protected: + NiceMock<MockSharingService>* service() { + return static_cast<NiceMock<MockSharingService>*>( + SharingServiceFactory::GetForBrowserContext(&profile_)); + } + + content::TestBrowserThreadBundle thread_bundle_; + TestingProfile profile_; + std::unique_ptr<content::WebContents> web_contents_; + SharedClipboardUiController* shared_clipboard_sharing_dialog_controller_ = + nullptr; +}; +} // namespace + +MATCHER_P(ProtoEquals, message, "") { + std::string expected_serialized, actual_serialized; + message.SerializeToString(&expected_serialized); + arg.SerializeToString(&actual_serialized); + return expected_serialized == actual_serialized; +} + +// Check the call to sharing service when a device is chosen. +TEST_F(SharedClipboardUiControllerTest, OnDeviceChosen) { + SharingDeviceInfo sharing_device_info( + kReceiverGuid, base::UTF8ToUTF16(kReceiverName), + sync_pb::SyncEnums::TYPE_PHONE, base::Time::Now(), 1); + chrome_browser_sharing::SharingMessage sharing_message; + sharing_message.mutable_shared_clipboard_message()->set_text(kExpectedText); + EXPECT_CALL(*service(), + SendMessageToDevice(Eq(kReceiverGuid), Eq(kSharingMessageTTL), + ProtoEquals(sharing_message), _)); + shared_clipboard_sharing_dialog_controller_->OnDeviceChosen( + sharing_device_info); +} + +// Check the call to sharing service to get all synced devices. +TEST_F(SharedClipboardUiControllerTest, GetSyncedDevices) { + EXPECT_CALL(*service(), GetDeviceCandidates(Eq(static_cast<int>( + SharingDeviceCapability::kNone)))); + shared_clipboard_sharing_dialog_controller_->GetSyncedDevices(); +}
diff --git a/chrome/browser/sharing/sharing_constants.cc b/chrome/browser/sharing/sharing_constants.cc index 068ae34..d5c7a197 100644 --- a/chrome/browser/sharing/sharing_constants.cc +++ b/chrome/browser/sharing/sharing_constants.cc
@@ -51,3 +51,12 @@ // is the first delay once we start exponential backoff. false, }; + +constexpr base::TimeDelta kSharingMessageTTL = base::TimeDelta::FromSeconds(10); + +constexpr int kMaxDevicesShown = 10; + +constexpr int kSubMenuFirstDeviceCommandId = 2150; + +constexpr int kSubMenuLastDeviceCommandId = + kSubMenuFirstDeviceCommandId + kMaxDevicesShown - 1;
diff --git a/chrome/browser/sharing/sharing_constants.h b/chrome/browser/sharing/sharing_constants.h index 6245ea81..603167a 100644 --- a/chrome/browser/sharing/sharing_constants.h +++ b/chrome/browser/sharing/sharing_constants.h
@@ -29,4 +29,16 @@ // Backoff policy for registration retry. extern const net::BackoffEntry::Policy kRetryBackoffPolicy; +// Time limit for message expiration. +extern const base::TimeDelta kSharingMessageTTL; + +// Maximum number of devices to be shown in dialog and context menu. +extern const int kMaxDevicesShown; + +// Command id for first device shown in submenu. +extern const int kSubMenuFirstDeviceCommandId; + +// Command id for last device shown in submenu. +extern const int kSubMenuLastDeviceCommandId; + #endif // CHROME_BROWSER_SHARING_SHARING_CONSTANTS_H_
diff --git a/chrome/browser/signin/e2e_tests/demo_signin_e2e_test.cc b/chrome/browser/signin/e2e_tests/demo_signin_e2e_test.cc new file mode 100644 index 0000000..735493e --- /dev/null +++ b/chrome/browser/signin/e2e_tests/demo_signin_e2e_test.cc
@@ -0,0 +1,84 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/path_service.h" +#include "base/strings/stringprintf.h" +#include "chrome/browser/signin/e2e_tests/test_accounts_util.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/tabs/tab_strip_model_observer.h" +#include "chrome/browser/ui/webui/signin/login_ui_test_utils.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "content/public/test/browser_test_utils.h" +#include "content/public/test/test_utils.h" +#include "net/dns/mock_host_resolver.h" +#include "ui/compositor/scoped_animation_duration_scale_mode.h" + +using signin::test::TestAccount; +using signin::test::TestAccountsUtil; + +base::FilePath::StringPieceType kTestAccountFilePath = FILE_PATH_LITERAL( + "chrome/browser/internal/resources/signin/test_accounts.json"); + +const char* kRunLiveTestFlag = "run-live-tests"; + +class DemoSignInTest : public InProcessBrowserTest { + protected: + void SetUpInProcessBrowserTestFixture() override { + // Whitelists a bunch of hosts. + host_resolver()->AllowDirectLookup("*.google.com"); + host_resolver()->AllowDirectLookup("*.geotrust.com"); + host_resolver()->AllowDirectLookup("*.gstatic.com"); + host_resolver()->AllowDirectLookup("*.googleapis.com"); + + InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); + } + + void SetUp() override { + // Only run live tests when specified. + auto* cmd_line = base::CommandLine::ForCurrentProcess(); + if (!cmd_line->HasSwitch(kRunLiveTestFlag)) { + GTEST_SKIP(); + } + + base::FilePath root_path; + base::PathService::Get(base::BasePathKey::DIR_SOURCE_ROOT, &root_path); + base::FilePath config_path = + base::MakeAbsoluteFilePath(root_path.Append(kTestAccountFilePath)); + test_accounts_.Init(config_path); + InProcessBrowserTest::SetUp(); + } + + const TestAccountsUtil* GetTestAccountsUtil() const { + return &test_accounts_; + } + + private: + TestAccountsUtil test_accounts_; +}; + +IN_PROC_BROWSER_TEST_F(DemoSignInTest, SimpleSignInFlow) { + // Always disable animation for stability. + ui::ScopedAnimationDurationScaleMode disable_animation( + ui::ScopedAnimationDurationScaleMode::ZERO_DURATION); + GURL url("chrome://settings"); + AddTabAtIndex(0, url, ui::PageTransition::PAGE_TRANSITION_TYPED); + auto* settings_tab = browser()->tab_strip_model()->GetActiveWebContents(); + EXPECT_TRUE(content::ExecuteScript( + settings_tab, + "testElement = document.createElement('settings-sync-account-control');" + "document.body.appendChild(testElement);" + "testElement.$$('#sign-in').click();")); + TestAccount ta; + CHECK(GetTestAccountsUtil()->GetAccount("TEST_ACCOUNT_1", ta)); + login_ui_test_utils::ExecuteJsToSigninInSigninFrame(browser(), ta.user, + ta.password); + login_ui_test_utils::DismissSyncConfirmationDialog( + browser(), base::TimeDelta::FromSeconds(3)); + GURL signin("chrome://signin-internals"); + AddTabAtIndex(0, signin, ui::PageTransition::PAGE_TRANSITION_TYPED); + auto* signin_tab = browser()->tab_strip_model()->GetActiveWebContents(); + std::string query_str = base::StringPrintf( + "document.body.innerHTML.indexOf('%s');", ta.user.c_str()); + EXPECT_GT(content::EvalJs(signin_tab, query_str).ExtractInt(), 0); +}
diff --git a/chrome/browser/signin/e2e_tests/test_accounts_util.cc b/chrome/browser/signin/e2e_tests/test_accounts_util.cc new file mode 100644 index 0000000..ff37129 --- /dev/null +++ b/chrome/browser/signin/e2e_tests/test_accounts_util.cc
@@ -0,0 +1,74 @@ +// Copyright 2019 The Chromium 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/signin/e2e_tests/test_accounts_util.h" + +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/json/json_file_value_serializer.h" +#include "base/json/json_reader.h" +#include "build/build_config.h" + +using base::Value; + +namespace signin { +namespace test { + +#if defined(OS_WIN) +std::string kPlatform = "win"; +#elif defined(OS_MACOSX) +std::string kPlatform = "mac"; +#elif defined(OS_LINUX) +std::string kPlatform = "linux"; +#elif defined(OS_CHROMEOS) +std::string kPlatform = "chromeos"; +#elif defined(OS_ANDROID) +std::string kPlatform = "android"; +#else +std::string kPlatform = "all_platform"; +#endif + +TestAccountsUtil::TestAccountsUtil() = default; +TestAccountsUtil::~TestAccountsUtil() = default; + +bool TestAccountsUtil::Init(const base::FilePath& config_path) { + int error_code = 0; + std::string error_str; + JSONFileValueDeserializer deserializer(config_path); + std::unique_ptr<Value> content_json = + deserializer.Deserialize(&error_code, &error_str); + CHECK(error_code == 0) << "Error reading json file. Error code: " + << error_code << " " << error_str; + CHECK(content_json); + + // Only store platform specific users. If an account does not have + // platform specific user, try to use all_platform user. + for (auto account : content_json->DictItems()) { + const Value* platform_account = account.second.FindDictKey(kPlatform); + if (platform_account == nullptr) { + platform_account = account.second.FindDictKey("all_platform"); + if (platform_account == nullptr) { + continue; + } + } + TestAccount ta(*(platform_account->FindStringKey("user")), + *(platform_account->FindStringKey("password"))); + all_accounts_.insert( + std::pair<std::string, TestAccount>(account.first, ta)); + } + return true; +} + +bool TestAccountsUtil::GetAccount(const std::string& name, + TestAccount& out_account) const { + auto it = all_accounts_.find(name); + if (it == all_accounts_.end()) { + return false; + } + out_account = it->second; + return true; +} + +} // namespace test +} // namespace signin
diff --git a/chrome/browser/signin/e2e_tests/test_accounts_util.h b/chrome/browser/signin/e2e_tests/test_accounts_util.h new file mode 100644 index 0000000..22f6bf5 --- /dev/null +++ b/chrome/browser/signin/e2e_tests/test_accounts_util.h
@@ -0,0 +1,44 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_SIGNIN_E2E_TESTS_TEST_ACCOUNTS_UTIL_H_ +#define CHROME_BROWSER_SIGNIN_E2E_TESTS_TEST_ACCOUNTS_UTIL_H_ + +#include <map> +#include <string> +#include "base/macros.h" + +namespace base { +class FilePath; +} + +namespace signin { +namespace test { + +struct TestAccount { + std::string user; + std::string password; + TestAccount() = default; + TestAccount(const std::string& user, const std::string& password) { + this->user = user; + this->password = password; + } +}; + +class TestAccountsUtil { + public: + TestAccountsUtil(); + virtual ~TestAccountsUtil(); + bool Init(const base::FilePath& config_path); + bool GetAccount(const std::string& name, TestAccount& out_account) const; + + private: + std::map<std::string, TestAccount> all_accounts_; + DISALLOW_COPY_AND_ASSIGN(TestAccountsUtil); +}; + +} // namespace test +} // namespace signin + +#endif // CHROME_BROWSER_SIGNIN_E2E_TESTS_TEST_ACCOUNTS_UTIL_H_
diff --git a/chrome/browser/signin/e2e_tests/test_accounts_util_unittest.cc b/chrome/browser/signin/e2e_tests/test_accounts_util_unittest.cc new file mode 100644 index 0000000..7b63dd6 --- /dev/null +++ b/chrome/browser/signin/e2e_tests/test_accounts_util_unittest.cc
@@ -0,0 +1,100 @@ +// Copyright 2019 The Chromium 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/signin/e2e_tests/test_accounts_util.h" +#include "base/files/file_util.h" +#include "testing/gtest/include/gtest/gtest.h" + +using base::FilePath; + +namespace signin { +namespace test { + +class TestAccountsUtilTest : public testing::Test {}; + +FilePath WriteContentToTemporaryFile(const char* contents, + unsigned int length) { + FilePath tmp_file; + CHECK(base::CreateTemporaryFile(&tmp_file)); + unsigned int bytes_written = base::WriteFile(tmp_file, contents, length); + CHECK_EQ(bytes_written, length); + return tmp_file; +} + +TEST(TestAccountsUtilTest, ParsingJson) { + const char contents[] = + "{ \n" + " \"TEST_ACCOUNT_1\": {\n" + " \"win\": {\n" + " \"user\": \"user1\",\n" + " \"password\": \"pwd1\"\n" + " }\n" + " }\n" + "}"; + FilePath tmp_file = + WriteContentToTemporaryFile(contents, sizeof(contents) - 1); + TestAccountsUtil util; + util.Init(tmp_file); +} + +TEST(TestAccountsUtilTest, GetAccountForPlatformSpecific) { + const char contents[] = + "{ \n" + " \"TEST_ACCOUNT_1\": {\n" + " \"win\": {\n" + " \"user\": \"user1\",\n" + " \"password\": \"pwd1\"\n" + " },\n" + " \"mac\": {\n" + " \"user\": \"user1\",\n" + " \"password\": \"pwd1\"\n" + " },\n" + " \"linux\": {\n" + " \"user\": \"user1\",\n" + " \"password\": \"pwd1\"\n" + " },\n" + " \"chromeos\": {\n" + " \"user\": \"user1\",\n" + " \"password\": \"pwd1\"\n" + " },\n" + " \"android\": {\n" + " \"user\": \"user1\",\n" + " \"password\": \"pwd1\"\n" + " }\n" + " }\n" + "}"; + FilePath tmp_file = + WriteContentToTemporaryFile(contents, sizeof(contents) - 1); + TestAccountsUtil util; + util.Init(tmp_file); + TestAccount ta; + bool ret = util.GetAccount("TEST_ACCOUNT_1", ta); + ASSERT_TRUE(ret); + ASSERT_EQ(ta.user, "user1"); + ASSERT_EQ(ta.password, "pwd1"); +} + +TEST(TestAccountsUtilTest, GetAccountForAllPlatform) { + const char contents[] = + "{ \n" + " \"TEST_ACCOUNT_1\": {\n" + " \"all_platform\": {\n" + " \"user\": \"user_allplatform\",\n" + " \"password\": \"pwd_allplatform\"\n" + " }\n" + " }\n" + "}"; + FilePath tmp_file = + WriteContentToTemporaryFile(contents, sizeof(contents) - 1); + TestAccountsUtil util; + util.Init(tmp_file); + TestAccount ta; + bool ret = util.GetAccount("TEST_ACCOUNT_1", ta); + ASSERT_TRUE(ret); + ASSERT_EQ(ta.user, "user_allplatform"); + ASSERT_EQ(ta.password, "pwd_allplatform"); +} + +} // namespace test +} // namespace signin
diff --git a/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc b/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc index a2faab8..49528cb07 100644 --- a/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc +++ b/chrome/browser/site_isolation/chrome_site_per_process_browsertest.cc
@@ -1775,3 +1775,59 @@ destroyed_watcher.Wait(); EXPECT_EQ(first_web_contents, tab_strip_model->GetActiveWebContents()); } + +// Test mouse down activation notification with browser verification. +IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessTest, + UserActivationBrowserVerificationSameOriginSite) { + if (!base::FeatureList::IsEnabled(features::kUserActivationV2)) + return; + base::test::ScopedFeatureList scoped_feature_list_; + scoped_feature_list_.InitAndEnableFeature( + features::kBrowserVerifiedUserActivation); + + // Start on a page a.com with same-origin iframe on a.com and cross-origin + // iframe b.com. + GURL main_url(embedded_test_server()->GetURL( + "a.com", "/cross_site_iframe_factory.html?a(a(b))")); + ui_test_utils::NavigateToURL(browser(), main_url); + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + content::RenderFrameHost* frame_a = + ChildFrameAt(web_contents->GetMainFrame(), 0); + content::RenderFrameHost* frame_b = ChildFrameAt(frame_a, 0); + + // Activate subframe a. Using frame_b's bound to find a point in subframe a. + gfx::Rect bounds = frame_b->GetView()->GetViewBounds(); + content::SimulateMouseClickAt(web_contents, 0 /* modifiers */, + blink::WebMouseEvent::Button::kLeft, + gfx::Point(bounds.x() - 5, bounds.y() - 5)); + + // Add a popup observer. + content::TestNavigationObserver popup_observer(nullptr); + popup_observer.StartWatchingNewWebContents(); + + // Try opening popups from frame_b and root frame. + GURL popup_url(embedded_test_server()->GetURL("popup.com", "/")); + EXPECT_TRUE(ExecuteScriptWithoutUserGesture( + frame_b, content::JsReplace("window.w = window.open($1 + 'title1.html');", + popup_url))); + EXPECT_TRUE(ExecuteScriptWithoutUserGesture( + web_contents, + content::JsReplace("window.w = window.open($1 + 'title2.html');", + popup_url))); + + // Wait and check that only one popup has opened. + popup_observer.Wait(); + EXPECT_EQ(2, browser()->tab_strip_model()->count()); + + content::WebContents* popup = + browser()->tab_strip_model()->GetActiveWebContents(); + EXPECT_EQ(embedded_test_server()->GetURL("popup.com", "/title2.html"), + popup->GetLastCommittedURL()); + EXPECT_NE(popup, web_contents); + + // Confirm that only the root_frame opened the popup. + EXPECT_EQ(true, content::EvalJs(web_contents, "!!window.w")); + + EXPECT_EQ(false, content::EvalJs(frame_b, "!!window.w")); +}
diff --git a/chrome/browser/supervised_user/logged_in_user_mixin.cc b/chrome/browser/supervised_user/logged_in_user_mixin.cc new file mode 100644 index 0000000..cb69584 --- /dev/null +++ b/chrome/browser/supervised_user/logged_in_user_mixin.cc
@@ -0,0 +1,56 @@ +// Copyright 2019 The Chromium 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/supervised_user/logged_in_user_mixin.h" + +#include "chromeos/login/auth/user_context.h" + +namespace chromeos { + +namespace { + +constexpr char kTestUserName[] = "user@gmail.com"; +constexpr char kTestUserGaiaId[] = "user"; + +user_manager::UserType ConvertUserType(LoggedInUserMixin::LogInType type) { + switch (type) { + case LoggedInUserMixin::LogInType::kChild: + return user_manager::USER_TYPE_CHILD; + case LoggedInUserMixin::LogInType::kRegular: + return user_manager::USER_TYPE_REGULAR; + } +} + +} // namespace + +LoggedInUserMixin::LoggedInUserMixin( + InProcessBrowserTestMixinHost* mixin_host, + LogInType type, + net::EmbeddedTestServer* embedded_test_server) + : user_(AccountId::FromUserEmailGaiaId(kTestUserName, kTestUserGaiaId), + ConvertUserType(type)), + login_manager_(mixin_host, {user_}), + policy_server_(mixin_host), + user_policy_(mixin_host, user_.account_id, &policy_server_), + embedded_test_server_setup_(mixin_host, embedded_test_server), + fake_gaia_(mixin_host, embedded_test_server) {} + +LoggedInUserMixin::~LoggedInUserMixin() = default; + +void LoggedInUserMixin::LogInUser() { + UserContext user_context = LoginManagerMixin::CreateDefaultUserContext(user_); + if (user_.user_type == user_manager::USER_TYPE_CHILD) { + fake_gaia_.SetupFakeGaiaForChildUser( + user_.account_id.GetUserEmail(), user_.account_id.GetGaiaId(), + FakeGaiaMixin::kFakeRefreshToken, false /*issue_any_scope_token*/); + } else { + fake_gaia_.SetupFakeGaiaForLogin(user_.account_id.GetUserEmail(), + user_.account_id.GetGaiaId(), + FakeGaiaMixin::kFakeRefreshToken); + } + user_context.SetRefreshToken(FakeGaiaMixin::kFakeRefreshToken); + login_manager_.LoginAndWaitForActiveSession(user_context); +} + +} // namespace chromeos
diff --git a/chrome/browser/supervised_user/logged_in_user_mixin.h b/chrome/browser/supervised_user/logged_in_user_mixin.h new file mode 100644 index 0000000..ddfcaf5 --- /dev/null +++ b/chrome/browser/supervised_user/logged_in_user_mixin.h
@@ -0,0 +1,47 @@ +// Copyright 2019 The Chromium 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_SUPERVISED_USER_LOGGED_IN_USER_MIXIN_H_ +#define CHROME_BROWSER_SUPERVISED_USER_LOGGED_IN_USER_MIXIN_H_ + +#include "base/macros.h" +#include "chrome/browser/chromeos/login/test/embedded_test_server_mixin.h" +#include "chrome/browser/chromeos/login/test/fake_gaia_mixin.h" +#include "chrome/browser/chromeos/login/test/local_policy_test_server_mixin.h" +#include "chrome/browser/chromeos/login/test/login_manager_mixin.h" +#include "chrome/browser/chromeos/login/test/user_policy_mixin.h" + +namespace chromeos { + +// Compound mixin class for child user browser tests. +// Supports logging in as regular or child accounts. +// Initiates other mixins required to log in users, sets up their user policies +// and gaia auth. +class LoggedInUserMixin { + public: + enum class LogInType { kRegular, kChild }; + + LoggedInUserMixin(InProcessBrowserTestMixinHost* host, + LogInType type, + net::EmbeddedTestServer* embedded_test_server); + ~LoggedInUserMixin(); + + void LogInUser(); + + private: + LoginManagerMixin::TestUserInfo user_; + LoginManagerMixin login_manager_; + + LocalPolicyTestServerMixin policy_server_; + UserPolicyMixin user_policy_; + + EmbeddedTestServerSetupMixin embedded_test_server_setup_; + FakeGaiaMixin fake_gaia_; + + DISALLOW_COPY_AND_ASSIGN(LoggedInUserMixin); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_SUPERVISED_USER_LOGGED_IN_USER_MIXIN_H_
diff --git a/chrome/browser/supervised_user/supervised_user_test_base.h b/chrome/browser/supervised_user/supervised_user_test_base.h index 2a644cd..02b196d7 100644 --- a/chrome/browser/supervised_user/supervised_user_test_base.h +++ b/chrome/browser/supervised_user/supervised_user_test_base.h
@@ -9,10 +9,12 @@ #include "chrome/browser/supervised_user/supervised_user_service.h" #include "chrome/browser/ui/browser.h" -// Base class for child user browser tests. -// Inherit from this class if logging in as child user is required for tests. -// This class inherits from LoginPolicyTestBase because signing in a child -// account requires fetching user policies. +// TODO (crbug.com/990909): Deprecate this class in favor of +// LoggedInUserMixin. +// Base class for child user browser tests. Inherit from +// this class if logging in as child user is required for tests. This class +// inherits from LoginPolicyTestBase because signing in a child account requires +// fetching user policies. class SupervisedUserTestBase : public policy::LoginPolicyTestBase { public: enum class LogInType { kRegular, kChild };
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc index cfe9b3a4..bb6ba40e 100644 --- a/chrome/browser/themes/browser_theme_pack.cc +++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -62,7 +62,7 @@ // change default theme assets, if you need themes to recreate their generated // images (which are cached), or if you changed how missing values are // generated. -const int kThemePackVersion = 66; +const int kThemePackVersion = 67; // IDs that are in the DataPack won't clash with the positive integer // uint16_t. kHeaderID should always have the maximum value because we want the
diff --git a/chrome/browser/ui/app_list/arc/arc_app_test.cc b/chrome/browser/ui/app_list/arc/arc_app_test.cc index fc56a90..86f7877 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_test.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_test.cc
@@ -227,6 +227,7 @@ arc_play_store_enabled_preference_handler_.reset(); arc_session_manager_.reset(); arc_service_manager_.reset(); + arc::ResetArcAllowedCheckForTesting(profile_); if (dbus_thread_manager_initialized_) { // DBusThreadManager may be initialized from other testing utility, // such as ash::AshTestHelper::SetUp(), so Shutdown() only when
diff --git a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc index c251e54..7247885 100644 --- a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc +++ b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
@@ -69,12 +69,15 @@ #include "extensions/buildflags/buildflags.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/events/keycodes/dom/dom_code.h" #include "ui/events/keycodes/dom/keycode_converter.h" -using content::WebContents; using content::NativeWebKeyboardEvent; +using content::WebContents; +using testing::_; +using testing::Return; namespace { @@ -455,6 +458,9 @@ protected: void SetUpInProcessBrowserTestFixture() override { + EXPECT_CALL(policy_provider_, IsInitializationComplete(_)) + .WillRepeatedly(Return(true)); + policy::PolicyMap policy_map; policy_map.Set(policy::key::kAllowPopupsDuringPageUnload,
diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk.cc b/chrome/browser/ui/libgtkui/native_theme_gtk.cc index 9cdb8180..4edc178 100644 --- a/chrome/browser/ui/libgtkui/native_theme_gtk.cc +++ b/chrome/browser/ui/libgtkui/native_theme_gtk.cc
@@ -407,6 +407,8 @@ ::tolower); set_high_contrast(theme_name.find("high") != std::string::npos && theme_name.find("contrast") != std::string::npos); + + NotifyObservers(); } SkColor NativeThemeGtk::GetSystemColor(ColorId color_id,
diff --git a/chrome/browser/ui/startup/bad_flags_prompt.cc b/chrome/browser/ui/startup/bad_flags_prompt.cc index 122a930..88cad1e0 100644 --- a/chrome/browser/ui/startup/bad_flags_prompt.cc +++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
@@ -12,6 +12,7 @@ #include "base/environment.h" #include "base/feature_list.h" #include "base/files/file_path.h" +#include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "base/trace_event/memory_dump_manager.h" #include "build/build_config.h" @@ -168,6 +169,18 @@ false); } +#if !defined(OS_ANDROID) +void ShowBadEnvVarsInfoBar(content::WebContents* web_contents, + int message_id, + base::StringPiece env_var) { + SimpleAlertInfoBarDelegate::Create( + InfoBarService::FromWebContents(web_contents), + infobars::InfoBarDelegate::BAD_FLAGS_INFOBAR_DELEGATE, nullptr, + l10n_util::GetStringFUTF16(message_id, base::ASCIIToUTF16(env_var)), + false); +} +#endif // OS_ANDROID + } // namespace void ShowBadFlagsPrompt(content::WebContents* web_contents) { @@ -183,12 +196,12 @@ // Check for the environment variable that triggers the same behavior as the // network::switches::kSSLKeyLogFile flag. - const char kSSLKeyLogFileVar[] = "SSLKEYLOGFILE"; + static constexpr base::StringPiece kSSLKeyLogFileVar("SSLKEYLOGFILE"); std::unique_ptr<base::Environment> env(base::Environment::Create()); if (env->HasVar(kSSLKeyLogFileVar)) { - ShowBadFlagsInfoBar(web_contents, - IDS_BAD_ENVIRONMENT_VARIABLES_WARNING_MESSAGE, - kSSLKeyLogFileVar); + ShowBadEnvVarsInfoBar(web_contents, + IDS_BAD_ENVIRONMENT_VARIABLES_WARNING_MESSAGE, + kSSLKeyLogFileVar); return; } #endif // OS_ANDROID
diff --git a/chrome/browser/ui/views/native_file_system/native_file_system_permission_view_browsertest.cc b/chrome/browser/ui/views/native_file_system/native_file_system_permission_view_browsertest.cc index d7ff53e..2e7aa6f 100644 --- a/chrome/browser/ui/views/native_file_system/native_file_system_permission_view_browsertest.cc +++ b/chrome/browser/ui/views/native_file_system/native_file_system_permission_view_browsertest.cc
@@ -17,6 +17,7 @@ // DialogBrowserTest: void ShowUi(const std::string& name) override { base::FilePath path; + url::Origin origin = kTestOrigin; bool is_directory = false; if (name == "LongFileName") { path = base::FilePath(FILE_PATH_LITERAL( @@ -24,13 +25,26 @@ } else if (name == "Folder") { path = base::FilePath(FILE_PATH_LITERAL("/bar/MyProject")); is_directory = true; + } else if (name == "LongOrigin") { + path = base::FilePath(FILE_PATH_LITERAL("/foo/README.txt")); + origin = + url::Origin::Create(GURL("https://" + "longextendedsubdomainnamewithoutdashesinord" + "ertotestwordwrapping.appspot.com")); + } else if (name == "FileOrigin") { + path = base::FilePath(FILE_PATH_LITERAL("/foo/README.txt")); + origin = url::Origin::Create(GURL("file:///foo/bar/bla")); + } else if (name == "ExtensionOrigin") { + path = base::FilePath(FILE_PATH_LITERAL("/foo/README.txt")); + origin = url::Origin::Create(GURL( + "chrome-extension://ehoadneljpdggcbbknedodolkkjodefl/capture.html")); } else if (name == "default") { path = base::FilePath(FILE_PATH_LITERAL("/foo/README.txt")); } else { NOTREACHED() << "Unimplemented test: " << name; } widget_ = NativeFileSystemPermissionView::ShowDialog( - kTestOrigin, path, is_directory, + origin, path, is_directory, base::BindLambdaForTesting([&](PermissionAction result) { callback_called_ = true; callback_result_ = result; @@ -93,3 +107,18 @@ IN_PROC_BROWSER_TEST_F(NativeFileSystemPermissionViewTest, InvokeUi_Folder) { ShowAndVerifyUi(); } + +IN_PROC_BROWSER_TEST_F(NativeFileSystemPermissionViewTest, + InvokeUi_LongOrigin) { + ShowAndVerifyUi(); +} + +IN_PROC_BROWSER_TEST_F(NativeFileSystemPermissionViewTest, + InvokeUi_FileOrigin) { + ShowAndVerifyUi(); +} + +IN_PROC_BROWSER_TEST_F(NativeFileSystemPermissionViewTest, + InvokeUi_ExtensionOrigin) { + ShowAndVerifyUi(); +}
diff --git a/chrome/browser/ui/views/native_file_system/native_file_system_usage_bubble_view_browsertest.cc b/chrome/browser/ui/views/native_file_system/native_file_system_usage_bubble_view_browsertest.cc index 0fd7a8c..b5cda49 100644 --- a/chrome/browser/ui/views/native_file_system/native_file_system_usage_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/native_file_system/native_file_system_usage_bubble_view_browsertest.cc
@@ -21,6 +21,7 @@ void ShowUi(const std::string& name) override { NativeFileSystemUsageBubbleView::Usage usage; + url::Origin origin = kTestOrigin; if (name == "SingleWritableFile") { usage.writable_files.emplace_back( FILE_PATH_LITERAL("/foo/bar/Shapes.sketch")); @@ -64,6 +65,13 @@ usage.writable_directories.emplace_back( FILE_PATH_LITERAL("/la/asdf/Processing")); usage.writable_directories.emplace_back(FILE_PATH_LITERAL("/baz/Images")); + } else if (name == "LongOrigin") { + usage.writable_files.emplace_back( + FILE_PATH_LITERAL("/foo/bar/Shapes.sketch")); + usage.writable_files.emplace_back(FILE_PATH_LITERAL("/bla/README.txt")); + origin = url::Origin::Create(GURL( + "https://" + "some-really-long-origin-chrome-test-foo-bar-sample.appspot.com")); } else if (name == "default") { usage.readable_directories.emplace_back( FILE_PATH_LITERAL("/home/me/Images")); @@ -81,7 +89,7 @@ } NativeFileSystemUsageBubbleView::ShowBubble( - browser()->tab_strip_model()->GetActiveWebContents(), kTestOrigin, + browser()->tab_strip_model()->GetActiveWebContents(), origin, std::move(usage)); } @@ -134,3 +142,8 @@ InvokeUi_ReadableAndWritableFolders) { ShowAndVerifyUi(); } + +IN_PROC_BROWSER_TEST_F(NativeFileSystemUsageBubbleViewTest, + InvokeUi_LongOrigin) { + ShowAndVerifyUi(); +}
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc index 7d14426..ab1a485 100644 --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -3156,6 +3156,20 @@ void AddSecurityKeysStrings(content::WebUIDataSource* html_source) { static constexpr LocalizedString kSecurityKeysStrings[] = { + {"securityKeysBioEnrollmentDialogTitle", + IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_DIALOG_TITLE}, + {"securityKeysBioEnrollmentEnrollingLabel", + IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_ENROLLING_LABEL}, + {"securityKeysBioEnrollmentLabel", + IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_LABEL}, + {"securityKeysBioEnrollmentNoEnrollments", + IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_NO_ENROLLMENTS}, + {"securityKeysBioEnrollmentPinPrompt", + IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_PIN_PROMPT}, + {"securityKeysBioEnrollmentSubpageDescription", + IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_SUBPAGE_DESCRIPTION}, + {"securityKeysBioEnrollmentTouch", + IDS_SETTINGS_SECURITY_KEYS_BIO_ENROLLMENT_TOUCH}, {"securityKeysPINTooShort", IDS_SETTINGS_SECURITY_KEYS_PIN_ERROR_TOO_SHORT}, {"securityKeysConfirmPIN", IDS_SETTINGS_SECURITY_KEYS_CONFIRM_PIN}, @@ -3229,24 +3243,25 @@ }; AddLocalizedStringsBulk(html_source, kSecurityKeysStrings, base::size(kSecurityKeysStrings)); - + bool win_native_api_available = false; +#if defined(OS_WIN) + win_native_api_available = + base::FeatureList::IsEnabled(device::kWebAuthUseNativeWinApi) && + device::WinWebAuthnApi::GetDefault()->IsAvailable(); +#endif html_source->AddBoolean( "enableSecurityKeysSubpage", - base::FeatureList::IsEnabled(device::kWebAuthPINSupport) -#if defined(OS_WIN) - && (!base::FeatureList::IsEnabled(device::kWebAuthUseNativeWinApi) || - !device::WinWebAuthnApi::GetDefault()->IsAvailable()) -#endif - ); + base::FeatureList::IsEnabled(device::kWebAuthPINSupport) && + !win_native_api_available); html_source->AddBoolean( "enableSecurityKeysCredentialManagement", base::FeatureList::IsEnabled(device::kWebAuthPINSupport) && - base::FeatureList::IsEnabled(device::kWebAuthCredentialManagement) -#if defined(OS_WIN) - && (!base::FeatureList::IsEnabled(device::kWebAuthUseNativeWinApi) || - !device::WinWebAuthnApi::GetDefault()->IsAvailable()) -#endif - ); + base::FeatureList::IsEnabled(device::kWebAuthCredentialManagement) && + !win_native_api_available); + html_source->AddBoolean( + "enableSecurityKeysBioEnrollment", + base::FeatureList::IsEnabled(device::kWebAuthBiometricEnrollment) && + !win_native_api_available); } } // namespace
diff --git a/chrome/browser/ui/webui/settings/settings_security_key_handler.cc b/chrome/browser/ui/webui/settings/settings_security_key_handler.cc index 0215a9b..90c5bd1 100644 --- a/chrome/browser/ui/webui/settings/settings_security_key_handler.cc +++ b/chrome/browser/ui/webui/settings/settings_security_key_handler.cc
@@ -11,11 +11,14 @@ #include "base/optional.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" +#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" +#include "chrome/browser/ui/webui/settings/settings_security_key_handler.h" #include "chrome/grit/generated_resources.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/system_connector.h" #include "content/public/browser/web_ui.h" #include "content/public/common/service_manager_connection.h" +#include "device/fido/bio/enrollment_handler.h" #include "device/fido/credential_management.h" #include "device/fido/credential_management_handler.h" #include "device/fido/fido_discovery_factory.h" @@ -515,4 +518,221 @@ base::Value(l10n_util::GetStringUTF8(std::move(error)))); } +SecurityKeysBioEnrollmentHandler::SecurityKeysBioEnrollmentHandler() = default; +SecurityKeysBioEnrollmentHandler::~SecurityKeysBioEnrollmentHandler() = default; + +void SecurityKeysBioEnrollmentHandler::RegisterMessages() { + web_ui()->RegisterMessageCallback( + "securityKeyBioEnrollStart", + base::BindRepeating(&SecurityKeysBioEnrollmentHandler::HandleStart, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "securityKeyBioEnrollProvidePIN", + base::BindRepeating(&SecurityKeysBioEnrollmentHandler::HandleProvidePIN, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "securityKeyBioEnrollEnumerate", + base::BindRepeating(&SecurityKeysBioEnrollmentHandler::HandleEnumerate, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "securityKeyBioEnrollStartEnrolling", + base::BindRepeating( + &SecurityKeysBioEnrollmentHandler::HandleStartEnrolling, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "securityKeyBioEnrollCancel", + base::BindRepeating(&SecurityKeysBioEnrollmentHandler::HandleCancel, + base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "securityKeyBioEnrollClose", + base::BindRepeating( + &HandleClose, + base::BindRepeating(&SecurityKeysBioEnrollmentHandler::Close, + base::Unretained(this)))); +} + +void SecurityKeysBioEnrollmentHandler::Close() { + weak_factory_.InvalidateWeakPtrs(); + state_ = State::kNone; + discovery_factory_.reset(); + bio_.reset(); + callback_id_.clear(); + discovery_factory_.reset(); + provide_pin_cb_.Reset(); +} + +void SecurityKeysBioEnrollmentHandler::HandleStart( + const base::ListValue* args) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + DCHECK_EQ(state_, State::kNone); + DCHECK_EQ(1u, args->GetSize()); + + AllowJavascript(); + DCHECK(callback_id_.empty()); + + callback_id_ = args->GetList()[0].GetString(); + discovery_factory_ = std::make_unique<device::FidoDiscoveryFactory>(); + bio_ = std::make_unique<device::BioEnrollmentHandler>( + content::ServiceManagerConnection::GetForProcess()->GetConnector(), + supported_transports(), + base::BindOnce(&SecurityKeysBioEnrollmentHandler::OnReady, + weak_factory_.GetWeakPtr()), + base::BindOnce(&SecurityKeysBioEnrollmentHandler::OnError, + weak_factory_.GetWeakPtr()), + base::BindRepeating(&SecurityKeysBioEnrollmentHandler::OnGatherPIN, + weak_factory_.GetWeakPtr()), + discovery_factory_.get()); +} + +void SecurityKeysBioEnrollmentHandler::OnReady() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + DCHECK(bio_); + DCHECK(!callback_id_.empty()); + + ResolveJavascriptCallback(base::Value(std::move(callback_id_)), + base::Value()); +} + +void SecurityKeysBioEnrollmentHandler::OnError(device::FidoReturnCode code) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + state_ = State::kNone; + + int error; + switch (code) { + case device::FidoReturnCode::kSoftPINBlock: + error = IDS_SETTINGS_SECURITY_KEYS_PIN_SOFT_LOCK; + break; + case device::FidoReturnCode::kHardPINBlock: + error = IDS_SETTINGS_SECURITY_KEYS_PIN_HARD_LOCK; + break; + case device::FidoReturnCode::kAuthenticatorMissingBioEnrollment: + error = IDS_SETTINGS_SECURITY_KEYS_NO_BIOMETRIC_ENROLLMENT; + break; + case device::FidoReturnCode::kAuthenticatorMissingUserVerification: + error = IDS_SETTINGS_SECURITY_KEYS_CREDENTIAL_MANAGEMENT_NO_PIN; + break; + case device::FidoReturnCode::kAuthenticatorResponseInvalid: + error = IDS_SETTINGS_SECURITY_KEYS_CREDENTIAL_MANAGEMENT_ERROR; + break; + case device::FidoReturnCode::kSuccess: + error = IDS_SETTINGS_SECURITY_KEYS_CREDENTIAL_MANAGEMENT_REMOVED; + break; + default: + NOTREACHED(); + error = IDS_SETTINGS_SECURITY_KEYS_CREDENTIAL_MANAGEMENT_ERROR; + break; + } + + FireWebUIListener("security-keys-bio-enroll-error", + base::Value(l10n_util::GetStringUTF8(error))); + + // If |callback_id_| is not empty, there is an ongoing operation, + // which means there is an unresolved Promise. Reject it so that + // it isn't leaked. + if (!callback_id_.empty()) { + RejectJavascriptCallback(base::Value(std::move(callback_id_)), + base::Value()); + } +} + +void SecurityKeysBioEnrollmentHandler::OnGatherPIN( + int64_t retries, + base::OnceCallback<void(std::string)> cb) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + DCHECK(!callback_id_.empty()); + + provide_pin_cb_ = std::move(cb); + + ResolveJavascriptCallback(base::Value(std::move(callback_id_)), + base::Value(static_cast<int>(retries))); +} + +void SecurityKeysBioEnrollmentHandler::HandleProvidePIN( + const base::ListValue* args) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + DCHECK_EQ(2u, args->GetSize()); + + callback_id_ = args->GetList()[0].GetString(); + std::move(provide_pin_cb_).Run(args->GetList()[1].GetString()); +} + +void SecurityKeysBioEnrollmentHandler::HandleEnumerate( + const base::ListValue* args) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + DCHECK_EQ(1u, args->GetSize()); + + callback_id_ = args->GetList()[0].GetString(); + bio_->EnumerateTemplates( + base::BindOnce(&SecurityKeysBioEnrollmentHandler::OnHaveEnrollments, + weak_factory_.GetWeakPtr())); +} + +void SecurityKeysBioEnrollmentHandler::OnHaveEnrollments( + device::CtapDeviceResponseCode code, + base::Optional<std::map<std::vector<uint8_t>, std::string>> enrollments) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + base::Value::ListStorage list; + if (enrollments) { + for (const auto& enrollment : *enrollments) { + base::DictionaryValue elem; + elem.SetStringKey("name", std::move(enrollment.second)); + elem.SetStringKey("id", base::HexEncode(enrollment.first.data(), + enrollment.first.size())); + list.emplace_back(std::move(elem)); + } + } + + ResolveJavascriptCallback(base::Value(std::move(callback_id_)), + base::ListValue(std::move(list))); +} + +void SecurityKeysBioEnrollmentHandler::HandleStartEnrolling( + const base::ListValue* args) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + DCHECK_EQ(1u, args->GetSize()); + + callback_id_ = args->GetList()[0].GetString(); + bio_->EnrollTemplate( + base::BindRepeating( + &SecurityKeysBioEnrollmentHandler::OnEnrollingResponse, + weak_factory_.GetWeakPtr()), + base::BindOnce(&SecurityKeysBioEnrollmentHandler::OnEnrollmentFinished, + weak_factory_.GetWeakPtr())); +} + +void SecurityKeysBioEnrollmentHandler::OnEnrollmentFinished( + device::CtapDeviceResponseCode code) { + base::DictionaryValue d; + d.SetIntKey("code", static_cast<int>(code)); + d.SetIntKey("remaining", 0); + ResolveJavascriptCallback(base::Value(std::move(callback_id_)), std::move(d)); +} + +void SecurityKeysBioEnrollmentHandler::OnEnrollingResponse( + device::BioEnrollmentSampleStatus status, + uint8_t remaining_samples) { + base::DictionaryValue d; + d.SetIntKey("status", static_cast<int>(status)); + d.SetIntKey("remaining", static_cast<int>(remaining_samples)); + FireWebUIListener("security-keys-bio-enroll-status", std::move(d)); +} + +void SecurityKeysBioEnrollmentHandler::HandleCancel( + const base::ListValue* args) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + DCHECK_EQ(1u, args->GetSize()); + + callback_id_ = args->GetList()[0].GetString(); + bio_->Cancel(base::BindOnce(&SecurityKeysBioEnrollmentHandler::OnEnrollCancel, + weak_factory_.GetWeakPtr())); +} + +void SecurityKeysBioEnrollmentHandler::OnEnrollCancel( + device::CtapDeviceResponseCode) { + ResolveJavascriptCallback(base::Value(std::move(callback_id_)), + base::Value()); +} + } // namespace settings
diff --git a/chrome/browser/ui/webui/settings/settings_security_key_handler.h b/chrome/browser/ui/webui/settings/settings_security_key_handler.h index 2b9e1b1..d8ceef5b 100644 --- a/chrome/browser/ui/webui/settings/settings_security_key_handler.h +++ b/chrome/browser/ui/webui/settings/settings_security_key_handler.h
@@ -14,6 +14,8 @@ #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" #include "device/fido/fido_constants.h" +#include "device/fido/bio/enrollment.h" + namespace base { class ListValue; } @@ -24,6 +26,7 @@ class CredentialManagementHandler; class SetPINRequestHandler; class ResetRequestHandler; +class BioEnrollmentHandler; } // namespace device namespace settings { @@ -161,6 +164,48 @@ base::WeakPtrFactory<SecurityKeysCredentialHandler> weak_factory_{this}; }; +class SecurityKeysBioEnrollmentHandler : public SecurityKeysHandlerBase { + public: + SecurityKeysBioEnrollmentHandler(); + ~SecurityKeysBioEnrollmentHandler() override; + + private: + enum class State { + kNone, + }; + + void RegisterMessages() override; + void Close() override; + + void HandleStart(const base::ListValue* args); + void OnReady(); + void OnError(device::FidoReturnCode code); + void OnGatherPIN(int64_t retries, base::OnceCallback<void(std::string)>); + + void HandleProvidePIN(const base::ListValue* args); + + void HandleEnumerate(const base::ListValue* args); + void OnHaveEnrollments( + device::CtapDeviceResponseCode, + base::Optional<std::map<std::vector<uint8_t>, std::string>>); + + void HandleStartEnrolling(const base::ListValue* args); + void OnEnrollmentFinished(device::CtapDeviceResponseCode); + void OnEnrollingResponse(device::BioEnrollmentSampleStatus, uint8_t); + + void HandleCancel(const base::ListValue* args); + void OnEnrollCancel(device::CtapDeviceResponseCode); + + State state_ = State::kNone; + base::OnceCallback<void(std::string)> provide_pin_cb_; + + std::unique_ptr<device::FidoDiscoveryFactory> discovery_factory_; + std::unique_ptr<device::BioEnrollmentHandler> bio_; + + std::string callback_id_; + base::WeakPtrFactory<SecurityKeysBioEnrollmentHandler> weak_factory_{this}; +}; + } // namespace settings #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_SECURITY_KEY_HANDLER_H_
diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc index 49db6a5..a98e0c3 100644 --- a/chrome/browser/ui/webui/settings/settings_ui.cc +++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -212,6 +212,8 @@ AddSettingsPageUIHandler(std::make_unique<SecurityKeysPINHandler>()); AddSettingsPageUIHandler(std::make_unique<SecurityKeysResetHandler>()); AddSettingsPageUIHandler(std::make_unique<SecurityKeysCredentialHandler>()); + AddSettingsPageUIHandler( + std::make_unique<SecurityKeysBioEnrollmentHandler>()); #if defined(OS_WIN) || defined(OS_MACOSX) AddSettingsPageUIHandler(std::make_unique<CaptionsHandler>());
diff --git a/chrome/browser/vr/assets_loader.cc b/chrome/browser/vr/assets_loader.cc index 9e06dfbf..99bcf65 100644 --- a/chrome/browser/vr/assets_loader.cc +++ b/chrome/browser/vr/assets_loader.cc
@@ -244,8 +244,8 @@ } AssetsLoader::AssetsLoader() - : main_thread_task_runner_(base::CreateSingleThreadTaskRunnerWithTraits( - {content::BrowserThread::UI})) { + : main_thread_task_runner_( + base::CreateSingleThreadTaskRunner({content::BrowserThread::UI})) { DCHECK(main_thread_task_runner_.get()); } @@ -268,8 +268,9 @@ OnAssetsLoadedCallback on_loaded) { DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); DCHECK(component_ready_); - base::PostTaskWithTraits( - FROM_HERE, {base::TaskPriority::BEST_EFFORT, base::MayBlock()}, + base::PostTask( + FROM_HERE, + {base::ThreadPool(), base::TaskPriority::BEST_EFFORT, base::MayBlock()}, base::BindOnce(&AssetsLoader::LoadAssetsTask, task_runner, component_version_, component_install_dir_, std::move(on_loaded)));
diff --git a/chrome/browser/vr/speech_recognizer.cc b/chrome/browser/vr/speech_recognizer.cc index 0f1f90a..f79f76a 100644 --- a/chrome/browser/vr/speech_recognizer.cc +++ b/chrome/browser/vr/speech_recognizer.cc
@@ -182,7 +182,7 @@ void SpeechRecognizerOnIO::NotifyRecognitionStateChanged( SpeechRecognitionState new_state) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&IOBrowserUIInterface::OnSpeechRecognitionStateChanged, browser_ui_, new_state)); @@ -224,7 +224,7 @@ final_count++; result_str += result->hypotheses[0]->utterance; } - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&IOBrowserUIInterface::OnSpeechResult, browser_ui_, result_str, final_count == results.size())); @@ -268,7 +268,7 @@ DCHECK_LE(0.0, noise_volume); DCHECK_GE(1.0, noise_volume); volume = std::max(0.0f, volume - noise_volume); - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::UI}, base::BindOnce(&IOBrowserUIInterface::OnSpeechSoundLevelChanged, browser_ui_, volume)); @@ -322,7 +322,7 @@ // It is safe to use unretained because speech_recognizer_on_io_ only gets // deleted on IO thread when SpeechRecognizer is deleted. - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::IO}, base::BindOnce(&SpeechRecognizerOnIO::Start, base::Unretained(speech_recognizer_on_io_.get()), @@ -340,7 +340,7 @@ // It is safe to use unretained because speech_recognizer_on_io_ only gets // deleted on IO thread when SpeechRecognizer is deleted. - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::IO}, base::BindOnce(&SpeechRecognizerOnIO::Stop, base::Unretained(speech_recognizer_on_io_.get())));
diff --git a/chrome/browser/vr/speech_recognizer_unittest.cc b/chrome/browser/vr/speech_recognizer_unittest.cc index 813eccfe..b49b84e7 100644 --- a/chrome/browser/vr/speech_recognizer_unittest.cc +++ b/chrome/browser/vr/speech_recognizer_unittest.cc
@@ -145,7 +145,7 @@ void FakeSpeechRecognitionEvent(FakeRecognitionEvent event) { if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) { - base::PostTaskWithTraits( + base::PostTask( FROM_HERE, {content::BrowserThread::IO}, base::BindOnce( &FakeSpeechRecognitionManager::FakeSpeechRecognitionEvent,
diff --git a/chrome/chrome_cleaner/BUILD.gn b/chrome/chrome_cleaner/BUILD.gn index f9a18853..b0506b6 100644 --- a/chrome/chrome_cleaner/BUILD.gn +++ b/chrome/chrome_cleaner/BUILD.gn
@@ -9,12 +9,14 @@ # Generate a buildflag header so code can check is_official_chrome_cleaner_build. buildflag_header("buildflags") { header = "buildflags.h" - flags = - [ "IS_OFFICIAL_CHROME_CLEANER_BUILD=$is_official_chrome_cleaner_build" ] + flags = [ + "IS_INTERNAL_CHROME_CLEANER_BUILD=$is_internal_chrome_cleaner_build", + "IS_OFFICIAL_CHROME_CLEANER_BUILD=$is_official_chrome_cleaner_build", + ] } group("engine_definitions") { - if (is_official_chrome_cleaner_build) { + if (is_internal_chrome_cleaner_build) { deps = [ "//chrome_cleaner_internal:engine_definitions", ] @@ -61,7 +63,6 @@ test("chrome_cleaner_unittests") { sources = [ "//chrome/chrome_cleaner/test/test_main.cc", - "//chrome/chrome_cleaner/test/unit_test_override_command_line.cc", ] deps = [ @@ -71,6 +72,7 @@ ":other_executable_definitions", "//base", "//base/test:test_support", + "//chrome/chrome_cleaner:buildflags", "//chrome/chrome_cleaner/crash:crashpad_lib", "//chrome/chrome_cleaner/ipc:sandbox", "//chrome/chrome_cleaner/logging:common", @@ -91,9 +93,9 @@ "//chrome/chrome_cleaner/engines/controllers:unittest_sources", "//chrome/chrome_cleaner/engines/target:unittest_sources", "//chrome/chrome_cleaner/http:unittest_sources", - "//chrome/chrome_cleaner/mojom/typemaps:unittest_sources", "//chrome/chrome_cleaner/ipc:unittest_sources", "//chrome/chrome_cleaner/logging:unittest_sources", + "//chrome/chrome_cleaner/mojom/typemaps:unittest_sources", "//chrome/chrome_cleaner/os:unittest_sources", "//chrome/chrome_cleaner/parsers/broker:unittest_sources", "//chrome/chrome_cleaner/parsers/json_parser:unittest_sources", @@ -105,20 +107,16 @@ "//chrome/chrome_cleaner/scanner:unittest_sources", "//chrome/chrome_cleaner/settings:unittest_sources", "//chrome/chrome_cleaner/strings:unittest_sources", + "//chrome/chrome_cleaner/test:integration_test_sources", "//chrome/chrome_cleaner/test:unittest_sources", "//chrome/chrome_cleaner/ui:unittest_sources", "//chrome/chrome_cleaner/zip_archiver:unittest_sources", ] if (is_internal_chrome_cleaner_build) { - deps += [ "//chrome_cleaner_internal:unittest_sources" ] + deps += [ + "//chrome_cleaner_internal:integration_test_sources", + "//chrome_cleaner_internal:unittest_sources", + ] } - - # TODO(crbug.com/949669): Add an integration test of the top-level - # executables. For now, just add a dependency on them to make sure they - # build. - data_deps = [ - "//chrome/chrome_cleaner/executables:chrome_cleanup_tool", - "//chrome/chrome_cleaner/executables:software_reporter_tool", - ] }
diff --git a/chrome/chrome_cleaner/chrome_cleaner_args.gni b/chrome/chrome_cleaner/chrome_cleaner_args.gni index 3e2b340b..f3ee043 100644 --- a/chrome/chrome_cleaner/chrome_cleaner_args.gni +++ b/chrome/chrome_cleaner/chrome_cleaner_args.gni
@@ -4,6 +4,8 @@ declare_args() { # If this is true, the build will look for extra Google-internal resources. + # This should only be set on the Chrome Cleaner builders, not general + # chromium builders, since it can cause tests to take longer. is_internal_chrome_cleaner_build = false # If this is true, builds an official release of the Chrome Cleanup Tool
diff --git a/chrome/chrome_cleaner/executables/BUILD.gn b/chrome/chrome_cleaner/executables/BUILD.gn index b3292636..3b841259 100644 --- a/chrome/chrome_cleaner/executables/BUILD.gn +++ b/chrome/chrome_cleaner/executables/BUILD.gn
@@ -4,19 +4,6 @@ import("//chrome/chrome_cleaner/chrome_cleaner_args.gni") -group("engine_definitions") { - if (is_internal_chrome_cleaner_build) { - deps = [ - "//chrome_cleaner_internal:engine_definitions", - ] - } else { - deps = [ - "//chrome/chrome_cleaner/engines/common:dummy_engine_resources", - "//chrome/chrome_cleaner/settings:dummy_engine_settings", - ] - } -} - group("engine_target_factory") { if (is_internal_chrome_cleaner_build) { deps = [ @@ -70,12 +57,12 @@ } deps = [ - ":engine_definitions", ":engine_target_factory", ":shutdown_sequence", "//base", "//build/win:default_exe_manifest", "//chrome/chrome_cleaner:buildflags", + "//chrome/chrome_cleaner:engine_definitions", "//chrome/chrome_cleaner/constants:common_strings", "//chrome/chrome_cleaner/constants:version_header", "//chrome/chrome_cleaner/crash:crashpad_lib",
diff --git a/chrome/chrome_cleaner/pup_data/pup_data_unittest.cc b/chrome/chrome_cleaner/pup_data/pup_data_unittest.cc index 99672fb5a..2739ab0 100644 --- a/chrome/chrome_cleaner/pup_data/pup_data_unittest.cc +++ b/chrome/chrome_cleaner/pup_data/pup_data_unittest.cc
@@ -8,6 +8,7 @@ #include <algorithm> #include <deque> +#include <map> #include <string> #include "base/files/file_path.h" @@ -16,8 +17,11 @@ #include "base/path_service.h" #include "base/stl_util.h" #include "base/strings/string16.h" +#include "base/strings/utf_string_conversions.h" #include "base/test/test_reg_util_win.h" +#include "chrome/chrome_cleaner/os/file_path_sanitization.h" #include "chrome/chrome_cleaner/proto/shared_pup_enums.pb.h" +#include "chrome/chrome_cleaner/pup_data/pup_data.h" #include "chrome/chrome_cleaner/test/test_file_util.h" #include "chrome/chrome_cleaner/test/test_pup_data.h" #include "chrome/chrome_cleaner/test/test_registry_util.h" @@ -668,4 +672,47 @@ TestUwSCatalog::GetInstance().GetUwSIds().size()); } +// Verify that SanitizePath is written to handle all the CSIDL values used in +// the PuP data. +TEST(SanitizePathVsRawPupDataCsidlTest, TestAllCsidlValues) { + using chrome_cleaner::PUPData; + using chrome_cleaner::sanitization_internal::PATH_CSIDL_END; + using chrome_cleaner::sanitization_internal::PATH_CSIDL_START; + + // Get set containing the distinct CSIDL values used in rewrite_rules[]. + std::set<int> csidl_list; + for (const auto& entry : chrome_cleaner::PathKeyToSanitizeString()) { + int id = entry.first; + // Exclude non-CSIDL replacements. + if (id < PATH_CSIDL_START || id > PATH_CSIDL_END) { + continue; + } + + // id represents a key used by PathService to lookup a FilePath. A + // PathService Provider was registered to handle the CSIDL values with an + // offset of PATH_CSIDL_START to avoid collisions with other PathService + // Providers. + int csidl = id - PATH_CSIDL_START; + csidl_list.insert(csidl); + } + + // Report any unchecked CSIDLs as unsanitized. + for (const auto& pup_id : *PUPData::GetUwSIds()) { + const PUPData::UwSSignature& signature = + PUPData::GetPUP(pup_id)->signature(); + for (const PUPData::StaticDiskFootprint* disk_footprint = + signature.disk_footprints; + disk_footprint->path != nullptr; + ++disk_footprint) { + int csidl = disk_footprint->csidl; + if (csidl != PUPData::kInvalidCsidl && + csidl_list.find(csidl) == csidl_list.end()) { + ADD_FAILURE() << "CSIDL " << csidl << " is not sanitized in " + << signature.name << " with footprint " + << disk_footprint->path; + } + } + } +} + } // namespace chrome_cleaner
diff --git a/chrome/chrome_cleaner/test/BUILD.gn b/chrome/chrome_cleaner/test/BUILD.gn index 53f88a2..35654386 100644 --- a/chrome/chrome_cleaner/test/BUILD.gn +++ b/chrome/chrome_cleaner/test/BUILD.gn
@@ -202,6 +202,43 @@ # Targets that contain tests. +# These tests run the executables and test their behaviour. They're run as part +# of chrome_cleaner_unittests so that we don't need a separate test binary for +# the integration tests. +source_set("integration_test_sources") { + testonly = true + + sources = [ + "cleaner_test.cc", + "secure_dll_loading_test.cc", + ] + + deps = [ + ":test_util", + "//base", + "//base/test:test_support", + "//chrome/chrome_cleaner:buildflags", + "//chrome/chrome_cleaner/constants:common_strings", + "//chrome/chrome_cleaner/logging/proto:chrome_cleaner_report_proto", + "//chrome/chrome_cleaner/logging/proto:reporter_logs_proto", + "//chrome/chrome_cleaner/logging/proto:shared_data_proto", + "//chrome/chrome_cleaner/os:common_os", + "//chrome/chrome_cleaner/pup_data:pup_data_base", + "//chrome/chrome_cleaner/pup_data:test_uws", + "//chrome/chrome_cleaner/zip_archiver:common", + "//components/chrome_cleaner/public/constants", + "//components/chrome_cleaner/test:test_name_helper", + "//testing/gtest", + ] + + data_deps = [ + # Binaries that will be loaded by the tests. + ":empty_dll", + "//chrome/chrome_cleaner/executables:chrome_cleanup_tool", + "//chrome/chrome_cleaner/executables:software_reporter_tool", + ] +} + source_set("unittest_sources") { testonly = true
diff --git a/chrome/chrome_cleaner/test/cleaner_test.cc b/chrome/chrome_cleaner/test/cleaner_test.cc new file mode 100644 index 0000000..d6df17e3 --- /dev/null +++ b/chrome/chrome_cleaner/test/cleaner_test.cc
@@ -0,0 +1,514 @@ +// Copyright 2019 The Chromium 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 <string> +#include <tuple> + +#include "base/command_line.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/files/scoped_temp_dir.h" +#include "base/path_service.h" +#include "base/process/launch.h" +#include "base/strings/string_number_conversions.h" +#include "base/test/test_timeouts.h" +#include "base/win/windows_version.h" +#include "chrome/chrome_cleaner/buildflags.h" +#include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h" +#include "chrome/chrome_cleaner/logging/proto/chrome_cleaner_report.pb.h" +#include "chrome/chrome_cleaner/logging/proto/reporter_logs.pb.h" +#include "chrome/chrome_cleaner/logging/proto/shared_data.pb.h" +#include "chrome/chrome_cleaner/os/disk_util.h" +#include "chrome/chrome_cleaner/os/file_path_sanitization.h" +#include "chrome/chrome_cleaner/os/pre_fetched_paths.h" +#include "chrome/chrome_cleaner/pup_data/pup_data.h" +#include "chrome/chrome_cleaner/pup_data/test_uws.h" +#include "chrome/chrome_cleaner/test/test_util.h" +#include "chrome/chrome_cleaner/zip_archiver/sandboxed_zip_archiver.h" +#include "components/chrome_cleaner/public/constants/constants.h" +#include "components/chrome_cleaner/public/constants/result_codes.h" +#include "components/chrome_cleaner/test/test_name_helper.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace { + +using chrome_cleaner::Engine; +using chrome_cleaner::PUPData; +using ::testing::Combine; +using ::testing::Values; +using ::testing::ValuesIn; + +const wchar_t kCleanerExecutable[] = L"chrome_cleanup_tool.exe"; +const wchar_t kScannerExecutable[] = L"software_reporter_tool.exe"; + +const wchar_t kProtoExtension[] = L"pb"; + +// Strings which identify log entries which should be allowed because they fail +// the SanitizePath check, but are covered by one of the cases below: +// +// Case 1: When a prefix is added to a valid path, it shows up as unsanitized +// even though SanitizePath() may have been used. +// +// Case 2: A registry value contains paths which would ideally be sanitized, +// but the exact value should be reported to prevent ambiguity. Currently this +// generally means we just ignore the registry fields in the proto. +const std::vector<base::string16> kAllowedLogStringsForSanitizationCheck = { + // TryToExpandPath() in disk_util.cc fits Case 1. + L"] unable to retrieve file information on non-existing file: \'", + + // IsFilePresentLocally in file_path_sanitization.cc fits Case 1. + L"isfilepresentlocally failed to get attributes: ", +}; + +// Parse to |report| the serialized report dumped by |executable_name|. Return +// true on success. +bool ParseSerializedReport(const wchar_t* const executable_name, + chrome_cleaner::ChromeCleanerReport* report) { + DCHECK(executable_name); + DCHECK(report); + base::FilePath cleaner_executable(executable_name); + base::FilePath exe_file_path = + chrome_cleaner::PreFetchedPaths::GetInstance()->GetExecutablePath(); + base::FilePath proto_dump_file_path(exe_file_path.DirName().Append( + cleaner_executable.ReplaceExtension(kProtoExtension))); + std::string dumped_proto_string; + return base::ReadFileToString(proto_dump_file_path, &dumped_proto_string) && + report->ParseFromString(dumped_proto_string); +} + +base::string16 StringToWLower(const base::string16& source) { + // TODO(joenotcharles): Investigate moving this into string_util.cc and using + // it instead of ToLowerASCII() through the whole code base. Case insensitive + // compares will also need to be changed. + base::string16 copy = source; + for (wchar_t& character : copy) { + character = towlower(character); + } + return copy; +} + +std::vector<base::string16> GetUnsanitizedPaths() { + std::vector<base::string16> unsanitized_path_strings; + bool success = true; + for (const auto& entry : chrome_cleaner::PathKeyToSanitizeString()) { + int id = entry.first; + base::FilePath unsanitized_path; + if (!base::PathService::Get(id, &unsanitized_path)) { + LOG(ERROR) << "Failed to convert id (" << id << ") in PathService"; + success = false; + continue; + } + base::string16 unsanitized_path_string = + StringToWLower(unsanitized_path.value()); + unsanitized_path_strings.push_back(unsanitized_path_string); + } + CHECK(success); + return unsanitized_path_strings; +} + +bool ContainsAnyOf(const base::string16& main_string, + const std::vector<base::string16>& substrings) { + return std::any_of(substrings.begin(), substrings.end(), + [&main_string](const base::string16& path) -> bool { + return main_string.find(path) != base::string16::npos; + }); +} + +template <typename RepeatedTypeWithFileInformation> +void CheckFieldForUnsanitizedPaths( + const RepeatedTypeWithFileInformation& field, + const std::string& field_name, + const std::vector<base::string16>& unsanitized_path_strings) { + for (const auto& sub_field : field) { + std::string utf8_path = sub_field.file_information().path(); + EXPECT_FALSE(ContainsAnyOf(StringToWLower(base::UTF8ToWide(utf8_path)), + unsanitized_path_strings)) + << "Found unsanitized " << field_name << ":\n>>> " << utf8_path; + } +} + +bool CheckCleanerReportForUnsanitizedPaths( + const chrome_cleaner::ChromeCleanerReport& report) { + EXPECT_GT(report.raw_log_line_size(), 0); + std::vector<base::string16> unsanitized_path_strings = GetUnsanitizedPaths(); + size_t line_number = 0; + for (const auto& utf8_line : report.raw_log_line()) { + ++line_number; + if (!ContainsAnyOf(StringToWLower(base::UTF8ToWide(utf8_line)), + kAllowedLogStringsForSanitizationCheck)) { + EXPECT_FALSE(ContainsAnyOf(StringToWLower(base::UTF8ToWide(utf8_line)), + unsanitized_path_strings)) + << "Found unsanitized logs line (" << line_number << "):\n>>> " + << utf8_line; + } + } + + for (const auto& unknown_uws_file : report.unknown_uws().files()) { + std::string utf8_path = unknown_uws_file.file_information().path(); + EXPECT_FALSE(ContainsAnyOf(StringToWLower(base::UTF8ToWide(utf8_path)), + unsanitized_path_strings)) + << "Found unsanitized unknown uws file:\n>>> " << utf8_path; + } + + for (const auto& detected_uws : report.detected_uws()) { + CheckFieldForUnsanitizedPaths(detected_uws.files(), "uws files", + unsanitized_path_strings); + for (const auto& folder : detected_uws.folders()) { + std::string utf8_path = folder.folder_information().path(); + EXPECT_FALSE(ContainsAnyOf(StringToWLower(base::UTF8ToWide(utf8_path)), + unsanitized_path_strings)) + << "Found unsanitized detected uws folder:\n>>> " << utf8_path; + } + + // Intentionally skipping registry values since we don't sanitize them on + // purpose so we are sure what their value is. + + for (const auto& scheduled_task : detected_uws.scheduled_tasks()) { + std::string utf8_path = scheduled_task.scheduled_task().name(); + EXPECT_FALSE(ContainsAnyOf(StringToWLower(base::UTF8ToWide(utf8_path)), + unsanitized_path_strings)) + << "Found unsanitized detected uws scheduled task:\n>>> " + << utf8_path; + } + } + + // TODO(joenotcharles): Switch this over to use report.DebugString() instead + // of checking individual fields. + CheckFieldForUnsanitizedPaths(report.system_report().loaded_modules(), + "loaded module", unsanitized_path_strings); + CheckFieldForUnsanitizedPaths(report.system_report().processes(), "process", + unsanitized_path_strings); + CheckFieldForUnsanitizedPaths(report.system_report().services(), "service", + unsanitized_path_strings); + CheckFieldForUnsanitizedPaths( + report.system_report().layered_service_providers(), + "layered service provider", unsanitized_path_strings); + + for (const auto& installed_extensions : + report.system_report().installed_extensions()) { + for (const auto& extension_file : installed_extensions.extension_files()) { + std::string utf8_path = extension_file.path(); + EXPECT_FALSE(ContainsAnyOf(StringToWLower(base::UTF8ToWide(utf8_path)), + unsanitized_path_strings)) + << "Found unsanitized installed extension file:\n>>> " << utf8_path; + } + } + + for (const auto& installed_program : + report.system_report().installed_programs()) { + std::string utf8_path = installed_program.folder_information().path(); + EXPECT_FALSE(ContainsAnyOf(StringToWLower(base::UTF8ToWide(utf8_path)), + unsanitized_path_strings)) + << "Found unsanitized layered service provider:\n>>> " << utf8_path; + } + + // Intentionally skipping |system_report().registry_values()| since we don't + // sanitize them on purpose so we are sure what their value is. + + for (const auto& scheduled_task : report.system_report().scheduled_tasks()) { + CheckFieldForUnsanitizedPaths( + scheduled_task.actions(), + "scheduled task action for " + scheduled_task.name(), + unsanitized_path_strings); + } + + return !::testing::Test::HasFailure(); +} + +enum class TestFeatures { + kNone, + kWithoutSandbox, +}; + +// We can't use testing::Range with an enum so create an array to use with +// testing::ValuesIn. +// clang-format off +constexpr TestFeatures kAllTestFeatures[] = { + TestFeatures::kNone, + TestFeatures::kWithoutSandbox, +}; +// clang-format on + +std::ostream& operator<<(std::ostream& stream, TestFeatures features) { + switch (features) { + case TestFeatures::kNone: + stream << "None"; + break; + case TestFeatures::kWithoutSandbox: + stream << "WithoutSandbox"; + break; + default: + stream << "Unknown" << static_cast<int>(features); + break; + } + return stream; +} + +class CleanerTest + : public ::testing::TestWithParam<std::tuple<TestFeatures, Engine::Name>> { + public: + void SetUp() override { + std::tie(test_features_, engine_) = GetParam(); + + // Make sure the test UwS has the flags we expect. + ASSERT_FALSE(PUPData::IsConfirmedUwS(chrome_cleaner::kGoogleTestAUwSID)); + ASSERT_FALSE(PUPData::IsRemovable(chrome_cleaner::kGoogleTestAUwSID)); + ASSERT_TRUE(PUPData::IsConfirmedUwS(chrome_cleaner::kGoogleTestBUwSID)); + ASSERT_TRUE(PUPData::IsRemovable(chrome_cleaner::kGoogleTestBUwSID)); + + base::FilePath start_menu_folder; + CHECK(base::PathService::Get(base::DIR_START_MENU, &start_menu_folder)); + base::FilePath startup_dir = start_menu_folder.Append(L"Startup"); + + scan_only_test_uws_ = startup_dir.Append(chrome_cleaner::kTestUwsAFilename); + removable_test_uws_ = startup_dir.Append(chrome_cleaner::kTestUwsBFilename); + + // Always create scan-only UwS. Only some tests will have removable UwS. + ASSERT_NE(-1, base::WriteFile(scan_only_test_uws_, + chrome_cleaner::kTestUwsAFileContents, + chrome_cleaner::kTestUwsAFileContentsSize)); + + ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); + InitializeRemovableUwSArchivePath(); + } + + void TearDown() override { + if (locked_file_.IsValid()) + locked_file_.Close(); + // Remove any leftover UwS. + base::DeleteFile(scan_only_test_uws_, /*recursive=*/false); + base::DeleteFile(removable_test_uws_, /*recursive=*/false); + } + + void InitializeRemovableUwSArchivePath() { + const std::string uws_content(chrome_cleaner::kTestUwsBFileContents, + chrome_cleaner::kTestUwsBFileContentsSize); + std::string uws_hash; + ASSERT_TRUE( + chrome_cleaner::ComputeSHA256DigestOfString(uws_content, &uws_hash)); + + const base::string16 zip_filename = + chrome_cleaner::internal::ConstructZipArchiveFileName( + chrome_cleaner::kTestUwsBFilename, uws_hash, + /*max_filename_length=*/255); + expected_uws_archive_ = temp_dir_.GetPath().Append(zip_filename); + } + + void CreateRemovableUwS() { + ASSERT_NE(-1, base::WriteFile(removable_test_uws_, + chrome_cleaner::kTestUwsBFileContents, + chrome_cleaner::kTestUwsBFileContentsSize)); + } + + void LockRemovableUwS() { + // Opening a handle to the file will allow other processes read access, but + // not deletion. + locked_file_.Initialize(removable_test_uws_, base::File::FLAG_OPEN | + base::File::FLAG_READ | + base::File::FLAG_WRITE); + } + + void ExpectExitCode(const base::CommandLine& command_line, + int expected_exit_code) { + base::Process process( + base::LaunchProcess(command_line, base::LaunchOptions())); + ASSERT_TRUE(process.IsValid()); + + int exit_code = -1; + bool exited_within_timeout = process.WaitForExitWithTimeout( + base::TimeDelta::FromMinutes(10), &exit_code); + EXPECT_TRUE(exited_within_timeout); + EXPECT_EQ(expected_exit_code, exit_code); + + if (!exited_within_timeout) + process.Terminate(/*exit_code=*/-1, /*wait=*/false); + } + + base::CommandLine BuildCommandLine( + const base::FilePath& executable_path, + chrome_cleaner::ExecutionMode execution_mode = + chrome_cleaner::ExecutionMode::kNone) { + base::CommandLine command_line(executable_path); + chrome_cleaner::AppendTestSwitches(&command_line); + command_line.AppendSwitchASCII( + chrome_cleaner::kEngineSwitch, + base::NumberToString(static_cast<int>(engine_))); + if (execution_mode != chrome_cleaner::ExecutionMode::kNone) { + command_line.AppendSwitchASCII( + chrome_cleaner::kExecutionModeSwitch, + base::NumberToString(static_cast<int>(execution_mode))); + } + command_line.AppendSwitchPath(chrome_cleaner::kQuarantineDirSwitch, + temp_dir_.GetPath()); +#if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD) + if (test_features_ == TestFeatures::kWithoutSandbox) { + command_line.AppendSwitch( + chrome_cleaner::kRunWithoutSandboxForTestingSwitch); + } +#endif // BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD) + + return command_line; + } + + protected: + TestFeatures test_features_; + Engine::Name engine_; + base::FilePath scan_only_test_uws_; + base::FilePath removable_test_uws_; + base::FilePath expected_uws_archive_; + base::File locked_file_; + + private: + base::ScopedTempDir temp_dir_; +}; + +TEST_P(CleanerTest, Scanner_ScanOnly) { + base::CommandLine command_line = + BuildCommandLine(base::FilePath(kScannerExecutable)); + ExpectExitCode(command_line, + chrome_cleaner::RESULT_CODE_REPORT_ONLY_PUPS_FOUND); + EXPECT_TRUE(base::PathExists(scan_only_test_uws_)); +} + +TEST_P(CleanerTest, Scanner_Removable) { + CreateRemovableUwS(); + base::CommandLine command_line = + BuildCommandLine(base::FilePath(kScannerExecutable)); + + ExpectExitCode(command_line, chrome_cleaner::RESULT_CODE_SUCCESS); + EXPECT_TRUE(base::PathExists(scan_only_test_uws_)); + EXPECT_TRUE(base::PathExists(removable_test_uws_)); + EXPECT_FALSE(base::PathExists(expected_uws_archive_)); +} + +TEST_P(CleanerTest, Cleaner_ScanOnly) { + base::CommandLine command_line = + BuildCommandLine(base::FilePath(kCleanerExecutable), + chrome_cleaner::ExecutionMode::kCleanup); + ExpectExitCode(command_line, + chrome_cleaner::RESULT_CODE_REPORT_ONLY_PUPS_FOUND); + EXPECT_TRUE(base::PathExists(scan_only_test_uws_)); +} + +TEST_P(CleanerTest, Cleaner_Removable) { + CreateRemovableUwS(); + base::CommandLine command_line = + BuildCommandLine(base::FilePath(kCleanerExecutable), + chrome_cleaner::ExecutionMode::kCleanup); + + EXPECT_TRUE(base::PathExists(scan_only_test_uws_)); + + ExpectExitCode(command_line, chrome_cleaner::RESULT_CODE_SUCCESS); + EXPECT_FALSE(base::PathExists(removable_test_uws_)); + EXPECT_TRUE(base::PathExists(expected_uws_archive_)); +} + +TEST_P(CleanerTest, Cleaner_LockedFiles) { + CreateRemovableUwS(); + LockRemovableUwS(); + base::CommandLine command_line = + BuildCommandLine(base::FilePath(kCleanerExecutable), + chrome_cleaner::ExecutionMode::kCleanup); + ExpectExitCode(command_line, chrome_cleaner::RESULT_CODE_PENDING_REBOOT); + EXPECT_TRUE(base::PathExists(scan_only_test_uws_)); + EXPECT_TRUE(base::PathExists(removable_test_uws_)); + EXPECT_TRUE(base::PathExists(expected_uws_archive_)); +} + +TEST_P(CleanerTest, PostReboot_ScanOnly) { + base::CommandLine command_line = + BuildCommandLine(base::FilePath(kCleanerExecutable), + chrome_cleaner::ExecutionMode::kCleanup); + command_line.AppendSwitch(chrome_cleaner::kPostRebootSwitch); + ExpectExitCode(command_line, chrome_cleaner::RESULT_CODE_POST_REBOOT_SUCCESS); + EXPECT_TRUE(base::PathExists(scan_only_test_uws_)); +} + +TEST_P(CleanerTest, PostReboot_Removable) { + CreateRemovableUwS(); + base::CommandLine command_line = + BuildCommandLine(base::FilePath(kCleanerExecutable)); + command_line.AppendSwitch(chrome_cleaner::kPostRebootSwitch); + command_line.AppendSwitchASCII(chrome_cleaner::kExecutionModeSwitch, + base::NumberToString(static_cast<int>( + chrome_cleaner::ExecutionMode::kCleanup))); + ExpectExitCode(command_line, chrome_cleaner::RESULT_CODE_POST_REBOOT_SUCCESS); + EXPECT_TRUE(base::PathExists(scan_only_test_uws_)); + + // The engine should have removed the file. + EXPECT_FALSE(base::PathExists(removable_test_uws_)); + EXPECT_TRUE(base::PathExists(expected_uws_archive_)); +} + +TEST_P(CleanerTest, PostReboot_LockedFiles) { + CreateRemovableUwS(); + LockRemovableUwS(); + base::CommandLine command_line = + BuildCommandLine(base::FilePath(kCleanerExecutable)); + command_line.AppendSwitch(chrome_cleaner::kPostRebootSwitch); + command_line.AppendSwitchASCII(chrome_cleaner::kExecutionModeSwitch, + base::NumberToString(static_cast<int>( + chrome_cleaner::ExecutionMode::kCleanup))); + + ExpectExitCode(command_line, + chrome_cleaner::RESULT_CODE_POST_CLEANUP_VALIDATION_FAILED); + EXPECT_TRUE(base::PathExists(scan_only_test_uws_)); + EXPECT_TRUE(base::PathExists(removable_test_uws_)); + EXPECT_TRUE(base::PathExists(expected_uws_archive_)); +} + +TEST_P(CleanerTest, NoPotentialFalsePositivesOnCleanMachine) { + base::CommandLine command_line = + BuildCommandLine(base::FilePath(kCleanerExecutable)); + command_line.AppendSwitchASCII(chrome_cleaner::kExecutionModeSwitch, + base::NumberToString(static_cast<int>( + chrome_cleaner::ExecutionMode::kCleanup))); + + // Delete the scan only uws to make the machine clean. + base::DeleteFile(scan_only_test_uws_, /*recursive=*/false); + + ExpectExitCode(command_line, chrome_cleaner::RESULT_CODE_NO_PUPS_FOUND); +} + +TEST_P(CleanerTest, NoUnsanitizedPaths) { + CreateRemovableUwS(); + + base::CommandLine command_line = + BuildCommandLine(base::FilePath(kCleanerExecutable)); + LOG(ERROR) << command_line.GetCommandLineString(); + command_line.AppendSwitch(chrome_cleaner::kDumpRawLogsSwitch); + command_line.AppendSwitchASCII(chrome_cleaner::kExecutionModeSwitch, + base::NumberToString(static_cast<int>( + chrome_cleaner::ExecutionMode::kCleanup))); + ExpectExitCode(command_line, chrome_cleaner::RESULT_CODE_SUCCESS); + + chrome_cleaner::ChromeCleanerReport chrome_cleaner_report; + EXPECT_TRUE( + ParseSerializedReport(kCleanerExecutable, &chrome_cleaner_report)); + + // Ensure the report doesn't have any unsanitized paths. + EXPECT_TRUE(CheckCleanerReportForUnsanitizedPaths(chrome_cleaner_report)); +} + +// Test all features with the TestOnly engine, which is quick. +INSTANTIATE_TEST_CASE_P(AllFeatures, + CleanerTest, + Combine(ValuesIn(kAllTestFeatures), + Values(Engine::TEST_ONLY)), + chrome_cleaner::GetParamNameForTest()); + +#if BUILDFLAG(IS_INTERNAL_CHROME_CLEANER_BUILD) +// The full scan with the ESET engine takes too long to test more than once so +// don't enable any test features. In fact, don't test it in debug builds since +// they are slower. +#ifdef NDEBUG +INSTANTIATE_TEST_CASE_P(EsetFeatures, + CleanerTest, + Combine(Values(TestFeatures::kNone), + Values(Engine::ESET)), + chrome_cleaner::GetParamNameForTest()); +#endif // NDEBUG +#endif // BUILDFLAG(IS_INTERNAL_CHROME_CLEANER_BUILD) + +} // namespace
diff --git a/chrome/chrome_cleaner/test/secure_dll_loading_test.cc b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc new file mode 100644 index 0000000..fe10c44 --- /dev/null +++ b/chrome/chrome_cleaner/test/secure_dll_loading_test.cc
@@ -0,0 +1,195 @@ +// Copyright 2019 The Chromium 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/chrome_cleaner/os/secure_dll_loading.h" + +#include <windows.h> + +#include <memory> +#include <set> +#include <string> +#include <vector> + +#include "base/base_paths.h" +#include "base/command_line.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/files/scoped_temp_dir.h" +#include "base/logging.h" +#include "base/path_service.h" +#include "base/process/launch.h" +#include "base/process/process.h" +#include "base/strings/string16.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_piece.h" +#include "base/strings/string_split.h" +#include "base/strings/string_util.h" +#include "base/synchronization/waitable_event.h" +#include "base/test/test_timeouts.h" +#include "base/win/win_util.h" +#include "chrome/chrome_cleaner/buildflags.h" +#include "chrome/chrome_cleaner/constants/chrome_cleaner_switches.h" +#include "chrome/chrome_cleaner/os/inheritable_event.h" +#include "chrome/chrome_cleaner/os/process.h" +#include "chrome/chrome_cleaner/test/test_util.h" +#include "components/chrome_cleaner/public/constants/constants.h" +#include "components/chrome_cleaner/test/test_name_helper.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace { + +void PrintChildProcessLogs(const base::FilePath& log_dir, + base::StringPiece16 file_name) { + base::string16 base_name; + if (file_name == L"software_reporter_tool") { + base_name = L"software_reporter_tool"; + } else if (file_name == L"chrome_cleanup_tool") { + base_name = L"chrome_cleanup"; + } else { + LOG(ERROR) << "Unknown file name " << file_name.data(); + return; + } + + base::FilePath log_path = log_dir.Append(base_name).AddExtension(L"log"); + + if (!base::PathExists(log_path)) { + LOG(ERROR) << "Child process log file doesn't exist"; + return; + } + + // Collect the child process log file, and dump the contents, to help + // debugging failures. + std::string log_file_contents; + if (!base::ReadFileToString(log_path, &log_file_contents)) { + LOG(ERROR) << "Failed to read child process log file"; + return; + } + + std::vector<base::StringPiece> lines = + base::SplitStringPiece(log_file_contents, "\n", base::TRIM_WHITESPACE, + base::SPLIT_WANT_NONEMPTY); + LOG(ERROR) << "Dumping child process logs"; + for (const auto& line : lines) { + LOG(ERROR) << "Child process: " << line; + } +} + +} // namespace + +class SecureDLLLoadingTest : public testing::TestWithParam<base::string16> { + protected: + void SetUp() override { + base::FilePath out_dir; + ASSERT_TRUE(base::PathService::Get(base::DIR_EXE, &out_dir)); + exe_path_ = out_dir.Append(GetParam() + L".exe"); + empty_dll_path_ = out_dir.Append(chrome_cleaner::kEmptyDll); + } + + base::Process LaunchProcess(bool disable_secure_dll_loading) { + base::ScopedTempDir log_dir; + if (!log_dir.CreateUniqueTempDir()) { + ADD_FAILURE() << "Precondition failed: could not create log dir"; + return base::Process(); + } + + std::unique_ptr<base::WaitableEvent> init_done_notifier = + chrome_cleaner::CreateInheritableEvent( + base::WaitableEvent::ResetPolicy::AUTOMATIC, + base::WaitableEvent::InitialState::NOT_SIGNALED); + + base::CommandLine command_line(exe_path_); + command_line.AppendSwitchNative( + chrome_cleaner::kInitDoneNotifierSwitch, + base::NumberToString16( + base::win::HandleToUint32(init_done_notifier->handle()))); + command_line.AppendSwitch(chrome_cleaner::kLoadEmptyDLLSwitch); + command_line.AppendSwitchPath(chrome_cleaner::kTestLoggingPathSwitch, + log_dir.GetPath()); + +#if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD) + if (disable_secure_dll_loading) + command_line.AppendSwitch(chrome_cleaner::kAllowUnsecureDLLsSwitch); +#endif // BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD) + + // The default execution mode (ExecutionMode::kNone) is no longer supported + // and displays an error dialog instead of trying to load the DLLs. + command_line.AppendSwitchASCII( + chrome_cleaner::kExecutionModeSwitch, + base::NumberToString( + static_cast<int>(chrome_cleaner::ExecutionMode::kCleanup))); + + base::LaunchOptions options; + options.handles_to_inherit.push_back(init_done_notifier->handle()); + base::Process process = base::LaunchProcess(command_line, options); + + // Make sure the process has finished its initialization (including loading + // DLLs). Also check the process handle in case it exits with an error. + std::vector<HANDLE> wait_handles{init_done_notifier->handle(), + process.Handle()}; + DWORD wait_result = ::WaitForMultipleObjects( + wait_handles.size(), wait_handles.data(), /*bWaitAll=*/false, + TestTimeouts::action_max_timeout().InMilliseconds()); + // WAIT_OBJECT_0 is the first handle in the vector. + if (wait_result == WAIT_OBJECT_0 + 1) { + DWORD exit_code = 0; + PLOG_IF(ERROR, !::GetExitCodeProcess(process.Handle(), &exit_code)); + ADD_FAILURE() << "Process exited with " << exit_code + << " before signalling init_done_notifier"; + PrintChildProcessLogs(log_dir.GetPath(), GetParam()); + } else { + EXPECT_EQ(wait_result, WAIT_OBJECT_0); + } + + return process; + } + + bool EmptyDLLLoaded(const base::Process& process) { + std::set<base::string16> module_paths; + chrome_cleaner::GetLoadedModuleFileNames(process.Handle(), &module_paths); + + for (const auto& module_path : module_paths) { + if (base::EqualsCaseInsensitiveASCII(empty_dll_path_.value(), + module_path)) + return true; + } + return false; + } + + private: + base::FilePath exe_path_; + base::FilePath empty_dll_path_; +}; + +INSTANTIATE_TEST_CASE_P(SecureDLLLoading, + SecureDLLLoadingTest, + // The value names cannot include ".exe" because "." + // is not a valid character in a test case name. + ::testing::Values(L"software_reporter_tool", + L"chrome_cleanup_tool"), + chrome_cleaner::GetParamNameForTest()); + +#if !BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD) +TEST_P(SecureDLLLoadingTest, Disabled) { + base::Process process = LaunchProcess(/*disable_secure_dll_loading=*/true); + EXPECT_TRUE(EmptyDLLLoaded(process)); + + // There is no need to finish running the process. + EXPECT_TRUE(process.Terminate(0U, /*wait=*/true)); +} +#endif // BUILDFLAG(IS_OFFICIAL_CHROME_CLEANER_BUILD) + +TEST_P(SecureDLLLoadingTest, Default) { + if (!::GetProcAddress(::GetModuleHandleW(L"kernel32.dll"), + "SetDefaultDllDirectories")) { + // Skip this test if the SetDefaultDllDirectories function is unavailable + // (this is normal on Windows 7 without update KB2533623.) + return; + } + + base::Process process = LaunchProcess(/*disable_secure_dll_loading=*/false); + EXPECT_FALSE(EmptyDLLLoaded(process)); + + // There is no need to finish running the process. + EXPECT_TRUE(process.Terminate(0U, /*wait=*/true)); +}
diff --git a/chrome/chrome_cleaner/test/test_main.cc b/chrome/chrome_cleaner/test/test_main.cc index d4ed6bc7..607d10a 100644 --- a/chrome/chrome_cleaner/test/test_main.cc +++ b/chrome/chrome_cleaner/test/test_main.cc
@@ -8,10 +8,14 @@ #include "base/bind_helpers.h" #include "base/command_line.h" #include "base/logging.h" +#include "base/strings/string_number_conversions.h" #include "base/test/launcher/unit_test_launcher.h" #include "base/test/test_suite.h" +#include "base/test/test_switches.h" +#include "base/time/time.h" #include "base/win/scoped_com_initializer.h" #include "base/win/windows_version.h" +#include "chrome/chrome_cleaner/buildflags.h" #include "chrome/chrome_cleaner/crash/crash_client.h" #include "chrome/chrome_cleaner/ipc/sandbox.h" #include "chrome/chrome_cleaner/logging/scoped_logging.h" @@ -53,14 +57,6 @@ } // namespace -namespace chrome_cleaner { - -// Gives each test executable a chance to modify |command_line|. Each -// executable must link with exactly one implementation of this. -void OverrideTestCommandLine(base::CommandLine* command_line); - -} // namespace chrome_cleaner - int main(int argc, char** argv) { // This must be executed as soon as possible to reduce the number of dlls that // the code might try to load before we can lock things down. @@ -81,8 +77,16 @@ if (chrome_cleaner::Rebooter::IsPostReboot()) return 0; - chrome_cleaner::OverrideTestCommandLine( - base::CommandLine::ForCurrentProcess()); +#if BUILDFLAG(IS_INTERNAL_CHROME_CLEANER_BUILD) + // The tests will run with the internal engine, which takes longer. + // IS_INTERNAL_CHROME_CLEANER_BUILD is only set on the Chrome Cleaner + // builders, not the chromium builders, so this will not slow down the + // general commit queue. + constexpr base::TimeDelta kInternalTimeout = base::TimeDelta::FromMinutes(10); + base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( + switches::kTestLauncherTimeout, + base::NumberToString(kInternalTimeout.InMilliseconds())); +#endif // ScopedCOMInitializer keeps COM initialized in a specific scope. We don't // want to initialize it for sandboxed processes, so manage its lifetime with
diff --git a/chrome/chrome_cleaner/test/unit_test_override_command_line.cc b/chrome/chrome_cleaner/test/unit_test_override_command_line.cc deleted file mode 100644 index d0a7945..0000000 --- a/chrome/chrome_cleaner/test/unit_test_override_command_line.cc +++ /dev/null
@@ -1,13 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/command_line.h" - -namespace chrome_cleaner { - -void OverrideTestCommandLine(base::CommandLine* command_line) { - // Do nothing. -} - -} // namespace chrome_cleaner
diff --git a/chrome/chrome_elf/BUILD.gn b/chrome/chrome_elf/BUILD.gn index 3274b05..99ef4560 100644 --- a/chrome/chrome_elf/BUILD.gn +++ b/chrome/chrome_elf/BUILD.gn
@@ -86,23 +86,14 @@ configs += [ "//build/config/win:windowed" ] configs -= [ "//build/config/win:console" ] - # Delay loads in this list will prevent user32.dll - # from loading too early. - ldflags = [ - "/DELAYLOAD:advapi32.dll", - "/DELAYLOAD:dbghelp.dll", - "/DELAYLOAD:ole32.dll", - "/DELAYLOAD:oleaut32.dll", - "/DELAYLOAD:propsys.dll", - "/DELAYLOAD:rpcrt4.dll", - "/DELAYLOAD:shell32.dll", - "/DELAYLOAD:shlwapi.dll", - "/DELAYLOAD:user32.dll", - "/DELAYLOAD:winmm.dll", + configs += [ + "//build/config/win:delayloads", + "//build/config/win:delayloads_not_for_child_dll", ] + if (current_cpu == "x86") { # Don"t set an x64 base address (to avoid breaking HE-ASLR). - ldflags += [ "/BASE:0x01c20000" ] + ldflags = [ "/BASE:0x01c20000" ] } }
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 0ca0ae3..fdb46d3 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -381,7 +381,7 @@ // This feature requires Windows 10 or higher to work because it depends on // the "Apps & Features" system settings. const base::Feature kIncompatibleApplicationsWarning{ - "IncompatibleApplicationsWarning", base::FEATURE_ENABLED_BY_DEFAULT}; + "IncompatibleApplicationsWarning", base::FEATURE_DISABLED_BY_DEFAULT}; #endif #if defined(OS_CHROMEOS)
diff --git a/chrome/common/instant_mojom_traits.h b/chrome/common/instant_mojom_traits.h index 90e8704..ee31e8b 100644 --- a/chrome/common/instant_mojom_traits.h +++ b/chrome/common/instant_mojom_traits.h
@@ -69,6 +69,7 @@ IPC_STRUCT_TRAITS_MEMBER(custom_background_attribution_line_1) IPC_STRUCT_TRAITS_MEMBER(custom_background_attribution_line_2) IPC_STRUCT_TRAITS_MEMBER(custom_background_attribution_action_url) + IPC_STRUCT_TRAITS_MEMBER(collection_id) IPC_STRUCT_TRAITS_MEMBER(background_color) IPC_STRUCT_TRAITS_MEMBER(text_color) IPC_STRUCT_TRAITS_MEMBER(text_color_light)
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 8fff85c..8f6e0b4d 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc
@@ -1510,9 +1510,9 @@ L".pdf", L".shtml", L".svg", L".xht", L".xhtml", L".webp", NULL}; const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {L"ftp", L"http", L"https", NULL}; -const wchar_t* ShellUtil::kPotentialProtocolAssociations[] = {L"ftp", L"http", - L"https", L"irc", L"mailto", L"mms", L"news", L"nntp", L"sms", L"smsto", - L"tel", L"urn", L"webcal", NULL}; +const wchar_t* ShellUtil::kPotentialProtocolAssociations[] = { + L"ftp", L"http", L"https", L"irc", L"mailto", L"mms", L"news", L"nntp", + L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", nullptr}; const wchar_t* ShellUtil::kRegUrlProtocol = L"URL Protocol"; const wchar_t* ShellUtil::kRegApplication = L"\\Application"; const wchar_t* ShellUtil::kRegAppUserModelId = L"AppUserModelId";
diff --git a/chrome/renderer/net/net_error_helper_core.cc b/chrome/renderer/net/net_error_helper_core.cc index 9dff86e4..76e8367 100644 --- a/chrome/renderer/net/net_error_helper_core.cc +++ b/chrome/renderer/net/net_error_helper_core.cc
@@ -468,8 +468,6 @@ // handshake_failure alert. // https://crbug.com/431387 info.error.reason() != net::ERR_SSL_PROTOCOL_ERROR && - // Do not trigger for XSS Auditor violations. - info.error.reason() != net::ERR_BLOCKED_BY_XSS_AUDITOR && // Do not trigger for blacklisted URLs. // https://crbug.com/803839 info.error.reason() != net::ERR_BLOCKED_BY_ADMINISTRATOR &&
diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc index e51e129..6ffbcce 100644 --- a/chrome/renderer/searchbox/searchbox_extension.cc +++ b/chrome/renderer/searchbox/searchbox_extension.cc
@@ -421,6 +421,7 @@ theme_info.custom_background_attribution_line_1); builder.Set("attribution2", theme_info.custom_background_attribution_line_2); + builder.Set("collectionId", theme_info.collection_id); // Clear the theme attribution url, as it shouldn't be shown when // a custom background is set. builder.Set("attributionUrl", std::string());
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index f60e308..9a03e50 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -1080,6 +1080,7 @@ "../browser/sessions/tab_restore_service_load_waiter.h", "../browser/sharing/click_to_call/click_to_call_browsertest.cc", "../browser/signin/consistency_cookie_browsertest.cc", + "../browser/signin/e2e_tests/demo_signin_e2e_test.cc", "../browser/site_isolation/chrome_site_per_process_browsertest.cc", "../browser/site_isolation/site_details_browsertest.cc", "../browser/ui/blocked_content/popup_tracker_browsertest.cc", @@ -2401,6 +2402,9 @@ "../browser/ui/views/settings_reset_prompt_dialog_browsertest.cc", "../browser/ui/views/uninstall_view_browsertest.cc", ] + + configs += [ "//build/config/win:delayloads" ] + deps += [ "//chrome:other_version", "//chrome/app:command_ids", @@ -2460,6 +2464,8 @@ if (enable_supervised_users) { sources += [ + "../browser/supervised_user/logged_in_user_mixin.cc", + "../browser/supervised_user/logged_in_user_mixin.h", "../browser/supervised_user/supervised_user_navigation_throttle_browsertest.cc", "../browser/supervised_user/supervised_user_service_browsertest.cc", "../browser/supervised_user/supervised_user_test_base.cc", @@ -2760,6 +2766,7 @@ "../browser/android/tab_web_contents_delegate_android_unittest.cc", "../browser/autofill/automated_tests/cache_replayer_unittest.cc", "../browser/security_events/security_event_recorder_impl_unittest.cc", + "../browser/signin/e2e_tests/test_accounts_util_unittest.cc", "../browser/ui/webui/version_handler_win_unittest.cc", # TODO(newt): move this to test_support_unit? @@ -3914,6 +3921,7 @@ "../browser/sharing/click_to_call/click_to_call_context_menu_observer_unittest.cc", "../browser/sharing/click_to_call/click_to_call_sharing_dialog_controller_unittest.cc", "../browser/sharing/click_to_call/click_to_call_utils_unittest.cc", + "../browser/sharing/shared_clipboard/shared_clipboard_ui_controller_unittest.cc", "../browser/ui/autofill/payments/local_card_migration_bubble_controller_impl_unittest.cc", "../browser/ui/autofill/payments/save_card_bubble_controller_impl_unittest.cc", "../browser/ui/bluetooth/bluetooth_chooser_controller_unittest.cc", @@ -5588,11 +5596,7 @@ "runtimeobject.lib", ] - ldflags += [ - "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll", - "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll", - "/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll", - ] + configs += [ "//build/config/win:delayloads" ] } if (is_mac) { @@ -6419,13 +6423,10 @@ # Don't want the test-specific dependencies to affect load tests. # In particular, a few system DLLs cause user32 to be loaded, which is bad. - ldflags = [ - "/DELAYLOAD:advapi32.dll", - "/DELAYLOAD:ole32.dll", - "/DELAYLOAD:shell32.dll", - "/DELAYLOAD:shlwapi.dll", - "/DELAYLOAD:user32.dll", - "/DELAYLOAD:winmm.dll", + # Add delayloads to ensure loader validations occur properly. + configs += [ + "//build/config/win:delayloads", + "//build/config/win:delayloads_not_for_child_dll", ] } }
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java index fe645485..6aaa94a1 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java
@@ -49,6 +49,8 @@ import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelObserver; import org.chromium.chrome.browser.tabmodel.TabSelectionType; +import org.chromium.chrome.browser.touchless.TouchlessDelegate; +import org.chromium.chrome.browser.util.FeatureUtilities; import org.chromium.chrome.test.util.ApplicationTestUtils; import org.chromium.chrome.test.util.ChromeTabUtils; import org.chromium.chrome.test.util.MenuUtils; @@ -97,6 +99,14 @@ @Rule private EmbeddedTestServerRule mTestServerRule = new EmbeddedTestServerRule(); + public static ChromeActivityTestRule forMainActivity() { + if (FeatureUtilities.isNoTouchModeEnabled()) { + return new ChromeActivityTestRule(TouchlessDelegate.getNoTouchActivityClass()); + } else { + return new ChromeActivityTestRule(ChromeTabbedActivity.class); + } + } + public ChromeActivityTestRule(Class<T> activityClass) { this(activityClass, false); }
diff --git a/chrome/test/data/previews/client_redirect_base.html b/chrome/test/data/previews/client_redirect_base.html new file mode 100644 index 0000000..8489f91 --- /dev/null +++ b/chrome/test/data/previews/client_redirect_base.html
@@ -0,0 +1,8 @@ +<html> + <head> + <title>Test page that client redirects to another page (that may loop back).</title> + <script> + document.location.href = "/client_redirect_loop_with_defer_all_script.html"; + </script> + </head> +</html>
diff --git a/chrome/test/data/previews/client_redirect_loop_with_defer_all_script.html b/chrome/test/data/previews/client_redirect_loop_with_defer_all_script.html new file mode 100644 index 0000000..35f70fc --- /dev/null +++ b/chrome/test/data/previews/client_redirect_loop_with_defer_all_script.html
@@ -0,0 +1,15 @@ +<html> + <head> + <title>Test page that causes a client redirect loop while script execution is deferred.</title> + <script> + if (document.getElementById("bodyend")) { + document.location.href = "/client_redirect_base.html"; + } else { + document.location.href = "/defer_all_script_browsertest.html"; + } + </script> + </head> + <body> + <pre id="bodyend">End</pre> + </body> +</html>
diff --git a/chrome/test/data/webui/settings/security_keys_subpage_test.js b/chrome/test/data/webui/settings/security_keys_subpage_test.js index 6f069e5..8204e7cc 100644 --- a/chrome/test/data/webui/settings/security_keys_subpage_test.js +++ b/chrome/test/data/webui/settings/security_keys_subpage_test.js
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -/** @implements {settings.SecurityKeysPINBrowserProxy} */ -class TestSecurityKeysPINBrowserProxy extends TestBrowserProxy { - constructor() { - super([ - 'startSetPIN', - 'setPIN', - 'close', - ]); +/** + * A base class for all security key subpage test browser proxies to + * inherit from. Provides a |promiseMap_| that proxies can be used to + * simulation Promise resolution via |setResponseFor| and |handleMethod|. + */ +class TestSecurityKeysBrowserProxy extends TestBrowserProxy { + constructor(methodNames) { + super(methodNames); /** * A map from method names to a promise to return when that method is @@ -32,9 +32,9 @@ * @param {string} methodName * @param {*} opt_arg * @return {!Promise} - * @private + * @protected */ - handleMethod_(methodName, opt_arg) { + handleMethod(methodName, opt_arg) { this.methodCalled(methodName, opt_arg); const promise = this.promiseMap_.get(methodName); if (promise != undefined) { @@ -45,15 +45,26 @@ // Return a Promise that never resolves. return new Promise(() => {}); } +} + +/** @implements {settings.SecurityKeysPINBrowserProxy} */ +class TestSecurityKeysPINBrowserProxy extends TestSecurityKeysBrowserProxy { + constructor() { + super([ + 'startSetPIN', + 'setPIN', + 'close', + ]); + } /** @override */ startSetPIN() { - return this.handleMethod_('startSetPIN'); + return this.handleMethod('startSetPIN'); } /** @override */ setPIN(oldPIN, newPIN) { - return this.handleMethod_('setPIN', {oldPIN, newPIN}); + return this.handleMethod('setPIN', {oldPIN, newPIN}); } /** @override */ @@ -63,57 +74,23 @@ } /** @implements {settings.SecurityKeysResetBrowserProxy} */ -class TestSecurityKeysResetBrowserProxy extends TestBrowserProxy { +class TestSecurityKeysResetBrowserProxy extends TestSecurityKeysBrowserProxy { constructor() { super([ 'reset', 'completeReset', 'close', ]); - - /** - * A map from method names to a promise to return when that method is - * called. (If no promise is installed, a never-resolved promise is - * returned.) - * @private {!Map<string, !Promise>} - */ - this.promiseMap_ = new Map(); - } - - /** - * @param {string} methodName - * @param {!Promise} promise - */ - setResponseFor(methodName, promise) { - this.promiseMap_.set(methodName, promise); - } - - /** - * @param {string} methodName - * @param {*} opt_arg - * @return {!Promise} - * @private - */ - handleMethod_(methodName, opt_arg) { - this.methodCalled(methodName, opt_arg); - const promise = this.promiseMap_.get(methodName); - if (promise != undefined) { - this.promiseMap_.delete(methodName); - return promise; - } - - // Return a Promise that never resolves. - return new Promise(() => {}); } /** @override */ reset() { - return this.handleMethod_('reset'); + return this.handleMethod('reset'); } /** @override */ completeReset() { - return this.handleMethod_('completeReset'); + return this.handleMethod('completeReset'); } /** @override */ @@ -123,7 +100,8 @@ } /** @implements {settings.SecurityKeysCredentialBrowserProxy} */ -class TestSecurityKeysCredentialBrowserProxy extends TestBrowserProxy { +class TestSecurityKeysCredentialBrowserProxy extends + TestSecurityKeysBrowserProxy { constructor() { super([ 'startCredentialManagement', @@ -132,60 +110,70 @@ 'deleteCredentials', 'close', ]); - - /** - * A map from method names to a promise to return when that method is - * called. (If no promise is installed, a never-resolved promise is - * returned.) - * @private {!Map<string, !Promise>} - */ - this.promiseMap_ = new Map(); - } - - /** - * @param {string} methodName - * @param {!Promise} promise - */ - setResponseFor(methodName, promise) { - this.promiseMap_.set(methodName, promise); - } - - /** - * @param {string} methodName - * @param {*} opt_arg - * @return {!Promise} - * @private - */ - handleMethod_(methodName, opt_arg) { - this.methodCalled(methodName, opt_arg); - const promise = this.promiseMap_.get(methodName); - if (promise != undefined) { - this.promiseMap_.delete(methodName); - return promise; - } - - // Return a Promise that never resolves. - return new Promise(() => {}); } /** @override */ startCredentialManagement() { - return this.handleMethod_('startCredentialManagement'); + return this.handleMethod('startCredentialManagement'); } /** @override */ providePIN(pin) { - return this.handleMethod_('providePIN', pin); + return this.handleMethod('providePIN', pin); } /** @override */ enumerateCredentials() { - return this.handleMethod_('enumerateCredentials'); + return this.handleMethod('enumerateCredentials'); } /** @override */ deleteCredentials(ids) { - return this.handleMethod_('deleteCredentials', ids); + return this.handleMethod('deleteCredentials', ids); + } + + /** @override */ + close() { + this.methodCalled('close'); + } +} + +/** @implements {settings.SecurityKeysBioEnrollProxy} */ +class TestSecurityKeysBioEnrollProxy extends TestSecurityKeysBrowserProxy { + constructor() { + super([ + 'startBioEnroll', + 'providePIN', + 'enumerateEnrollments', + 'startEnrolling', + 'cancelEnrollment', + 'close', + ]); + } + + /** @override */ + startBioEnroll() { + return this.handleMethod('startBioEnroll'); + } + + /** @override */ + providePIN(pin) { + return this.handleMethod('providePIN', pin); + } + + /** @override */ + enumerateEnrollments() { + return this.handleMethod('enumerateEnrollments'); + } + + /** @override */ + startEnrolling() { + return this.handleMethod('startEnrolling'); + } + + /** @override */ + cancelEnrollment() { + return this.handleMethod('cancelEnrollment'); } /** @override */ @@ -700,3 +688,170 @@ assertTrue(dialog.$.error.textContent.trim().includes('foobar')); }); }); + +suite('SecurityKeysBioEnrollment', function() { + let dialog = null; + + setup(function() { + browserProxy = new TestSecurityKeysBioEnrollProxy(); + settings.SecurityKeysBioEnrollProxyImpl.instance_ = browserProxy; + PolymerTest.clearBody(); + dialog = document.createElement('settings-security-keys-bio-enroll-dialog'); + }); + + function assertShown(expectedID) { + const allDivs = ['initial', 'pinPrompt', 'enrollments', 'enroll', 'error']; + assertTrue(allDivs.includes(expectedID)); + + const allShown = + allDivs.filter(id => dialog.$[id].className == 'iron-selected'); + assertEquals(allShown.length, 1); + assertEquals(allShown[0], expectedID); + } + + test('Initialization', async function() { + document.body.appendChild(dialog); + await browserProxy.whenCalled('startBioEnroll'); + assertShown('initial'); + assertFalse(dialog.$.cancelButton.hidden); + }); + + test('Cancel', async function() { + document.body.appendChild(dialog); + await browserProxy.whenCalled('startBioEnroll'); + assertShown('initial'); + dialog.$.cancelButton.click(); + await browserProxy.whenCalled('close'); + assertFalse(dialog.$.dialog.open); + }); + + test('Finished', async function() { + const resolver = new PromiseResolver(); + browserProxy.setResponseFor('startBioEnroll', resolver.promise); + + document.body.appendChild(dialog); + await browserProxy.whenCalled('startBioEnroll'); + assertShown('initial'); + resolver.resolve(); + + const errorString = 'foo bar baz'; + cr.webUIListenerCallback('security-keys-bio-enroll-error', errorString); + assertShown('error'); + assertTrue(dialog.$.error.textContent.trim().includes(errorString)); + }); + + test('Enrollments', async function() { + const startResolver = new PromiseResolver(); + browserProxy.setResponseFor('startBioEnroll', startResolver.promise); + const pinResolver = new PromiseResolver(); + browserProxy.setResponseFor('providePIN', pinResolver.promise); + const enumerateResolver = new PromiseResolver(); + browserProxy.setResponseFor( + 'enumerateEnrollments', enumerateResolver.promise); + + document.body.appendChild(dialog); + await browserProxy.whenCalled('startBioEnroll'); + assertShown('initial'); + + // Simulate PIN entry. + let uiReady = + test_util.eventToPromise('bio-enroll-dialog-ready-for-testing', dialog); + startResolver.resolve(); + await uiReady; + assertShown('pinPrompt'); + dialog.$.pin.value = '0000'; + dialog.$.okButton.click(); + const pin = await browserProxy.whenCalled('providePIN'); + assertEquals(pin, '0000'); + + // Show a list of three enrollments. + pinResolver.resolve(); + await browserProxy.whenCalled('enumerateEnrollments'); + uiReady = + test_util.eventToPromise('bio-enroll-dialog-ready-for-testing', dialog); + const enrollments = [ + { + name: 'Fingerprint00', + id: '0000', + }, + { + name: 'FingerprintAF', + id: '4321', + }, + { + name: 'FingerprintFA', + id: '1234', + }, + ]; + enumerateResolver.resolve(enrollments); + await uiReady; + assertShown('enrollments'); + assertEquals(dialog.$.enrollmentList.items, enrollments); + }); + + test('AddEnrollment', async function() { + const startResolver = new PromiseResolver(); + browserProxy.setResponseFor('startBioEnroll', startResolver.promise); + const pinResolver = new PromiseResolver(); + browserProxy.setResponseFor('providePIN', pinResolver.promise); + const enumerateResolver = new PromiseResolver(); + browserProxy.setResponseFor( + 'enumerateEnrollments', enumerateResolver.promise); + const enrollingResolver = new PromiseResolver(); + browserProxy.setResponseFor('startEnrolling', enrollingResolver.promise); + + document.body.appendChild(dialog); + await browserProxy.whenCalled('startBioEnroll'); + assertShown('initial'); + + // Simulate PIN entry. + let uiReady = + test_util.eventToPromise('bio-enroll-dialog-ready-for-testing', dialog); + startResolver.resolve(); + await uiReady; + assertShown('pinPrompt'); + dialog.$.pin.value = '0000'; + dialog.$.okButton.click(); + const pin = await browserProxy.whenCalled('providePIN'); + assertEquals(pin, '0000'); + + // Ensure no enrollments exist. + pinResolver.resolve(); + await browserProxy.whenCalled('enumerateEnrollments'); + uiReady = + test_util.eventToPromise('bio-enroll-dialog-ready-for-testing', dialog); + enumerateResolver.resolve([]); + await uiReady; + assertShown('enrollments'); + assertEquals(dialog.$.enrollmentList.items.length, 0); + + // Simulate add enrollment. + assertFalse(dialog.$.addButton.hidden); + uiReady = + test_util.eventToPromise('bio-enroll-dialog-ready-for-testing', dialog); + dialog.$.addButton.click(); + await browserProxy.whenCalled('startEnrolling'); + await uiReady; + + assertShown('enroll'); + uiReady = + test_util.eventToPromise('bio-enroll-dialog-ready-for-testing', dialog); + cr.webUIListenerCallback( + 'security-keys-bio-enroll-status', {status: 0, remaining: 1}); + await uiReady; + assertFalse(dialog.$.arc.isComplete()); + assertFalse(dialog.$.cancelButton.hidden); + assert(dialog.$.okButton.hidden); + + uiReady = + test_util.eventToPromise('bio-enroll-dialog-ready-for-testing', dialog); + enrollingResolver.resolve({ + code: 0, + remaining: 0, + }); + await uiReady; + assert(dialog.$.arc.isComplete()); + assert(dialog.$.cancelButton.hidden); + assertFalse(dialog.$.okButton.hidden); + }); +});
diff --git a/chrome/test/delayload/delayloads_unittest.cc b/chrome/test/delayload/delayloads_unittest.cc index 40a51891..e03b04d9 100644 --- a/chrome/test/delayload/delayloads_unittest.cc +++ b/chrome/test/delayload/delayloads_unittest.cc
@@ -92,9 +92,6 @@ static const char* const kValidFilePatterns[] = { "KERNEL32.dll", "chrome_elf.dll", - "DWrite.dll", - "oneds.dll", - "telclient.dll", // On 64 bit the Version API's like VerQueryValue come from VERSION.dll. // It depends on kernel32, advapi32 and api-ms-win-crt*.dll. This should // be ok. @@ -271,11 +268,9 @@ static const char* const kValidFilePatterns[] = { "KERNEL32.dll", - "RPCRT4.dll", #if defined(ADDRESS_SANITIZER) && defined(COMPONENT_BUILD) "clang_rt.asan_dynamic-i386.dll", #endif - "ADVAPI32.dll", // On 64 bit the Version API's like VerQueryValue come from VERSION.dll. // It depends on kernel32, advapi32 and api-ms-win-crt*.dll. This should // be ok.
diff --git a/chromecast/public/avsettings.h b/chromecast/public/avsettings.h index 0d13ec8..72a7afa 100644 --- a/chromecast/public/avsettings.h +++ b/chromecast/public/avsettings.h
@@ -211,7 +211,8 @@ // non-0 |brightness| values don't turn off the display. // Returns false if set fails. Returns true otherwise. // Not all displays support this function. - static bool SetDisplayBrightness(float brightness, bool smooth) + static CHROMECAST_EXPORT bool SetDisplayBrightness(float brightness, + bool smooth) __attribute__((weak)); // Gets the current screen (backlight) brightness. @@ -219,14 +220,16 @@ // Returns false and does not modify |brightness| if get fails. // Returns true and sets |brightness| to the current brightness otherwise. // Not all displays support this function. - static bool GetDisplayBrightness(float* brightness) __attribute__((weak)); + static CHROMECAST_EXPORT bool GetDisplayBrightness(float* brightness) + __attribute__((weak)); // Gets the nits output by the display at 100% brightness. // |nits|: The maximum brightness in nits. // Returns false and does not modify |nits| if get fails. // Returns true and sets |nits| on success. // Not all displays support this function. - static bool GetDisplayMaxBrightnessNits(float* nits) __attribute__((weak)); + static CHROMECAST_EXPORT bool GetDisplayMaxBrightnessNits(float* nits) + __attribute__((weak)); // Set Hdmi content type. Return false if such operation fails. The operation // fails if unexpected errors occur, or if the desired |content_type| is not @@ -241,7 +244,7 @@ // Returns 0 when HDMI is not connected or when the latency cannot be // measured. // This function should only be implemented on HDMI platforms. - static int GetHdmiLatencyUs() __attribute__((weak)); + static CHROMECAST_EXPORT int GetHdmiLatencyUs() __attribute__((weak)); // Returns the type of volume control, i.e. MASTER_VOLUME, FIXED_VOLUME or // ATTENUATION_VOLUME. For example, normal TVs, devices of CEC audio
diff --git a/chromeos/components/proximity_auth/remote_device_life_cycle_impl.cc b/chromeos/components/proximity_auth/remote_device_life_cycle_impl.cc index 1714fec..9ed255d 100644 --- a/chromeos/components/proximity_auth/remote_device_life_cycle_impl.cc +++ b/chromeos/components/proximity_auth/remote_device_life_cycle_impl.cc
@@ -111,6 +111,9 @@ << " stopped because Bluetooth is not available."; TransitionToState(RemoteDeviceLifeCycle::State::STOPPED); } else { + // TODO(crbug.com/991644): Improve the name AUTHENTICATION_FAILED (it can + // encompass errors other than authentication failures) and create a metric + // with buckets corresponding to the ConnectionAttemptFailureReason. PA_LOG(ERROR) << "Failed to authenticate with remote device: " << remote_device_.GetTruncatedDeviceIdForLogs() << ", for reason: " << reason << ". Giving up."; @@ -135,7 +138,10 @@ void RemoteDeviceLifeCycleImpl::OnDisconnected() { DCHECK(state_ == RemoteDeviceLifeCycle::State::SECURE_CHANNEL_ESTABLISHED); + + messenger_->RemoveObserver(this); messenger_.reset(); + FindConnection(); }
diff --git a/chromeos/components/proximity_auth/unlock_manager_impl.cc b/chromeos/components/proximity_auth/unlock_manager_impl.cc index cf8ccaee..3eb8a13 100644 --- a/chromeos/components/proximity_auth/unlock_manager_impl.cc +++ b/chromeos/components/proximity_auth/unlock_manager_impl.cc
@@ -29,12 +29,25 @@ // //tools/metrics/histograms/enums.xml, and should always reflect it (do not // change one without changing the other). Entries should be never modified // or deleted. Only additions possible. +enum class FindAndConnectToHostResult { + kFoundAndConnectedToHost = 0, + kCanceledBluetoothDisabled = 1, + kCanceledUserEnteredPassword = 2, + kSecureChannelConnectionAttemptFailure = 3, + kTimedOut = 4, + kMaxValue = kTimedOut +}; + +// This enum is tied directly to a UMA enum defined in +// //tools/metrics/histograms/enums.xml, and should always reflect it (do not +// change one without changing the other). Entries should be never modified +// or deleted. Only additions possible. enum class GetRemoteStatusResultFailureReason { - kTimedOutBluetoothDisabled = 0, - kTimedOutCouldNotEstablishAuthenticatedChannel = 1, + kCanceledBluetoothDisabled = 0, + kDeprecatedTimedOutCouldNotEstablishAuthenticatedChannel = 1, kTimedOutDidNotReceiveRemoteStatusUpdate = 2, - kUserEnteredPasswordWhileBluetoothDisabled = 3, - kUserEnteredPasswordWhileConnecting = 4, + kDeprecatedUserEnteredPasswordWhileBluetoothDisabled = 3, + kCanceledUserEnteredPassword = 4, kAuthenticatedChannelDropped = 5, kMaxValue = kAuthenticatedChannelDropped }; @@ -112,6 +125,15 @@ : "SignIn"; } +void RecordFindAndConnectToHostResult( + ProximityAuthSystem::ScreenlockType screenlock_type, + FindAndConnectToHostResult result) { + base::UmaHistogramEnumeration( + "SmartLock.FindAndConnectToHostResult." + + GetHistogramScreenLockTypeName(screenlock_type), + result); +} + void RecordGetRemoteStatusResultSuccess( ProximityAuthSystem::ScreenlockType screenlock_type, bool success = true) { @@ -182,10 +204,8 @@ bool UnlockManagerImpl::IsUnlockAllowed() { return (remote_screenlock_state_ && *remote_screenlock_state_ == RemoteScreenlockState::UNLOCKED && - life_cycle_ && - life_cycle_->GetState() == - RemoteDeviceLifeCycle::State::SECURE_CHANNEL_ESTABLISHED && - proximity_monitor_ && proximity_monitor_->IsUnlockAllowed() && + is_bluetooth_connection_to_phone_active_ && proximity_monitor_ && + proximity_monitor_->IsUnlockAllowed() && (screenlock_type_ != ProximityAuthSystem::SIGN_IN || (GetMessenger() && GetMessenger()->SupportsSignIn()))); } @@ -204,6 +224,7 @@ if (life_cycle_) { life_cycle_->AddObserver(this); + is_bluetooth_connection_to_phone_active_ = false; show_lock_screen_time_ = base::DefaultClock::GetInstance()->Now(); has_user_been_shown_first_status_ = false; @@ -211,6 +232,9 @@ SetIsPerformingInitialScan(true /* is_performing_initial_scan */); AttemptToStartRemoteDeviceLifecycle(); } else { + RecordFindAndConnectToHostResult( + screenlock_type_, + FindAndConnectToHostResult::kCanceledBluetoothDisabled); SetIsPerformingInitialScan(false /* is_performing_initial_scan */); } } else { @@ -238,16 +262,53 @@ } GetMessenger()->AddObserver(this); + is_bluetooth_connection_to_phone_active_ = true; attempt_get_remote_status_start_time_ = base::DefaultClock::GetInstance()->Now(); - } else if (proximity_monitor_) { - proximity_monitor_->RemoveObserver(this); - proximity_monitor_->Stop(); - proximity_monitor_.reset(); + + PA_LOG(VERBOSE) << "Successfully connected to host; waiting for remote " + "status update."; + + if (is_performing_initial_scan_) { + RecordFindAndConnectToHostResult( + screenlock_type_, + FindAndConnectToHostResult::kFoundAndConnectedToHost); + } + } else { + is_bluetooth_connection_to_phone_active_ = false; + + if (proximity_monitor_) { + proximity_monitor_->RemoveObserver(this); + proximity_monitor_->Stop(); + proximity_monitor_.reset(); + } } - if (new_state == RemoteDeviceLifeCycle::State::AUTHENTICATION_FAILED) - SetIsPerformingInitialScan(false /* is_performing_initial_scan */); + // Note: though the name is AUTHENTICATION_FAILED, this state actually + // encompasses any connection failure in + // |secure_channel::mojom::ConnectionAttemptFailureReason| beside Bluetooth + // becoming disabled. See https://crbug.com/991644 for more. + if (new_state == RemoteDeviceLifeCycle::State::AUTHENTICATION_FAILED) { + PA_LOG(ERROR) << "Connection attempt to host failed."; + + if (is_performing_initial_scan_) { + RecordFindAndConnectToHostResult( + screenlock_type_, + FindAndConnectToHostResult::kSecureChannelConnectionAttemptFailure); + SetIsPerformingInitialScan(false /* is_performing_initial_scan */); + } + } + + if (new_state == RemoteDeviceLifeCycle::State::FINDING_CONNECTION && + old_state == RemoteDeviceLifeCycle::State::SECURE_CHANNEL_ESTABLISHED) { + PA_LOG(ERROR) << "Secure channel dropped for unknown reason; potentially " + "due to Bluetooth being disabled."; + + if (is_performing_initial_scan_) { + OnDisconnected(); + SetIsPerformingInitialScan(false /* is_performing_initial_scan */); + } + } UpdateLockScreen(); } @@ -337,7 +398,7 @@ screenlock_type_, SmartLockMetricsRecorder::SmartLockAuthResultFailureReason:: kAuthenticatedChannelDropped); - } else { + } else if (is_performing_initial_scan_) { RecordGetRemoteStatusResultFailure( screenlock_type_, GetRemoteStatusResultFailureReason::kAuthenticatedChannelDropped); @@ -408,13 +469,32 @@ void UnlockManagerImpl::OnBluetoothAdapterPresentAndPoweredChanged() { DCHECK(!IsBluetoothAdapterRecoveringFromSuspend()); - if (!IsBluetoothPresentAndPowered()) { + if (IsBluetoothPresentAndPowered()) { + if (!is_performing_initial_scan_) + SetIsPerformingInitialScan(true /* is_performing_initial_scan */); + + return; + } + + if (is_performing_initial_scan_) { + if (is_bluetooth_connection_to_phone_active_ && + !has_received_first_remote_status_) { + RecordGetRemoteStatusResultFailure( + screenlock_type_, + GetRemoteStatusResultFailureReason::kCanceledBluetoothDisabled); + } else { + RecordFindAndConnectToHostResult( + screenlock_type_, + FindAndConnectToHostResult::kCanceledBluetoothDisabled); + } + SetIsPerformingInitialScan(false /* is_performing_initial_scan */); return; } - if (!is_performing_initial_scan_) - SetIsPerformingInitialScan(true /* is_performing_initial_scan */); + // If Bluetooth is off but no initial scan is active, still ensure that the + // lock screen UI reflects that Bluetooth is off. + UpdateLockScreen(); } bool UnlockManagerImpl::IsBluetoothAdapterRecoveringFromSuspend() const { @@ -484,19 +564,28 @@ void UnlockManagerImpl::CancelConnectionAttempt() { PA_LOG(VERBOSE) << "User entered password."; - if (!has_received_first_remote_status_) { - if (IsBluetoothPresentAndPowered()) { - RecordGetRemoteStatusResultFailure( - screenlock_type_, GetRemoteStatusResultFailureReason:: - kUserEnteredPasswordWhileConnecting); - } else { - RecordGetRemoteStatusResultFailure( - screenlock_type_, GetRemoteStatusResultFailureReason:: - kUserEnteredPasswordWhileBluetoothDisabled); - } - } + bluetooth_suspension_recovery_timer_->Stop(); - SetIsPerformingInitialScan(false /* is_performing_initial_scan */); + // Note: There is no need to record metrics here if Bluetooth isn't present + // and powered; that has already been handled at this point in + // OnBluetoothAdapterPresentAndPoweredChanged(). + if (!IsBluetoothPresentAndPowered()) + return; + + if (is_performing_initial_scan_) { + if (is_bluetooth_connection_to_phone_active_ && + !has_received_first_remote_status_) { + RecordGetRemoteStatusResultFailure( + screenlock_type_, + GetRemoteStatusResultFailureReason::kCanceledUserEnteredPassword); + } else { + RecordFindAndConnectToHostResult( + screenlock_type_, + FindAndConnectToHostResult::kCanceledUserEnteredPassword); + } + + SetIsPerformingInitialScan(false /* is_performing_initial_scan */); + } } std::unique_ptr<ProximityMonitor> UnlockManagerImpl::CreateProximityMonitor( @@ -654,25 +743,24 @@ } void UnlockManagerImpl::OnInitialScanTimeout() { - if (IsBluetoothPresentAndPowered()) { - if (life_cycle_ && - life_cycle_->GetState() == - RemoteDeviceLifeCycle::State::SECURE_CHANNEL_ESTABLISHED) { - RecordGetRemoteStatusResultFailure( - screenlock_type_, GetRemoteStatusResultFailureReason:: - kTimedOutDidNotReceiveRemoteStatusUpdate); - } else { - RecordGetRemoteStatusResultFailure( - screenlock_type_, GetRemoteStatusResultFailureReason:: - kTimedOutCouldNotEstablishAuthenticatedChannel); - } - } else { + // Note: There is no need to record metrics here if Bluetooth isn't present + // and powered; that has already been handled at this point in + // OnBluetoothAdapterPresentAndPoweredChanged(). + if (!IsBluetoothPresentAndPowered()) + return; + + if (is_bluetooth_connection_to_phone_active_) { + PA_LOG(ERROR) << "Successfully connected to host, but it did not provide " + "remote status update."; RecordGetRemoteStatusResultFailure( - screenlock_type_, - GetRemoteStatusResultFailureReason::kTimedOutBluetoothDisabled); + screenlock_type_, GetRemoteStatusResultFailureReason:: + kTimedOutDidNotReceiveRemoteStatusUpdate); + } else { + PA_LOG(INFO) << "Initial scan for host returned no result."; + RecordFindAndConnectToHostResult(screenlock_type_, + FindAndConnectToHostResult::kTimedOut); } - PA_LOG(INFO) << "Failed to connect to host within allotted time."; SetIsPerformingInitialScan(false /* is_performing_initial_scan */); }
diff --git a/chromeos/components/proximity_auth/unlock_manager_impl.h b/chromeos/components/proximity_auth/unlock_manager_impl.h index 1ff97110..1c74312 100644 --- a/chromeos/components/proximity_auth/unlock_manager_impl.h +++ b/chromeos/components/proximity_auth/unlock_manager_impl.h
@@ -233,6 +233,9 @@ // to scan for the phone until the user unlocks the screen. bool is_performing_initial_scan_ = false; + // True if a secure connection is currently active with the host. + bool is_bluetooth_connection_to_phone_active_ = false; + // TODO(crbug.com/986896): For a short time window after resuming from // suspension, BluetoothAdapter returns incorrect presence and power values. // This field acts as a cache in case we need to check those values during
diff --git a/chromeos/components/proximity_auth/unlock_manager_impl_unittest.cc b/chromeos/components/proximity_auth/unlock_manager_impl_unittest.cc index e4a962b..6b24ef0 100644 --- a/chromeos/components/proximity_auth/unlock_manager_impl_unittest.cc +++ b/chromeos/components/proximity_auth/unlock_manager_impl_unittest.cc
@@ -396,7 +396,8 @@ CreateUnlockManager(ProximityAuthSystem::SESSION_LOCK); SimulateUserPresentState(); - EXPECT_CALL(proximity_auth_client_, UpdateScreenlockState(_)).Times(0); + EXPECT_CALL(proximity_auth_client_, + UpdateScreenlockState(ScreenlockState::BLUETOOTH_CONNECTING)); unlock_manager_->SetRemoteDeviceLifeCycle(&life_cycle_); }
diff --git a/components/download/database/download_db_impl.cc b/components/download/database/download_db_impl.cc index 37aef16..2e728e8f 100644 --- a/components/download/database/download_db_impl.cc +++ b/components/download/database/download_db_impl.cc
@@ -20,7 +20,6 @@ const int kMaxNumInitializeAttempts = 3; -const char kDatabaseClientName[] = "DownloadDB"; using ProtoKeyVector = std::vector<std::string>; using ProtoEntryVector = std::vector<download_pb::DownloadDBEntry>; using ProtoKeyEntryVector = @@ -46,29 +45,27 @@ } // namespace -DownloadDBImpl::DownloadDBImpl(DownloadNamespace download_namespace, - const base::FilePath& database_dir) - : DownloadDBImpl( - download_namespace, - database_dir, - leveldb_proto::ProtoDatabaseProvider::CreateUniqueDB< - download_pb::DownloadDBEntry>(base::CreateSequencedTaskRunner( - {base::ThreadPool(), base::MayBlock(), - // USER_VISIBLE because it is required to display - // chrome://downloads. https://crbug.com/976223 - base::TaskPriority::USER_VISIBLE, - base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}))) {} - DownloadDBImpl::DownloadDBImpl( DownloadNamespace download_namespace, const base::FilePath& database_dir, + leveldb_proto::ProtoDatabaseProvider* db_provider) + : download_namespace_(download_namespace) { + DCHECK(!database_dir.empty()); + db_ = db_provider->GetDB<download_pb::DownloadDBEntry>( + leveldb_proto::ProtoDbType::DOWNLOAD_DB, database_dir, + base::CreateSequencedTaskRunnerWithTraits( + {base::ThreadPool(), base::MayBlock(), + // USER_VISIBLE because it is required to display chrome://downloads. + // https://crbug.com/976223 + base::TaskPriority::USER_VISIBLE, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN})); +} + +DownloadDBImpl::DownloadDBImpl( + DownloadNamespace download_namespace, std::unique_ptr<leveldb_proto::ProtoDatabase<download_pb::DownloadDBEntry>> db) - : database_dir_(database_dir), - db_(std::move(db)), - is_initialized_(false), - download_namespace_(download_namespace), - num_initialize_attempts_(0) {} + : db_(std::move(db)), download_namespace_(download_namespace) {} DownloadDBImpl::~DownloadDBImpl() = default; @@ -83,7 +80,7 @@ leveldb_env::Options options = leveldb_proto::CreateSimpleOptions(); options.reuse_logs = false; options.write_buffer_size = 64 << 10; // 64 KiB - db_->Init(kDatabaseClientName, database_dir_, options, + db_->Init(options, base::BindOnce(&DownloadDBImpl::OnDatabaseInitialized, weak_factory_.GetWeakPtr(), std::move(callback))); } @@ -152,8 +149,10 @@ std::move(callback).Run(success, std::move(result)); } -void DownloadDBImpl::OnDatabaseInitialized(DownloadDBCallback callback, - bool success) { +void DownloadDBImpl::OnDatabaseInitialized( + DownloadDBCallback callback, + leveldb_proto::Enums::InitStatus status) { + bool success = status == leveldb_proto::Enums::InitStatus::kOK; if (!success) { DestroyAndReinitialize(std::move(callback)); return;
diff --git a/components/download/database/download_db_impl.h b/components/download/database/download_db_impl.h index a1a6b65b..2a85c7c 100644 --- a/components/download/database/download_db_impl.h +++ b/components/download/database/download_db_impl.h
@@ -18,16 +18,20 @@ class DownloadDBEntry; } +namespace leveldb_proto { +class ProtoDatabaseProvider; +} // namespace leveldb_proto + namespace download { // A protodb Implementation of DownloadDB. class DownloadDBImpl : public DownloadDB { public: DownloadDBImpl(DownloadNamespace download_namespace, - const base::FilePath& database_dir); + const base::FilePath& database_dir, + leveldb_proto::ProtoDatabaseProvider* db_provider); DownloadDBImpl( DownloadNamespace download_namespace, - const base::FilePath& database_dir, std::unique_ptr< leveldb_proto::ProtoDatabase<download_pb::DownloadDBEntry>> db); ~DownloadDBImpl() override; @@ -51,7 +55,8 @@ std::string GetEntryKey(const std::string& guid) const; // Called when database is initialized. - void OnDatabaseInitialized(DownloadDBCallback callback, bool success); + void OnDatabaseInitialized(DownloadDBCallback callback, + leveldb_proto::Enums::InitStatus status); // Called when database is destroyed. void OnDatabaseDestroyed(DownloadDBCallback callback, bool success); @@ -65,21 +70,18 @@ bool success, std::unique_ptr<std::vector<download_pb::DownloadDBEntry>> entries); - // Directory to store |db_|. - base::FilePath database_dir_; - // Proto db for storing all the entries. std::unique_ptr<leveldb_proto::ProtoDatabase<download_pb::DownloadDBEntry>> db_; // Whether the object is initialized. - bool is_initialized_; + bool is_initialized_ = false; // Namespace of this db. DownloadNamespace download_namespace_; // Number of initialize attempts. - int num_initialize_attempts_; + int num_initialize_attempts_ = 0; base::WeakPtrFactory<DownloadDBImpl> weak_factory_{this};
diff --git a/components/download/database/download_db_impl_unittest.cc b/components/download/database/download_db_impl_unittest.cc index cd582a2..4df0822 100644 --- a/components/download/database/download_db_impl_unittest.cc +++ b/components/download/database/download_db_impl_unittest.cc
@@ -50,8 +50,7 @@ &db_entries_); db_ = db.get(); download_db_.reset(new DownloadDBImpl( - DownloadNamespace::NAMESPACE_BROWSER_DOWNLOAD, - base::FilePath(FILE_PATH_LITERAL("/test/db/fakepath")), std::move(db))); + DownloadNamespace::NAMESPACE_BROWSER_DOWNLOAD, std::move(db))); } void InitCallback(bool success) { init_success_ = success; } @@ -99,7 +98,7 @@ download_db_->Initialize( base::BindOnce(&DownloadDBTest::InitCallback, base::Unretained(this))); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); ASSERT_TRUE(IsInitialized()); ASSERT_TRUE(init_success_); @@ -111,7 +110,7 @@ download_db_->Initialize( base::BindOnce(&DownloadDBTest::InitCallback, base::Unretained(this))); - db_->InitCallback(false); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kError); ASSERT_FALSE(IsInitialized()); ASSERT_FALSE(init_success_); @@ -122,7 +121,7 @@ CreateDatabase(); download_db_->Initialize( base::BindOnce(&DownloadDBTest::InitCallback, base::Unretained(this))); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); ASSERT_TRUE(IsInitialized()); std::vector<DownloadDBEntry> loaded_entries; @@ -142,7 +141,7 @@ CreateDatabase(); download_db_->Initialize( base::BindOnce(&DownloadDBTest::InitCallback, base::Unretained(this))); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); ASSERT_TRUE(IsInitialized()); DownloadDBEntry entry = CreateDownloadDBEntry(); @@ -173,7 +172,7 @@ CreateDatabase(); download_db_->Initialize( base::BindOnce(&DownloadDBTest::InitCallback, base::Unretained(this))); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); ASSERT_TRUE(IsInitialized()); InProgressInfo in_progress_info; @@ -210,7 +209,7 @@ CreateDatabase(); download_db_->Initialize( base::BindOnce(&DownloadDBTest::InitCallback, base::Unretained(this))); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); ASSERT_TRUE(IsInitialized()); download_db_->Remove(first.GetGuid()); @@ -231,7 +230,7 @@ CreateDatabase(); download_db_->Initialize( base::BindOnce(&DownloadDBTest::InitCallback, base::Unretained(this))); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); ASSERT_TRUE(IsInitialized()); std::vector<DownloadDBEntry> loaded_entries;
diff --git a/components/download/internal/common/download_db_cache_unittest.cc b/components/download/internal/common/download_db_cache_unittest.cc index e39763bc..2b5fbc42 100644 --- a/components/download/internal/common/download_db_cache_unittest.cc +++ b/components/download/internal/common/download_db_cache_unittest.cc
@@ -70,8 +70,7 @@ &db_entries_); db_ = db.get(); auto download_db = std::make_unique<DownloadDBImpl>( - DownloadNamespace::NAMESPACE_BROWSER_DOWNLOAD, - base::FilePath(FILE_PATH_LITERAL("/test/db/fakepath")), std::move(db)); + DownloadNamespace::NAMESPACE_BROWSER_DOWNLOAD, std::move(db)); db_cache_ = std::make_unique<DownloadDBCache>(std::move(download_db)); db_cache_->SetTimerTaskRunnerForTesting(task_runner_); } @@ -119,7 +118,7 @@ db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); @@ -141,7 +140,7 @@ db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); @@ -166,7 +165,7 @@ db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); @@ -216,7 +215,7 @@ db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 1u); ASSERT_EQ(loaded_entries[0].download_info->in_progress_info->current_path, @@ -245,7 +244,7 @@ db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); @@ -272,7 +271,7 @@ db_cache_->Initialize( base::BindOnce(&DownloadDBCacheTest::InitCallback, base::Unretained(this), &loaded_entries)); - db_->InitCallback(true); + db_->InitStatusCallback(leveldb_proto::Enums::InitStatus::kOK); db_->LoadCallback(true); ASSERT_EQ(loaded_entries.size(), 2u); // Let the DBCache to cache the entry first.
diff --git a/components/download/internal/common/in_progress_download_manager.cc b/components/download/internal/common/in_progress_download_manager.cc index 9760db3..5e56a64 100644 --- a/components/download/internal/common/in_progress_download_manager.cc +++ b/components/download/internal/common/in_progress_download_manager.cc
@@ -24,6 +24,7 @@ #include "components/download/public/common/download_url_parameters.h" #include "components/download/public/common/download_utils.h" #include "components/download/public/common/input_stream.h" +#include "components/leveldb_proto/public/proto_database_provider.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/resource_response.h" #include "services/service_manager/public/cpp/connector.h" @@ -195,6 +196,7 @@ InProgressDownloadManager::InProgressDownloadManager( Delegate* delegate, const base::FilePath& in_progress_db_dir, + leveldb_proto::ProtoDatabaseProvider* db_provider, const IsOriginSecureCallback& is_origin_secure_cb, const URLSecurityPolicy& url_security_policy, service_manager::Connector* connector) @@ -205,7 +207,7 @@ url_security_policy_(url_security_policy), use_empty_db_(in_progress_db_dir.empty()), connector_(connector) { - Initialize(in_progress_db_dir); + Initialize(in_progress_db_dir, db_provider); } InProgressDownloadManager::~InProgressDownloadManager() = default; @@ -326,13 +328,20 @@ } void InProgressDownloadManager::Initialize( - const base::FilePath& in_progress_db_dir) { - download_db_cache_ = std::make_unique<DownloadDBCache>( - in_progress_db_dir.empty() - ? std::make_unique<DownloadDB>() - : std::make_unique<DownloadDBImpl>( - DownloadNamespace::NAMESPACE_BROWSER_DOWNLOAD, - in_progress_db_dir)); + const base::FilePath& in_progress_db_dir, + leveldb_proto::ProtoDatabaseProvider* db_provider) { + std::unique_ptr<DownloadDB> download_db; + + if (use_empty_db_) { + download_db = std::make_unique<DownloadDB>(); + } else { + download_db = std::make_unique<DownloadDBImpl>( + DownloadNamespace::NAMESPACE_BROWSER_DOWNLOAD, in_progress_db_dir, + db_provider); + } + + download_db_cache_ = + std::make_unique<DownloadDBCache>(std::move(download_db)); download_db_cache_->Initialize(base::BindOnce( &InProgressDownloadManager::OnDBInitialized, weak_factory_.GetWeakPtr())); }
diff --git a/components/download/public/common/in_progress_download_manager.h b/components/download/public/common/in_progress_download_manager.h index a8c3506..5113d634 100644 --- a/components/download/public/common/in_progress_download_manager.h +++ b/components/download/public/common/in_progress_download_manager.h
@@ -32,6 +32,10 @@ class Connector; } // namespace service_manager +namespace leveldb_proto { +class ProtoDatabaseProvider; +} // namespace leveldb_proto + namespace download { class DownloadDBCache; @@ -77,8 +81,12 @@ }; using IsOriginSecureCallback = base::RepeatingCallback<bool(const GURL&)>; + // Creates a new InProgressDownloadManager instance. If |in_progress_db_dir| + // is empty then it will use an empty database and no history will be saved. + // |db_provider| can be nullptr if |in_progress_db_dir| is empty. InProgressDownloadManager(Delegate* delegate, const base::FilePath& in_progress_db_dir, + leveldb_proto::ProtoDatabaseProvider* db_provider, const IsOriginSecureCallback& is_origin_secure_cb, const URLSecurityPolicy& url_security_policy, service_manager::Connector* connector); @@ -194,7 +202,8 @@ std::unique_ptr<download::DownloadItemImpl> download); private: - void Initialize(const base::FilePath& in_progress_db_dir); + void Initialize(const base::FilePath& in_progress_db_dir, + leveldb_proto::ProtoDatabaseProvider* db_provider); // UrlDownloadHandler::Delegate implementations. void OnUrlDownloadStarted(
diff --git a/components/error_page/common/localized_error.cc b/components/error_page/common/localized_error.cc index ea9bf73..ec5ca75 100644 --- a/components/error_page/common/localized_error.cc +++ b/components/error_page/common/localized_error.cc
@@ -283,12 +283,6 @@ SUGGEST_DISABLE_EXTENSION, SHOW_BUTTON_RELOAD, }, - {net::ERR_BLOCKED_BY_XSS_AUDITOR, - IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, - IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_XSS_AUDITOR, - SUGGEST_NAVIGATE_TO_ORIGIN, - SHOW_NO_BUTTONS, - }, {net::ERR_NETWORK_CHANGED, IDS_ERRORPAGES_HEADING_CONNECTION_INTERRUPTED, IDS_ERRORPAGES_SUMMARY_NETWORK_CHANGED,
diff --git a/components/error_page_strings.grdp b/components/error_page_strings.grdp index a67082d8..335968db 100644 --- a/components/error_page_strings.grdp +++ b/components/error_page_strings.grdp
@@ -250,9 +250,6 @@ <message name="IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_EXTENSION" desc="Summary in the error page when an extension blocks a request."> Requests to the server have been blocked by an extension. </message> - <message name="IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_XSS_AUDITOR" desc="Summary in the error page when the XSS Auditor blocks a response."> - Chrome detected unusual code on this page and blocked it to protect your personal information (for example, passwords, phone numbers, and credit cards). - </message> <message name="IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_ADMINISTRATOR" desc="Summary in the error page when an administrator policy blocks a request."> The person who set up this computer has chosen to block this site. </message>
diff --git a/components/leveldb_proto/public/shared_proto_database_client_list.cc b/components/leveldb_proto/public/shared_proto_database_client_list.cc index 09df606..c535bd0 100644 --- a/components/leveldb_proto/public/shared_proto_database_client_list.cc +++ b/components/leveldb_proto/public/shared_proto_database_client_list.cc
@@ -67,6 +67,8 @@ return "StrikeService"; case ProtoDbType::HINT_CACHE_STORE: return "PreviewsHintCacheStore"; + case ProtoDbType::DOWNLOAD_DB: + return "DownloadDB"; case ProtoDbType::LAST: NOTREACHED(); return std::string();
diff --git a/components/leveldb_proto/public/shared_proto_database_client_list.h b/components/leveldb_proto/public/shared_proto_database_client_list.h index e46ecef..edeea15 100644 --- a/components/leveldb_proto/public/shared_proto_database_client_list.h +++ b/components/leveldb_proto/public/shared_proto_database_client_list.h
@@ -38,6 +38,7 @@ BUDGET_DATABASE = 18, STRIKE_DATABASE = 19, HINT_CACHE_STORE = 20, + DOWNLOAD_DB = 21, LAST, };
diff --git a/components/media_message_center/media_controls_progress_view.cc b/components/media_message_center/media_controls_progress_view.cc index ce8325d..661edee0 100644 --- a/components/media_message_center/media_controls_progress_view.cc +++ b/components/media_message_center/media_controls_progress_view.cc
@@ -7,6 +7,7 @@ #include "base/i18n/time_formatting.h" #include "services/media_session/public/mojom/media_session.mojom.h" #include "ui/gfx/font_list.h" +#include "ui/views/border.h" #include "ui/views/controls/label.h" #include "ui/views/controls/progress_bar.h" #include "ui/views/layout/box_layout.h" @@ -18,19 +19,21 @@ namespace { -constexpr int kProgressBarAndTimeSpacing = 5; constexpr int kProgressTimeFontSize = 12; constexpr gfx::Size kTimeSpacingSize = gfx::Size(150, 10); constexpr gfx::Insets kProgressViewInsets = gfx::Insets(15, 25, 0, 25); +constexpr gfx::Insets kProgressBarInsets = gfx::Insets(5, 0, 5, 0); } // namespace -MediaControlsProgressView::MediaControlsProgressView() { +MediaControlsProgressView::MediaControlsProgressView( + base::RepeatingCallback<void(double)> seek_callback) + : seek_callback_(std::move(seek_callback)) { SetLayoutManager(std::make_unique<views::BoxLayout>( - views::BoxLayout::Orientation::kVertical, kProgressViewInsets, - kProgressBarAndTimeSpacing)); + views::BoxLayout::Orientation::kVertical, kProgressViewInsets)); progress_bar_ = AddChildView(std::make_unique<views::ProgressBar>(5, false)); + progress_bar_->SetBorder(views::CreateEmptyBorder(kProgressBarInsets)); // Font list for text views. gfx::Font default_font; @@ -82,8 +85,7 @@ base::TimeDelta current_position = media_position.GetPosition(); base::TimeDelta duration = media_position.duration(); - double progress = media_position.GetPosition().InSecondsF() / - media_position.duration().InSecondsF(); + double progress = current_position.InSecondsF() / duration.InSecondsF(); SetBarProgress(progress); // Time formatting can't yet represent durations greater than 24 hours in @@ -124,16 +126,30 @@ } } -void MediaControlsProgressView::SetBarProgress(double progress) { - progress_bar_->SetValue(progress); +bool MediaControlsProgressView::OnMousePressed(const ui::MouseEvent& event) { + gfx::Point location_in_bar(event.location()); + ConvertPointToTarget(this, this->progress_bar_, &location_in_bar); + + if (!event.IsOnlyLeftMouseButton() || + !progress_bar_->GetLocalBounds().Contains(location_in_bar)) { + return false; + } + + HandleSeeking(location_in_bar); + return true; } -void MediaControlsProgressView::SetProgressTime(const base::string16& time) { - progress_time_->SetText(time); -} +void MediaControlsProgressView::OnGestureEvent(ui::GestureEvent* event) { + gfx::Point location_in_bar(event->location()); + ConvertPointToTarget(this, this->progress_bar_, &location_in_bar); -void MediaControlsProgressView::SetDuration(const base::string16& duration) { - duration_->SetText(duration); + if (event->type() != ui::ET_GESTURE_TAP || + !progress_bar_->GetLocalBounds().Contains(location_in_bar)) { + return; + } + + HandleSeeking(location_in_bar); + event->SetHandled(); } const views::ProgressBar* MediaControlsProgressView::progress_bar_for_testing() @@ -150,4 +166,23 @@ return duration_->GetText(); } +void MediaControlsProgressView::SetBarProgress(double progress) { + progress_bar_->SetValue(progress); +} + +void MediaControlsProgressView::SetProgressTime(const base::string16& time) { + progress_time_->SetText(time); +} + +void MediaControlsProgressView::SetDuration(const base::string16& duration) { + duration_->SetText(duration); +} + +void MediaControlsProgressView::HandleSeeking( + const gfx::Point& location_in_bar) { + double seek_to_progress = + static_cast<double>(location_in_bar.x()) / progress_bar_->width(); + seek_callback_.Run(seek_to_progress); +} + } // namespace media_message_center
diff --git a/components/media_message_center/media_controls_progress_view.h b/components/media_message_center/media_controls_progress_view.h index cb81d68..ccd5329 100644 --- a/components/media_message_center/media_controls_progress_view.h +++ b/components/media_message_center/media_controls_progress_view.h
@@ -19,11 +19,16 @@ class COMPONENT_EXPORT(MEDIA_MESSAGE_CENTER) MediaControlsProgressView : public views::View { public: - MediaControlsProgressView(); + explicit MediaControlsProgressView( + base::RepeatingCallback<void(double)> seek_callback); ~MediaControlsProgressView() override; void UpdateProgress(const media_session::MediaPosition& media_position); + // views::View: + bool OnMousePressed(const ui::MouseEvent& event) override; + void OnGestureEvent(ui::GestureEvent* event) override; + const views::ProgressBar* progress_bar_for_testing() const; const base::string16& progress_time_for_testing() const; const base::string16& duration_for_testing() const; @@ -33,6 +38,8 @@ void SetProgressTime(const base::string16& time); void SetDuration(const base::string16& duration); + void HandleSeeking(const gfx::Point& location_in_bar); + views::ProgressBar* progress_bar_; views::Label* progress_time_; views::Label* duration_; @@ -40,6 +47,8 @@ // Timer to continually update the progress. base::RepeatingTimer update_progress_timer_; + const base::RepeatingCallback<void(double)> seek_callback_; + DISALLOW_COPY_AND_ASSIGN(MediaControlsProgressView); };
diff --git a/components/media_message_center/media_controls_progress_view_unittest.cc b/components/media_message_center/media_controls_progress_view_unittest.cc index 2638e96..1e13634 100644 --- a/components/media_message_center/media_controls_progress_view_unittest.cc +++ b/components/media_message_center/media_controls_progress_view_unittest.cc
@@ -4,6 +4,7 @@ #include "components/media_message_center/media_controls_progress_view.h" +#include "base/bind_helpers.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_task_environment.h" #include "base/time/time.h" @@ -37,7 +38,7 @@ views::View* container = new views::View(); widget_.SetContentsView(container); - progress_view_ = new MediaControlsProgressView(); + progress_view_ = new MediaControlsProgressView(base::DoNothing()); container->AddChildView(progress_view_); widget_.Show();
diff --git a/components/module_installer/android/BUILD.gn b/components/module_installer/android/BUILD.gn index 8041981a..7ddc070 100644 --- a/components/module_installer/android/BUILD.gn +++ b/components/module_installer/android/BUILD.gn
@@ -10,12 +10,16 @@ # build. android_library("module_installer_java") { java_files = [ + "java/src-stub/org/chromium/components/module_installer/ModuleActivityObserver.java", "java/src-stub/org/chromium/components/module_installer/ModuleInstallerImpl.java", "java/src-common/org/chromium/components/module_installer/ModuleInstaller.java", "java/src-common/org/chromium/components/module_installer/OnModuleInstallFinishedListener.java", "java/src-common/org/chromium/components/module_installer/Module.java", ] - jar_excluded_patterns = [ "*/ModuleInstallerImpl.class" ] + jar_excluded_patterns = [ + "*/ModuleInstallerImpl.class", + "*/ModuleActivityObserver.class", + ] deps = [ "//base:base_java", ] @@ -25,7 +29,10 @@ # Contains stub implementation to be used for builds not supporting modules # (e.g. APKs). android_library("module_installer_stub_java") { - java_files = [ "java/src-stub/org/chromium/components/module_installer/ModuleInstallerImpl.java" ] + java_files = [ + "java/src-stub/org/chromium/components/module_installer/ModuleActivityObserver.java", + "java/src-stub/org/chromium/components/module_installer/ModuleInstallerImpl.java", + ] deps = [ ":module_installer_java", "//base:base_java", @@ -41,6 +48,7 @@ "java/src-impl/org/chromium/components/module_installer/ModuleInstallerBackend.java", "java/src-impl/org/chromium/components/module_installer/FakeModuleInstallerBackend.java", "java/src-impl/org/chromium/components/module_installer/PlayCoreModuleInstallerBackend.java", + "java/src-impl/org/chromium/components/module_installer/ModuleActivityObserver.java", ] deps = [ ":module_installer_java",
diff --git a/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/ModuleActivityObserver.java b/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/ModuleActivityObserver.java new file mode 100644 index 0000000..6866479 --- /dev/null +++ b/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/ModuleActivityObserver.java
@@ -0,0 +1,50 @@ +// Copyright 2019 The Chromium 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.components.module_installer; + +import android.app.Activity; + +import org.chromium.base.ActivityState; +import org.chromium.base.ApplicationStatus; +import org.chromium.base.ThreadUtils; + +import java.util.HashSet; + +/** Observer for activities so that DFMs can be lazily installed on-demand. */ +public class ModuleActivityObserver implements ApplicationStatus.ActivityStateListener { + /** Tracks activities that have been splitcompatted. */ + private static HashSet<Integer> sActivityIds = new HashSet<Integer>(); + + @Override + public void onActivityStateChange(Activity activity, @ActivityState int newState) { + if (newState == ActivityState.CREATED || newState == ActivityState.RESUMED) { + splitCompatActivity(activity); + } else if (newState == ActivityState.DESTROYED) { + sActivityIds.remove(activity.hashCode()); + } + } + + /** Makes activities aware of a DFM install and prepare them to be able to use new modules. */ + public static void onModuleInstalled() { + ThreadUtils.assertOnUiThread(); + + sActivityIds.clear(); + + for (Activity activity : ApplicationStatus.getRunningActivities()) { + if (ApplicationStatus.getStateForActivity(activity) == ActivityState.RESUMED) { + splitCompatActivity(activity); + } + } + } + + /** Split Compats activities that have not yet been split compatted. */ + private static void splitCompatActivity(Activity activity) { + Integer key = activity.hashCode(); + if (!sActivityIds.contains(key)) { + sActivityIds.add(key); + ModuleInstallerImpl.getInstance().initActivity(activity); + } + } +} \ No newline at end of file
diff --git a/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/ModuleInstallerImpl.java b/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/ModuleInstallerImpl.java index 7e0b24c..c068f39 100644 --- a/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/ModuleInstallerImpl.java +++ b/components/module_installer/android/java/src-impl/org/chromium/components/module_installer/ModuleInstallerImpl.java
@@ -138,6 +138,8 @@ private void onFinished(boolean success, List<String> moduleNames) { ThreadUtils.assertOnUiThread(); + ModuleActivityObserver.onModuleInstalled(); + for (String moduleName : moduleNames) { List<OnModuleInstallFinishedListener> onFinishedListeners = mModuleNameListenerMap.get(moduleName); @@ -173,6 +175,5 @@ // they don't get sanitized. return TextUtils.join(",", moduleNames).replace('.', '$'); } - private ModuleInstallerImpl() {} }
diff --git a/components/module_installer/android/java/src-stub/org/chromium/components/module_installer/ModuleActivityObserver.java b/components/module_installer/android/java/src-stub/org/chromium/components/module_installer/ModuleActivityObserver.java new file mode 100644 index 0000000..49b9bd4 --- /dev/null +++ b/components/module_installer/android/java/src-stub/org/chromium/components/module_installer/ModuleActivityObserver.java
@@ -0,0 +1,25 @@ +// Copyright 2019 The Chromium 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.components.module_installer; + +import android.app.Activity; + +import org.chromium.base.ApplicationStatus; + +/** Dummy fallback of ActivityObserver. */ +public class ModuleActivityObserver implements ApplicationStatus.ActivityStateListener { + @Override + public void onActivityStateChange(Activity activity, int newState) { + // Do nothing. + } + + public static void onModuleInstalled() { + // Do nothing. + } + + public static void addObserver(Activity activity) { + // Do nothing. + } +} \ No newline at end of file
diff --git a/components/omnibox/browser/autocomplete_match.cc b/components/omnibox/browser/autocomplete_match.cc index c4bfb74..8e07c25 100644 --- a/components/omnibox/browser/autocomplete_match.cc +++ b/components/omnibox/browser/autocomplete_match.cc
@@ -726,6 +726,34 @@ } // static +bool AutocompleteMatch::AllowedToBeDefault(const AutocompleteInput& input, + AutocompleteMatch& match) { + if (match.inline_autocompletion.empty()) + return true; + if (input.prevent_inline_autocomplete()) + return false; + if (input.text().empty() || !base::IsUnicodeWhitespace(input.text().back())) + return true; + + // If we've reached here, the input ends in trailing whitespace. If the + // trailing whitespace prefixes |match.inline_autocompletion|, then allow the + // match to be default and remove the whitespace from + // |match.inline_autocompletion|. + size_t last_non_whitespace_pos = + input.text().find_last_not_of(base::kWhitespaceUTF16); + DCHECK_NE(last_non_whitespace_pos, std::string::npos); + auto whitespace_suffix = input.text().substr(last_non_whitespace_pos + 1); + if (base::StartsWith(match.inline_autocompletion, whitespace_suffix, + base::CompareCase::SENSITIVE)) { + match.inline_autocompletion = + match.inline_autocompletion.substr(whitespace_suffix.size()); + return true; + } + + return false; +} + +// static void AutocompleteMatch::LogSearchEngineUsed( const AutocompleteMatch& match, TemplateURLService* template_url_service) {
diff --git a/components/omnibox/browser/autocomplete_match.h b/components/omnibox/browser/autocomplete_match.h index d59c8ee..9fa7bda 100644 --- a/components/omnibox/browser/autocomplete_match.h +++ b/components/omnibox/browser/autocomplete_match.h
@@ -292,6 +292,20 @@ static url_formatter::FormatUrlTypes GetFormatTypes(bool preserve_scheme, bool preserve_subdomain); + // Determines whether a particular match is allowed to be the default match + // by comparing |input.text| and |match.inline_autocompletion|. Therefore, + // |match.inline_autocompletion| should be set prior to invoking this method. + // Also considers trailing whitespace in the input, so the input should not be + // fixed up. + // + // Input "x" will allow default matches "x", "xy", and "x y". + // Input "x " will allow default matches "x" and "x y". + // Input "x " will allow default match "x". + // Input "x y" will allow default match "x y". + // Input "x" with prevent_inline_autocomplete will allow default match "x". + static bool AllowedToBeDefault(const AutocompleteInput& input, + AutocompleteMatch& match); + // Logs the search engine used to navigate to a search page or auto complete // suggestion. For direct URL navigations, nothing is logged. static void LogSearchEngineUsed(const AutocompleteMatch& match,
diff --git a/components/omnibox/browser/builtin_provider.cc b/components/omnibox/browser/builtin_provider.cc index 5c34889..49fff26b 100644 --- a/components/omnibox/browser/builtin_provider.cc +++ b/components/omnibox/browser/builtin_provider.cc
@@ -128,7 +128,14 @@ // appropriate to be the default match, mark it as such and give it a high // enough score to beat url-what-you-typed. size_t default_match_index; - if (!HistoryProvider::PreventInlineAutocomplete(input) && + + // None of the built in site URLs contain whitespaces so we can safely prevent + // autocompletion when the input has a trailing whitespace in order to avoid + // autocompleting e.g. 'chrome://s ettings' when the input is 'chrome://s '. + bool input_allowed_to_have_default_match = + !input.prevent_inline_autocomplete() && + (input.text().empty() || !base::IsUnicodeWhitespace(input.text().back())); + if (input_allowed_to_have_default_match && HasMatchThatShouldBeDefault(&default_match_index)) { matches_[default_match_index].relevance = 1250; matches_[default_match_index].allowed_to_be_default_match = true;
diff --git a/components/omnibox/browser/history_provider.cc b/components/omnibox/browser/history_provider.cc index e17f6d0..9969cc8 100644 --- a/components/omnibox/browser/history_provider.cc +++ b/components/omnibox/browser/history_provider.cc
@@ -34,13 +34,6 @@ } // static -bool HistoryProvider::PreventInlineAutocomplete( - const AutocompleteInput& input) { - return input.prevent_inline_autocomplete() || - (!input.text().empty() && base::IsUnicodeWhitespace(input.text().back())); -} - -// static ACMatchClassifications HistoryProvider::SpansFromTermMatch( const TermMatches& matches, size_t text_length,
diff --git a/components/omnibox/browser/history_provider.h b/components/omnibox/browser/history_provider.h index 372a94a..1cf65f6 100644 --- a/components/omnibox/browser/history_provider.h +++ b/components/omnibox/browser/history_provider.h
@@ -13,7 +13,6 @@ #include "components/omnibox/browser/autocomplete_provider_client.h" #include "components/omnibox/browser/in_memory_url_index_types.h" -class AutocompleteInput; struct AutocompleteMatch; // This class is a base class for the history autocomplete providers and @@ -22,11 +21,6 @@ public: void DeleteMatch(const AutocompleteMatch& match) override; - // Returns true if inline autocompletion should be prevented for URL-like - // input. This method returns true if input.prevent_inline_autocomplete() - // is true or the input text contains trailing whitespace. - static bool PreventInlineAutocomplete(const AutocompleteInput& input); - // Fill and return an ACMatchClassifications structure given the |matches| // to highlight. // TODO (manukh) replace calls to SpansFromTermMatch with calls to
diff --git a/components/omnibox/browser/history_quick_provider.cc b/components/omnibox/browser/history_quick_provider.cc index ba0078bc..45bf4ee2 100644 --- a/components/omnibox/browser/history_quick_provider.cc +++ b/components/omnibox/browser/history_quick_provider.cc
@@ -233,8 +233,8 @@ if (inline_autocomplete_offset != base::string16::npos) { match.inline_autocompletion = match.fill_into_edit.substr(inline_autocomplete_offset); - match.allowed_to_be_default_match = match.inline_autocompletion.empty() || - !PreventInlineAutocomplete(autocomplete_input_); + match.allowed_to_be_default_match = + AutocompleteMatch::AllowedToBeDefault(autocomplete_input_, match); } // HistoryQuick classification diverges from relevance scoring. Specifically,
diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc index bb4272d2..e8033ee 100644 --- a/components/omnibox/browser/history_url_provider.cc +++ b/components/omnibox/browser/history_url_provider.cc
@@ -31,6 +31,7 @@ #include "components/omnibox/browser/autocomplete_provider.h" #include "components/omnibox/browser/autocomplete_provider_listener.h" #include "components/omnibox/browser/autocomplete_result.h" +#include "components/omnibox/browser/history_provider.h" #include "components/omnibox/browser/in_memory_url_index_types.h" #include "components/omnibox/browser/omnibox_field_trial.h" #include "components/omnibox/browser/url_prefix.h" @@ -443,13 +444,14 @@ HistoryURLProviderParams::HistoryURLProviderParams( const AutocompleteInput& input, + const AutocompleteInput& input_before_fixup, bool trim_http, const AutocompleteMatch& what_you_typed_match, const TemplateURL* default_search_provider, const SearchTermsData* search_terms_data) : origin_task_runner(base::SequencedTaskRunnerHandle::Get()), input(input), - prevent_inline_autocomplete(input.prevent_inline_autocomplete()), + input_before_fixup(input_before_fixup), trim_http(trim_http), what_you_typed_match(what_you_typed_match), failed(false), @@ -566,11 +568,8 @@ // onto the |params_| member for later deletion below if we need to run pass // 2. std::unique_ptr<HistoryURLProviderParams> params(new HistoryURLProviderParams( - fixed_up_input, trim_http, what_you_typed_match, default_search_provider, - search_terms_data)); - // Note that we use the non-fixed-up input here, since fixup may strip - // trailing whitespace. - params->prevent_inline_autocomplete = PreventInlineAutocomplete(input); + fixed_up_input, input, trim_http, what_you_typed_match, + default_search_provider, search_terms_data)); // Pass 1: Get the in-memory URL database, and use it to find and promote // the inline autocomplete match, if any. @@ -888,7 +887,7 @@ // params.have_what_you_typed_match is false, the SearchProvider should // take care of adding this defaultable match.) if ((params.promote_type == HistoryURLProviderParams::WHAT_YOU_TYPED_MATCH) || - (params.prevent_inline_autocomplete && + (!matches_.back().allowed_to_be_default_match && params.have_what_you_typed_match)) { matches_.push_back(params.what_you_typed_match); } @@ -1245,16 +1244,13 @@ // be default. const bool autocomplete_offset_valid = inline_autocomplete_offset != base::string16::npos; - if (!params.prevent_inline_autocomplete && autocomplete_offset_valid) { + if (autocomplete_offset_valid) { DCHECK(inline_autocomplete_offset <= match.fill_into_edit.length()); match.inline_autocompletion = match.fill_into_edit.substr(inline_autocomplete_offset); + match.allowed_to_be_default_match = + AutocompleteMatch::AllowedToBeDefault(params.input_before_fixup, match); } - // The latter part of the test effectively asks "is the inline completion - // empty?" (i.e., is this match effectively the what-you-typed match?). - match.allowed_to_be_default_match = autocomplete_offset_valid && - (!params.prevent_inline_autocomplete || - (inline_autocomplete_offset >= match.fill_into_edit.length())); const auto format_types = AutocompleteMatch::GetFormatTypes( params.input.parts().scheme.len > 0 || !params.trim_http ||
diff --git a/components/omnibox/browser/history_url_provider.h b/components/omnibox/browser/history_url_provider.h index 07b5c87..b8e9d39 100644 --- a/components/omnibox/browser/history_url_provider.h +++ b/components/omnibox/browser/history_url_provider.h
@@ -103,6 +103,7 @@ }; HistoryURLProviderParams(const AutocompleteInput& input, + const AutocompleteInput& input_before_fixup, bool trim_http, const AutocompleteMatch& what_you_typed_match, const TemplateURL* default_search_provider, @@ -118,11 +119,10 @@ // A copy of the autocomplete input. We need the copy since this object will // live beyond the original query while it runs on the history thread. AutocompleteInput input; - - // Should inline autocompletion be disabled? This is initalized from - // |input.prevent_inline_autocomplete()|, but set to false is the input - // contains trailing white space. - bool prevent_inline_autocomplete; + // |input_before_fixup| is needed for invoking + // |AutocompleteMatch::AllowedToBeDefault| which considers trailing input + // whitespaces which the fixed up |input| will have trimmed. + AutocompleteInput input_before_fixup; // Set when "http://" should be trimmed from the beginning of the URLs. bool trim_http;
diff --git a/components/omnibox/browser/history_url_provider_unittest.cc b/components/omnibox/browser/history_url_provider_unittest.cc index e8bdf8b..d8b9d2810 100644 --- a/components/omnibox/browser/history_url_provider_unittest.cc +++ b/components/omnibox/browser/history_url_provider_unittest.cc
@@ -13,6 +13,7 @@ #include "base/run_loop.h" #include "base/stl_util.h" #include "base/strings/string_util.h" +#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_task_environment.h" #include "base/time/time.h" @@ -165,6 +166,12 @@ {"https://www.wytih/page", "What you typed in history www page", 5, 5, 80}, {"ftp://wytih/file", "What you typed in history ftp file", 6, 6, 80}, {"https://www.wytih/file", "What you typed in history www file", 7, 7, 80}, + + // URLs containing whitespaces for inline autocompletion tests. + {"https://www.zebra.com/zebra", "zebra1", 7, 7, 80}, + {"https://www.zebra.com/zebras", "zebra2", 7, 7, 80}, + {"https://www.zebra.com/zebra s", "zebra3", 7, 7, 80}, + {"https://www.zebra.com/zebra s", "zebra4", 7, 7, 80}, }; } // namespace @@ -743,20 +750,87 @@ RunTest(ASCIIToUTF16("this is a query"), std::string(), false, nullptr, 0); } -TEST_F(HistoryURLProviderTest, DontAutocompleteOnTrailingWhitespace) { - AutocompleteInput input(ASCIIToUTF16("slash "), - metrics::OmniboxEventProto::OTHER, - TestSchemeClassifier()); - autocomplete_->Start(input, false); - if (!autocomplete_->done()) - base::RunLoop().Run(); +TEST_F(HistoryURLProviderTest, AutocompleteOnTrailingWhitespace) { + struct AutocompletionExpectation { + std::string fill_into_edit; + std::string inline_autocompletion; + bool allowed_to_be_default_match; + }; - // None of the matches should attempt to autocomplete. - matches_ = autocomplete_->matches(); - for (size_t i = 0; i < matches_.size(); ++i) { - EXPECT_TRUE(matches_[i].inline_autocompletion.empty()); - EXPECT_FALSE(matches_[i].allowed_to_be_default_match); - } + auto TestAutocompletion = + [this](std::string input_text, bool input_prevent_inline_autocomplete, + std::vector<AutocompletionExpectation> expectations) { + const std::string debug = base::StringPrintf( + "input text [%s], prevent inline [%d]", input_text.c_str(), + input_prevent_inline_autocomplete); + + AutocompleteInput input(ASCIIToUTF16(input_text), + metrics::OmniboxEventProto::OTHER, + TestSchemeClassifier()); + input.set_prevent_inline_autocomplete( + input_prevent_inline_autocomplete); + autocomplete_->Start(input, false); + if (!autocomplete_->done()) + base::RunLoop().Run(); + + matches_ = autocomplete_->matches(); + EXPECT_EQ(matches_.size(), expectations.size()) << debug; + for (size_t i = 0; i < matches_.size(); ++i) { + EXPECT_EQ(matches_[i].fill_into_edit, + ASCIIToUTF16(expectations[i].fill_into_edit)) + << debug; + if (matches_[i].allowed_to_be_default_match) { + EXPECT_EQ(matches_[i].inline_autocompletion, + ASCIIToUTF16(expectations[i].inline_autocompletion)) + << debug; + } + EXPECT_EQ(matches_[i].allowed_to_be_default_match, + expectations[i].allowed_to_be_default_match) + << debug; + } + }; + + TestAutocompletion("zebra.com/zebra", false, + { + {"zebra.com/zebra", "", true}, + {"https://www.zebra.com/zebras", "s", true}, + {"https://www.zebra.com/zebra s", " s", true}, + {"https://www.zebra.com/zebra s", " s", true}, + }); + + TestAutocompletion("zebra.com/zebra ", false, + { + {"zebra.com/zebra", "", true}, + {"https://www.zebra.com/zebras", "", false}, + {"https://www.zebra.com/zebra s", "s", true}, + {"https://www.zebra.com/zebra s", " s", true}, + }); + + TestAutocompletion("zebra.com/zebra ", false, + { + {"zebra.com/zebra", "", true}, + {"https://www.zebra.com/zebras", "", false}, + {"https://www.zebra.com/zebra s", "", false}, + {"https://www.zebra.com/zebra s", "s", true}, + }); + + TestAutocompletion("zebra.com/zebra", true, + { + {"zebra.com/zebra", "", true}, + {"https://www.zebra.com/zebras", "", false}, + {"https://www.zebra.com/zebra s", "", false}, + {"https://www.zebra.com/zebra s", "", false}, + }); + + TestAutocompletion("zebra.com/zebras", false, + { + {"zebra.com/zebras", "", true}, + }); + + TestAutocompletion("zebra.com/zebra s", false, + { + {"zebra.com/zebra s", "", true}, + }); } TEST_F(HistoryURLProviderTest, TreatEmailsAsSearches) { @@ -1235,7 +1309,7 @@ history_match.url_info.set_url(GURL(url_text)); history_match.match_in_scheme = match_in_scheme; auto params = std::make_unique<HistoryURLProviderParams>( - input, true, AutocompleteMatch(), nullptr, nullptr); + input, input, true, AutocompleteMatch(), nullptr, nullptr); params->matches.push_back(history_match); return params;
diff --git a/components/omnibox/browser/shortcuts_provider.cc b/components/omnibox/browser/shortcuts_provider.cc index 34c2867e..8e3a4a2 100644 --- a/components/omnibox/browser/shortcuts_provider.cc +++ b/components/omnibox/browser/shortcuts_provider.cc
@@ -331,8 +331,7 @@ match.inline_autocompletion = match.fill_into_edit.substr(inline_autocomplete_offset); match.allowed_to_be_default_match = - !HistoryProvider::PreventInlineAutocomplete(input) || - match.inline_autocompletion.empty(); + AutocompleteMatch::AllowedToBeDefault(input, match); } } }
diff --git a/components/omnibox/browser/shortcuts_provider_test_util.cc b/components/omnibox/browser/shortcuts_provider_test_util.cc index 1622478e..d63c82e0 100644 --- a/components/omnibox/browser/shortcuts_provider_test_util.cc +++ b/components/omnibox/browser/shortcuts_provider_test_util.cc
@@ -5,6 +5,7 @@ #include "components/omnibox/browser/shortcuts_provider_test_util.h" #include "base/run_loop.h" +#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "components/omnibox/browser/autocomplete_match.h" #include "components/omnibox/browser/shortcuts_backend.h" @@ -83,13 +84,22 @@ ACMatches ac_matches = provider->matches(); + std::string debug = base::StringPrintf( + "Input [%s], prevent inline [%d], matches:\n", + base::UTF16ToUTF8(text).c_str(), prevent_inline_autocomplete); + for (auto match : ac_matches) { + debug += base::StringPrintf(" URL [%s], default [%d]\n", + match.destination_url.spec().c_str(), + match.allowed_to_be_default_match); + } + // We should have gotten back at most // AutocompleteProvider::provider_max_matches(). - EXPECT_LE(ac_matches.size(), provider->provider_max_matches()); + EXPECT_LE(ac_matches.size(), provider->provider_max_matches()) << debug; // If the number of expected and actual matches aren't equal then we need // test no further, but let's do anyway so that we know which URLs failed. - EXPECT_EQ(expected_urls.size(), ac_matches.size()); + EXPECT_EQ(expected_urls.size(), ac_matches.size()) << debug; for (const auto& expected_url : expected_urls) { auto iter = std::find_if( @@ -98,15 +108,20 @@ return expected_url.first == match.destination_url.spec() && expected_url.second == match.allowed_to_be_default_match; }); - EXPECT_TRUE(iter != ac_matches.end()); + EXPECT_TRUE(iter != ac_matches.end()) + << debug + << base::StringPrintf("Expected URL [%s], default [%d]\n", + expected_url.first.c_str(), expected_url.second); } // See if we got the expected top scorer. if (!ac_matches.empty()) { std::partial_sort(ac_matches.begin(), ac_matches.begin() + 1, ac_matches.end(), AutocompleteMatch::MoreRelevant); - EXPECT_EQ(expected_top_result, ac_matches[0].destination_url.spec()); + EXPECT_EQ(expected_top_result, ac_matches[0].destination_url.spec()) + << debug; EXPECT_EQ(top_result_inline_autocompletion, - ac_matches[0].inline_autocompletion); + ac_matches[0].inline_autocompletion) + << debug; } }
diff --git a/components/omnibox/browser/titled_url_match_utils.cc b/components/omnibox/browser/titled_url_match_utils.cc index 88d6a770..b930eef 100644 --- a/components/omnibox/browser/titled_url_match_utils.cc +++ b/components/omnibox/browser/titled_url_match_utils.cc
@@ -81,8 +81,7 @@ match.inline_autocompletion = match.fill_into_edit.substr(inline_autocomplete_offset); match.allowed_to_be_default_match = - match.inline_autocompletion.empty() || - !HistoryProvider::PreventInlineAutocomplete(input); + AutocompleteMatch::AllowedToBeDefault(input, match); } match.description = titled_url_match.node->GetTitledUrlNodeTitle(); base::TrimWhitespace(match.description, base::TRIM_LEADING,
diff --git a/components/optimization_guide/BUILD.gn b/components/optimization_guide/BUILD.gn index 6e1e40a7..edb712bb 100644 --- a/components/optimization_guide/BUILD.gn +++ b/components/optimization_guide/BUILD.gn
@@ -39,6 +39,10 @@ "url_pattern_with_wildcards.h", ] + public_deps = [ + "//third_party/re2", + ] + deps = [ "//base", "//components/leveldb_proto",
diff --git a/components/optimization_guide/DEPS b/components/optimization_guide/DEPS index 5f16a15..37a9b834 100644 --- a/components/optimization_guide/DEPS +++ b/components/optimization_guide/DEPS
@@ -5,5 +5,6 @@ "+google_apis", "+net", "+services/network", + "+third_party/re2", "+third_party/smhasher", ]
diff --git a/components/optimization_guide/hints_component_util.cc b/components/optimization_guide/hints_component_util.cc index ad4d1c0..e409e84 100644 --- a/components/optimization_guide/hints_component_util.cc +++ b/components/optimization_guide/hints_component_util.cc
@@ -41,6 +41,67 @@ *out_status = status; } +// Attempts to construct a valid bloom filter from the given +// |optimization_filter|. If given, |out_status| will be populated with the +// status of the operation. If a valid bloom filter cannot be constructed, +// nullptr is returned. +std::unique_ptr<BloomFilter> ProcessBloomFilter( + const proto::OptimizationFilter& optimization_filter, + OptimizationFilterStatus* out_status) { + const auto& bloom_filter_proto = optimization_filter.bloom_filter(); + DCHECK_GT(bloom_filter_proto.num_hash_functions(), 0u); + DCHECK_GT(bloom_filter_proto.num_bits(), 0u); + DCHECK(bloom_filter_proto.has_data()); + + if (!bloom_filter_proto.has_data() || bloom_filter_proto.num_bits() <= 0 || + bloom_filter_proto.num_bits() > bloom_filter_proto.data().size() * 8) { + DLOG(ERROR) << "Bloom filter config issue"; + PopulateOptimizationFilterStatusIfSet( + OptimizationFilterStatus::kFailedServerBlacklistBadConfig, out_status); + return nullptr; + } + + if (static_cast<int>(bloom_filter_proto.num_bits()) > + features::MaxServerBloomFilterByteSize() * 8) { + DLOG(ERROR) << "Bloom filter data exceeds maximum size of " + << optimization_guide::features::MaxServerBloomFilterByteSize() + << " bytes"; + PopulateOptimizationFilterStatusIfSet( + OptimizationFilterStatus::kFailedServerBlacklistTooBig, out_status); + return nullptr; + } + + std::unique_ptr<BloomFilter> bloom_filter = std::make_unique<BloomFilter>( + bloom_filter_proto.num_hash_functions(), bloom_filter_proto.num_bits(), + bloom_filter_proto.data()); + PopulateOptimizationFilterStatusIfSet( + OptimizationFilterStatus::kCreatedServerBlacklist, out_status); + return bloom_filter; +} + +// Attempts to construct a valid RegexpList from the given +// |optimization_filter|. If given, |out_status| will be populated with the +// status of the operation. If a valid RegexpList cannot be constructed, nullptr +// is returned. +std::unique_ptr<RegexpList> ProcessRegexps( + const proto::OptimizationFilter& optimization_filter, + OptimizationFilterStatus* out_status) { + std::unique_ptr<RegexpList> regexps = std::make_unique<RegexpList>(); + for (int i = 0; i < optimization_filter.regexps_size(); ++i) { + regexps->emplace_back( + std::make_unique<re2::RE2>(optimization_filter.regexps(i))); + if (!regexps->at(i)->ok()) { + PopulateOptimizationFilterStatusIfSet( + OptimizationFilterStatus::kInvalidRegexp, out_status); + return nullptr; + } + } + + PopulateOptimizationFilterStatusIfSet( + OptimizationFilterStatus::kCreatedServerBlacklist, out_status); + return regexps; +} + } // namespace const char kComponentHintsUpdatedResultHistogramString[] = @@ -93,35 +154,22 @@ std::unique_ptr<OptimizationFilter> ProcessOptimizationFilter( const proto::OptimizationFilter& optimization_filter, OptimizationFilterStatus* out_status) { - const auto& bloom_filter_proto = optimization_filter.bloom_filter(); - DCHECK_GT(bloom_filter_proto.num_hash_functions(), 0u); - DCHECK_GT(bloom_filter_proto.num_bits(), 0u); - DCHECK(bloom_filter_proto.has_data()); - - if (!bloom_filter_proto.has_data() || bloom_filter_proto.num_bits() <= 0 || - bloom_filter_proto.num_bits() > bloom_filter_proto.data().size() * 8) { - DLOG(ERROR) << "Bloom filter config issue"; - PopulateOptimizationFilterStatusIfSet( - OptimizationFilterStatus::kFailedServerBlacklistBadConfig, out_status); - return nullptr; + std::unique_ptr<BloomFilter> bloom_filter; + if (optimization_filter.has_bloom_filter()) { + bloom_filter = ProcessBloomFilter(optimization_filter, out_status); + if (!bloom_filter) + return nullptr; } - if (static_cast<int>(bloom_filter_proto.num_bits()) > - features::MaxServerBloomFilterByteSize() * 8) { - DLOG(ERROR) << "Bloom filter data exceeds maximum size of " - << optimization_guide::features::MaxServerBloomFilterByteSize() - << " bytes"; - PopulateOptimizationFilterStatusIfSet( - OptimizationFilterStatus::kFailedServerBlacklistTooBig, out_status); - return nullptr; + std::unique_ptr<RegexpList> regexps; + if (optimization_filter.regexps_size() > 0) { + regexps = ProcessRegexps(optimization_filter, out_status); + if (!regexps) + return nullptr; } - std::unique_ptr<BloomFilter> bloom_filter = std::make_unique<BloomFilter>( - bloom_filter_proto.num_hash_functions(), bloom_filter_proto.num_bits(), - bloom_filter_proto.data()); - PopulateOptimizationFilterStatusIfSet( - OptimizationFilterStatus::kCreatedServerBlacklist, out_status); - return std::make_unique<OptimizationFilter>(std::move(bloom_filter)); + return std::make_unique<OptimizationFilter>(std::move(bloom_filter), + std::move(regexps)); } } // namespace optimization_guide
diff --git a/components/optimization_guide/hints_component_util.h b/components/optimization_guide/hints_component_util.h index ac31f37..680d690 100644 --- a/components/optimization_guide/hints_component_util.h +++ b/components/optimization_guide/hints_component_util.h
@@ -62,9 +62,10 @@ kFailedServerBlacklistBadConfig, kFailedServerBlacklistTooBig, kFailedServerBlacklistDuplicateConfig, + kInvalidRegexp, // Insert new values before this line. - kMaxValue = kFailedServerBlacklistDuplicateConfig, + kMaxValue = kInvalidRegexp, }; // Records the OptimizationFilterStatus to UMA.
diff --git a/components/optimization_guide/hints_component_util_unittest.cc b/components/optimization_guide/hints_component_util_unittest.cc index 6c89b8e..9cece8d 100644 --- a/components/optimization_guide/hints_component_util_unittest.cc +++ b/components/optimization_guide/hints_component_util_unittest.cc
@@ -171,8 +171,7 @@ EXPECT_EQ(status, OptimizationFilterStatus::kCreatedServerBlacklist); ASSERT_TRUE(optimization_filter); - EXPECT_TRUE( - optimization_filter->ContainsHostSuffix(GURL("https://m.black.com"))); + EXPECT_TRUE(optimization_filter->Matches(GURL("https://m.black.com"))); } TEST_F(HintsComponentUtilTest, ProcessOptimizationFilterWithBadNumBits) { @@ -196,6 +195,57 @@ EXPECT_EQ(nullptr, optimization_filter); } +TEST_F(HintsComponentUtilTest, ProcessOptimizationFilterWithRegexps) { + proto::OptimizationFilter optimization_filter_proto; + optimization_filter_proto.add_regexps("test"); + + OptimizationFilterStatus status; + std::unique_ptr<OptimizationFilter> optimization_filter = + ProcessOptimizationFilter(optimization_filter_proto, &status); + + EXPECT_EQ(status, OptimizationFilterStatus::kCreatedServerBlacklist); + ASSERT_TRUE(optimization_filter); + EXPECT_TRUE(optimization_filter->Matches(GURL("https://test.com"))); +} + +TEST_F(HintsComponentUtilTest, ProcessOptimizationFilterWithInvalidRegexps) { + proto::OptimizationFilter optimization_filter_proto; + optimization_filter_proto.add_regexps("test["); + + OptimizationFilterStatus status; + std::unique_ptr<OptimizationFilter> optimization_filter = + ProcessOptimizationFilter(optimization_filter_proto, &status); + + EXPECT_EQ(status, OptimizationFilterStatus::kInvalidRegexp); + EXPECT_EQ(nullptr, optimization_filter); +} + +TEST_F(HintsComponentUtilTest, + ProcessOptimizationFilterInvalidRegexpsOverridesBloomFilterStatus) { + int num_hash_functions = 7; + int num_bits = 1234; + + proto::OptimizationFilter optimization_filter_proto; + optimization_filter_proto.add_regexps("test["); + BloomFilter bloom_filter(num_hash_functions, num_bits); + bloom_filter.Add("black.com"); + proto::BloomFilter* bloom_filter_proto = + optimization_filter_proto.mutable_bloom_filter(); + bloom_filter_proto->set_num_hash_functions(num_hash_functions); + bloom_filter_proto->set_num_bits(num_bits); + std::string blacklist_data( + reinterpret_cast<const char*>(&bloom_filter.bytes()[0]), + bloom_filter.bytes().size()); + bloom_filter_proto->set_data(blacklist_data); + + OptimizationFilterStatus status; + std::unique_ptr<OptimizationFilter> optimization_filter = + ProcessOptimizationFilter(optimization_filter_proto, &status); + + EXPECT_EQ(status, OptimizationFilterStatus::kInvalidRegexp); + EXPECT_EQ(nullptr, optimization_filter); +} + TEST_F(HintsComponentUtilTest, ProcessOptimizationFilterWithTooLargeBlacklist) { int too_many_bits = features::MaxServerBloomFilterByteSize() * 8 + 1; @@ -241,8 +291,7 @@ /*out_status=*/nullptr); ASSERT_TRUE(optimization_filter); - EXPECT_TRUE( - optimization_filter->ContainsHostSuffix(GURL("https://m.black.com"))); + EXPECT_TRUE(optimization_filter->Matches(GURL("https://m.black.com"))); } } // namespace optimization_guide
diff --git a/components/optimization_guide/optimization_filter.cc b/components/optimization_guide/optimization_filter.cc index 701b5a3..801e1e24 100644 --- a/components/optimization_guide/optimization_filter.cc +++ b/components/optimization_guide/optimization_filter.cc
@@ -2,9 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/optimization_guide/optimization_filter.h" + #include <string> -#include "components/optimization_guide/optimization_filter.h" +#include "base/strings/string_util.h" namespace optimization_guide { @@ -15,8 +17,9 @@ const int kMinHostSuffix = 6; // eg., abc.tv OptimizationFilter::OptimizationFilter( - std::unique_ptr<BloomFilter> bloom_filter) - : bloom_filter_(std::move(bloom_filter)) { + std::unique_ptr<BloomFilter> bloom_filter, + std::unique_ptr<RegexpList> regexps) + : bloom_filter_(std::move(bloom_filter)), regexps_(std::move(regexps)) { // May be created on one thread but used on another. The first call to // CalledOnValidSequence() will re-bind it. DETACH_FROM_SEQUENCE(sequence_checker_); @@ -26,9 +29,16 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } +bool OptimizationFilter::Matches(const GURL& url) const { + return ContainsHostSuffix(url) || MatchesRegexp(url); +} + bool OptimizationFilter::ContainsHostSuffix(const GURL& url) const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!bloom_filter_) + return false; + // First check full host name. if (bloom_filter_->Contains(url.host())) return true; @@ -51,4 +61,26 @@ return false; } +bool OptimizationFilter::MatchesRegexp(const GURL& url) const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!regexps_) + return false; + + if (!url.is_valid()) + return false; + + std::string clean_url = base::ToLowerASCII(url.GetAsReferrer().spec()); + for (auto& regexp : *regexps_) { + if (!regexp->ok()) { + continue; + } + + if (re2::RE2::PartialMatch(clean_url, *regexp)) { + return true; + } + } + + return false; +} + } // namespace optimization_guide
diff --git a/components/optimization_guide/optimization_filter.h b/components/optimization_guide/optimization_filter.h index aa0bd858..9b93aacb 100644 --- a/components/optimization_guide/optimization_filter.h +++ b/components/optimization_guide/optimization_filter.h
@@ -5,15 +5,21 @@ #ifndef COMPONENTS_OPTIMIZATION_GUIDE_OPTIMIZATION_FILTER_H_ #define COMPONENTS_OPTIMIZATION_GUIDE_OPTIMIZATION_FILTER_H_ +#include <memory> +#include <vector> + #include "base/macros.h" #include "base/sequence_checker.h" #include "components/optimization_guide/bloom_filter.h" +#include "third_party/re2/src/re2/re2.h" #include "url/gurl.h" namespace optimization_guide { -// OptimizationFilter is a simple filter for keeping track of a set of strings -// that are represented by a Bloom filter. This class has a 1:1 mapping with an +typedef std::vector<std::unique_ptr<re2::RE2>> RegexpList; + +// OptimizationFilter represents a filter with two underlying implementations: a +// Bloom filter and a set of regexps. This class has a 1:1 mapping with an // OptimizationFilter protobuf message where this is the logical implementation // of the proto data. // @@ -21,10 +27,15 @@ // components/blacklist/. class OptimizationFilter { public: - explicit OptimizationFilter(std::unique_ptr<BloomFilter> bloom_filter); + explicit OptimizationFilter(std::unique_ptr<BloomFilter> bloom_filter, + std::unique_ptr<RegexpList> regexps); - virtual ~OptimizationFilter(); + ~OptimizationFilter(); + // Returns true if the given url is matched by this filter. + bool Matches(const GURL& url) const; + + private: // Returns whether this filter contains a host suffix for the host part // of |url|. It will check at most 5 host suffixes and it may ignore simple // top level domain matches (such as "com" or "co.in"). @@ -36,13 +47,15 @@ // "www.company.co.in" // "company.co.in" // This method will return true if any of those suffixes are present. - // - // Virtual for testing. - virtual bool ContainsHostSuffix(const GURL& url) const; + bool ContainsHostSuffix(const GURL& url) const; - private: + // Returns whether this filter contains a regexp that matches the given url. + bool MatchesRegexp(const GURL& url) const; + std::unique_ptr<BloomFilter> bloom_filter_; + std::unique_ptr<RegexpList> regexps_; + SEQUENCE_CHECKER(sequence_checker_); DISALLOW_COPY_AND_ASSIGN(OptimizationFilter);
diff --git a/components/optimization_guide/optimization_filter_unittest.cc b/components/optimization_guide/optimization_filter_unittest.cc index 79a01442..c1e29d95c 100644 --- a/components/optimization_guide/optimization_filter_unittest.cc +++ b/components/optimization_guide/optimization_filter_unittest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "components/optimization_guide/optimization_filter.h" + #include "base/macros.h" #include "components/optimization_guide/bloom_filter.h" #include "testing/gtest/include/gtest/gtest.h" @@ -18,44 +19,81 @@ return filter; } -TEST(OptimizationFilterTest, TestContainsHostSuffix) { - std::unique_ptr<BloomFilter> bloom_filter(CreateBloomFilter()); - bloom_filter->Add("fooco.co.uk"); - OptimizationFilter opt_filter(std::move(bloom_filter)); - EXPECT_TRUE( - opt_filter.ContainsHostSuffix(GURL("http://shopping.fooco.co.uk"))); - EXPECT_TRUE(opt_filter.ContainsHostSuffix( - GURL("https://shopping.fooco.co.uk/somepath"))); - EXPECT_TRUE(opt_filter.ContainsHostSuffix(GURL("https://fooco.co.uk"))); - EXPECT_FALSE(opt_filter.ContainsHostSuffix(GURL("https://nonfooco.co.uk"))); +std::unique_ptr<RegexpList> CreateRegexps( + const std::vector<std::string>& regexps) { + std::unique_ptr<RegexpList> regexp_list = std::make_unique<RegexpList>(); + for (const std::string& regexp : regexps) { + regexp_list->emplace_back(std::make_unique<re2::RE2>(regexp)); + } + return regexp_list; } -TEST(OptimizationFilterTest, TestContainsHostSuffixMaxSuffix) { +TEST(OptimizationFilterTest, TestMatchesBloomFilter) { + std::unique_ptr<BloomFilter> bloom_filter(CreateBloomFilter()); + bloom_filter->Add("fooco.co.uk"); + OptimizationFilter opt_filter(std::move(bloom_filter), nullptr); + EXPECT_TRUE(opt_filter.Matches(GURL("http://shopping.fooco.co.uk"))); + EXPECT_TRUE( + opt_filter.Matches(GURL("https://shopping.fooco.co.uk/somepath"))); + EXPECT_TRUE(opt_filter.Matches(GURL("https://fooco.co.uk"))); + EXPECT_FALSE(opt_filter.Matches(GURL("https://nonfooco.co.uk"))); +} + +TEST(OptimizationFilterTest, TestMatchesRegexp) { + std::unique_ptr<RegexpList> regexps(CreateRegexps({"test"})); + OptimizationFilter opt_filter(nullptr, std::move(regexps)); + EXPECT_TRUE(opt_filter.Matches(GURL("http://test.com"))); + EXPECT_TRUE(opt_filter.Matches(GURL("https://shopping.com/test"))); + EXPECT_TRUE(opt_filter.Matches(GURL("https://shopping.com/?query=test"))); + EXPECT_FALSE(opt_filter.Matches(GURL("https://shopping.com/"))); +} + +TEST(OptimizationFilterTest, TestMatchesRegexpFragment) { + std::unique_ptr<RegexpList> regexps(CreateRegexps({"test"})); + OptimizationFilter opt_filter(nullptr, std::move(regexps)); + // Fragments are not matched. + EXPECT_FALSE(opt_filter.Matches(GURL("https://shopping.com/#test"))); +} + +TEST(OptimizationFilterTest, TestMatchesRegexpInvalid) { + std::unique_ptr<RegexpList> regexps(CreateRegexps({"test[", "shop"})); + OptimizationFilter opt_filter(nullptr, std::move(regexps)); + // Invalid regexps are not used + EXPECT_FALSE(opt_filter.Matches(GURL("https://test.com/"))); + EXPECT_TRUE(opt_filter.Matches(GURL("https://shopping.com/"))); +} + +TEST(OptimizationFilterTest, TestMatchesRegexpInvalidGURL) { + std::unique_ptr<RegexpList> regexps(CreateRegexps({"test"})); + OptimizationFilter opt_filter(nullptr, std::move(regexps)); + // Invalid urls are not matched. + EXPECT_FALSE(opt_filter.Matches(GURL("test"))); +} + +TEST(OptimizationFilterTest, TestMatchesMaxSuffix) { std::unique_ptr<BloomFilter> bloom_filter(CreateBloomFilter()); bloom_filter->Add("one.two.three.four.co.uk"); bloom_filter->Add("one.two.three.four.five.co.uk"); - OptimizationFilter opt_filter(std::move(bloom_filter)); - EXPECT_TRUE(opt_filter.ContainsHostSuffix( - GURL("http://host.one.two.three.four.co.uk"))); - EXPECT_FALSE(opt_filter.ContainsHostSuffix( - GURL("http://host.one.two.three.four.five.co.uk"))); + OptimizationFilter opt_filter(std::move(bloom_filter), nullptr); + EXPECT_TRUE(opt_filter.Matches(GURL("http://host.one.two.three.four.co.uk"))); + EXPECT_FALSE( + opt_filter.Matches(GURL("http://host.one.two.three.four.five.co.uk"))); // Note: full host will match even if more than 5 elements. - EXPECT_TRUE(opt_filter.ContainsHostSuffix( - GURL("http://one.two.three.four.five.co.uk"))); + EXPECT_TRUE(opt_filter.Matches(GURL("http://one.two.three.four.five.co.uk"))); } -TEST(OptimizationFilterTest, TestContainsHostSuffixMinSuffix) { +TEST(OptimizationFilterTest, TestMatchesMinSuffix) { std::unique_ptr<BloomFilter> bloom_filter(CreateBloomFilter()); bloom_filter->Add("abc.tv"); bloom_filter->Add("xy.tv"); - OptimizationFilter opt_filter(std::move(bloom_filter)); - EXPECT_TRUE(opt_filter.ContainsHostSuffix(GURL("https://abc.tv"))); - EXPECT_TRUE(opt_filter.ContainsHostSuffix(GURL("https://host.abc.tv"))); - EXPECT_FALSE(opt_filter.ContainsHostSuffix(GURL("https://host.xy.tv"))); + OptimizationFilter opt_filter(std::move(bloom_filter), nullptr); + EXPECT_TRUE(opt_filter.Matches(GURL("https://abc.tv"))); + EXPECT_TRUE(opt_filter.Matches(GURL("https://host.abc.tv"))); + EXPECT_FALSE(opt_filter.Matches(GURL("https://host.xy.tv"))); // Note: full host will match even if less than min size. - EXPECT_TRUE(opt_filter.ContainsHostSuffix(GURL("https://xy.tv"))); + EXPECT_TRUE(opt_filter.Matches(GURL("https://xy.tv"))); } } // namespace
diff --git a/components/optimization_guide/proto/hints.proto b/components/optimization_guide/proto/hints.proto index 2f4ea430..8175f42 100644 --- a/components/optimization_guide/proto/hints.proto +++ b/components/optimization_guide/proto/hints.proto
@@ -243,6 +243,9 @@ optional OptimizationType optimization_type = 1; // The filter data represented as a Bloom filter. optional BloomFilter bloom_filter = 2; + // Additional filters represented as regexps matched against the main page + // URL. + repeated string regexps = 3; } message Configuration {
diff --git a/components/prefs/pref_notifier_impl.cc b/components/prefs/pref_notifier_impl.cc index 0291e04b..9c753e71 100644 --- a/components/prefs/pref_notifier_impl.cc +++ b/components/prefs/pref_notifier_impl.cc
@@ -4,9 +4,11 @@ #include "components/prefs/pref_notifier_impl.h" +#include "base/debug/alias.h" #include "base/debug/dump_without_crashing.h" #include "base/logging.h" #include "base/memory/ptr_util.h" +#include "base/strings/strcat.h" #include "components/prefs/pref_service.h" PrefNotifierImpl::PrefNotifierImpl() : pref_service_(nullptr) {} @@ -33,8 +35,10 @@ // leaked on termination, it is guaranteed that they don't attempt to // unsubscribe. const auto& pref_name = observer_list.first; - LOG(WARNING) << "Pref observer for " << pref_name - << " found at shutdown."; + std::string message = base::StrCat( + {"Pref observer for ", pref_name, " found at shutdown."}); + LOG(WARNING) << message; + DEBUG_ALIAS_FOR_CSTR(aliased_message, message.c_str(), 128); // TODO(crbug.com/942491, 946668, 945772) The following code collects // stacktraces that show how the profile is destroyed that owns
diff --git a/components/previews/content/previews_hints.cc b/components/previews/content/previews_hints.cc index a57cd91..6244270c 100644 --- a/components/previews/content/previews_hints.cc +++ b/components/previews/content/previews_hints.cc
@@ -218,8 +218,7 @@ ConvertProtoOptimizationTypeToPreviewsType( blacklist.optimization_type()); if (previews_type == PreviewsType::LITE_PAGE_REDIRECT && - previews::params::IsLitePageServerPreviewsEnabled() && - blacklist.has_bloom_filter()) { + previews::params::IsLitePageServerPreviewsEnabled()) { RecordOptimizationFilterStatus( blacklist.optimization_type(), optimization_guide::OptimizationFilterStatus:: @@ -331,7 +330,7 @@ return true; } - return lite_page_redirect_blacklist_->ContainsHostSuffix(url); + return lite_page_redirect_blacklist_->Matches(url); } return false;
diff --git a/components/previews/content/previews_hints_unittest.cc b/components/previews/content/previews_hints_unittest.cc index e4013f1..6ad8a11 100644 --- a/components/previews/content/previews_hints_unittest.cc +++ b/components/previews/content/previews_hints_unittest.cc
@@ -5,6 +5,7 @@ #include "components/previews/content/previews_hints.h" #include <string> +#include <vector> #include "base/bind.h" #include "base/command_line.h" @@ -58,6 +59,22 @@ blacklist_proto->set_allocated_bloom_filter(bloom_filter_proto.release()); } +void AddRegexpsFilterToConfig(optimization_guide::proto::Configuration* config, + const std::vector<std::string>& regexps) { + optimization_guide::proto::OptimizationFilter* blacklist_proto; + if (config->optimization_blacklists_size() > 0) { + blacklist_proto = config->mutable_optimization_blacklists(0); + } else { + blacklist_proto = config->add_optimization_blacklists(); + blacklist_proto->set_optimization_type( + optimization_guide::proto::LITE_PAGE_REDIRECT); + } + + for (const std::string& regexp : regexps) { + blacklist_proto->add_regexps(regexp); + } +} + } // namespace class PreviewsHintsTest @@ -278,7 +295,36 @@ GURL("https://nonblack.com"), PreviewsType::LITE_PAGE_REDIRECT)); } -TEST_F(PreviewsHintsTest, IsBlacklisted) { +TEST_F(PreviewsHintsTest, IsBlacklisted_BloomFilterAndRegexps) { + base::test::ScopedFeatureList scoped_list; + scoped_list.InitAndEnableFeature(features::kLitePageServerPreviews); + + optimization_guide::BloomFilter blacklist_bloom_filter( + kBlackBlacklistBloomFilterNumHashFunctions, + kBlackBlacklistBloomFilterNumBits); + PopulateBlackBlacklistBloomFilter(&blacklist_bloom_filter); + + optimization_guide::proto::Configuration config; + AddBlacklistBloomFilterToConfig(blacklist_bloom_filter, + kBlackBlacklistBloomFilterNumHashFunctions, + kBlackBlacklistBloomFilterNumBits, &config); + AddRegexpsFilterToConfig(&config, {"blackpath"}); + ParseConfig(config); + + EXPECT_TRUE(HasLitePageRedirectBlacklist()); + EXPECT_FALSE(previews_hints()->IsBlacklisted(GURL("https://black.com/path"), + PreviewsType::OFFLINE)); + EXPECT_TRUE(previews_hints()->IsBlacklisted( + GURL("https://black.com/path"), PreviewsType::LITE_PAGE_REDIRECT)); + EXPECT_TRUE(previews_hints()->IsBlacklisted( + GURL("https://joe.black.com/path"), PreviewsType::LITE_PAGE_REDIRECT)); + EXPECT_FALSE(previews_hints()->IsBlacklisted( + GURL("https://ok-host.com/"), PreviewsType::LITE_PAGE_REDIRECT)); + EXPECT_TRUE(previews_hints()->IsBlacklisted( + GURL("https://ok-host.com/blackpath"), PreviewsType::LITE_PAGE_REDIRECT)); +} + +TEST_F(PreviewsHintsTest, IsBlacklisted_BloomFilter) { base::test::ScopedFeatureList scoped_list; scoped_list.InitAndEnableFeature(features::kLitePageServerPreviews); @@ -304,6 +350,47 @@ GURL("https://nonblack.com"), PreviewsType::LITE_PAGE_REDIRECT)); } +TEST_F(PreviewsHintsTest, IsBlacklisted_Regexps) { + base::test::ScopedFeatureList scoped_list; + scoped_list.InitAndEnableFeature(features::kLitePageServerPreviews); + + optimization_guide::proto::Configuration config; + AddRegexpsFilterToConfig(&config, {"black\\.com"}); + ParseConfig(config); + + EXPECT_TRUE(HasLitePageRedirectBlacklist()); + EXPECT_FALSE(previews_hints()->IsBlacklisted(GURL("https://black.com/path"), + PreviewsType::OFFLINE)); + EXPECT_TRUE(previews_hints()->IsBlacklisted( + GURL("https://black.com/path"), PreviewsType::LITE_PAGE_REDIRECT)); + EXPECT_TRUE(previews_hints()->IsBlacklisted( + GURL("https://joe.black.com/path"), PreviewsType::LITE_PAGE_REDIRECT)); + EXPECT_FALSE(previews_hints()->IsBlacklisted( + GURL("https://blackish.com"), PreviewsType::LITE_PAGE_REDIRECT)); +} + +TEST_F(PreviewsHintsTest, ParseConfigWithBadRegexp) { + base::HistogramTester histogram_tester; + base::test::ScopedFeatureList scoped_list; + scoped_list.InitAndEnableFeature(features::kLitePageServerPreviews); + + optimization_guide::proto::Configuration config; + AddRegexpsFilterToConfig(&config, {"["}); + ParseConfig(config); + + histogram_tester.ExpectBucketCount( + "OptimizationGuide.OptimizationFilterStatus.LitePageRedirect", + optimization_guide::OptimizationFilterStatus::kFoundServerBlacklistConfig, + 1); + histogram_tester.ExpectBucketCount( + "OptimizationGuide.OptimizationFilterStatus.LitePageRedirect", + optimization_guide::OptimizationFilterStatus::kInvalidRegexp, 1); + histogram_tester.ExpectTotalCount( + "OptimizationGuide.OptimizationFilterStatus.LitePageRedirect", 2); + + EXPECT_FALSE(HasLitePageRedirectBlacklist()); +} + TEST_F(PreviewsHintsTest, ParseConfigWithInsufficientConfigDetails) { base::HistogramTester histogram_tester; base::test::ScopedFeatureList scoped_list;
diff --git a/components/subresource_filter/content/browser/subframe_navigation_filtering_throttle.cc b/components/subresource_filter/content/browser/subframe_navigation_filtering_throttle.cc index 345053a2..d2ea2635 100644 --- a/components/subresource_filter/content/browser/subframe_navigation_filtering_throttle.cc +++ b/components/subresource_filter/content/browser/subframe_navigation_filtering_throttle.cc
@@ -54,17 +54,29 @@ content::NavigationThrottle::ThrottleCheckResult SubframeNavigationFilteringThrottle::WillStartRequest() { - return DeferToCalculateLoadPolicy(); + return MaybeDeferToCalculateLoadPolicy(); } content::NavigationThrottle::ThrottleCheckResult SubframeNavigationFilteringThrottle::WillRedirectRequest() { - return DeferToCalculateLoadPolicy(); + return MaybeDeferToCalculateLoadPolicy(); } content::NavigationThrottle::ThrottleCheckResult SubframeNavigationFilteringThrottle::WillProcessResponse() { DCHECK_NE(load_policy_, LoadPolicy::DISALLOW); + + // Load policy notifications should go out by WillProcessResponse, + // defer if we are still performing any ruleset checks. If we are here, + // and there are outstanding load policy calculations, we are in dry run + // mode. + if (pending_load_policy_calculations_ > 0) { + DCHECK((parent_frame_filter_->activation_state().activation_level == + mojom::ActivationLevel::kDryRun)); + DeferStart(DeferStage::kWillProcessResponse); + return DEFER; + } + NotifyLoadPolicy(); return PROCEED; } @@ -73,48 +85,97 @@ return "SubframeNavigationFilteringThrottle"; } +void SubframeNavigationFilteringThrottle::HandleDisallowedLoad() { + if (parent_frame_filter_->activation_state().enable_logging) { + std::string console_message = base::StringPrintf( + kDisallowSubframeConsoleMessageFormat, + navigation_handle()->GetURL().possibly_invalid_spec().c_str()); + navigation_handle()->GetWebContents()->GetMainFrame()->AddMessageToConsole( + blink::mojom::ConsoleMessageLevel::kError, console_message); + } + + parent_frame_filter_->ReportDisallowedLoad(); +} + content::NavigationThrottle::ThrottleCheckResult -SubframeNavigationFilteringThrottle::DeferToCalculateLoadPolicy() { +SubframeNavigationFilteringThrottle::MaybeDeferToCalculateLoadPolicy() { DCHECK_NE(load_policy_, LoadPolicy::DISALLOW); if (load_policy_ == LoadPolicy::WOULD_DISALLOW) return PROCEED; + + pending_load_policy_calculations_ += 1; parent_frame_filter_->GetLoadPolicyForSubdocument( navigation_handle()->GetURL(), base::BindOnce( &SubframeNavigationFilteringThrottle::OnCalculatedLoadPolicy, weak_ptr_factory_.GetWeakPtr())); - last_defer_timestamp_ = base::TimeTicks::Now(); - return DEFER; + + // If the embedder document has activation enabled, we calculate frame load + // policy before proceeding with navigation as filtered navigations are not + // allowed to get a response. As a result, we must defer while + // we wait for the ruleset check to complete and pass handling the navigation + // decision to the callback. + if (parent_frame_filter_->activation_state().activation_level == + mojom::ActivationLevel::kEnabled) { + DeferStart(DeferStage::kWillStartOrRedirectRequest); + return DEFER; + } + + // Otherwise, issue the ruleset request in parallel as an optimization. + return PROCEED; } void SubframeNavigationFilteringThrottle::OnCalculatedLoadPolicy( LoadPolicy policy) { + load_policy_ = MoreRestrictiveLoadPolicy(policy, load_policy_); + pending_load_policy_calculations_ -= 1; + + // Callback is not responsible for handling navigation if we are not deferred. + if (defer_stage_ == DeferStage::kNotDeferring) + return; + + // When we are deferred, callback is not responsible for handling navigation + // if there are still outstanding load policy calculations. + if (pending_load_policy_calculations_ > 0) { + // We defer waiting for each load policy calculations when the embedder + // document has activation enabled. + DCHECK(parent_frame_filter_->activation_state().activation_level != + mojom::ActivationLevel::kEnabled); + return; + } + + // If we are deferred and there are no pending load policy calculations, + // handle the deferred navigation. + DCHECK(defer_stage_ == DeferStage::kWillProcessResponse || + defer_stage_ == DeferStage::kWillStartOrRedirectRequest); DCHECK(!last_defer_timestamp_.is_null()); - load_policy_ = policy; + bool deferring_response = defer_stage_ == DeferStage::kWillProcessResponse; total_defer_time_ += base::TimeTicks::Now() - last_defer_timestamp_; - - if (policy == LoadPolicy::DISALLOW) { - if (parent_frame_filter_->activation_state().enable_logging) { - std::string console_message = base::StringPrintf( - kDisallowSubframeConsoleMessageFormat, - navigation_handle()->GetURL().possibly_invalid_spec().c_str()); - navigation_handle() - ->GetWebContents() - ->GetMainFrame() - ->AddMessageToConsole(blink::mojom::ConsoleMessageLevel::kError, - console_message); - } - - parent_frame_filter_->ReportDisallowedLoad(); - // Other load policies will be reported in WillProcessResponse. + defer_stage_ = DeferStage::kNotDeferring; + if (deferring_response) { NotifyLoadPolicy(); + Resume(); + return; + } + // Otherwise, we deferred at start/redirect time. Either cancel navigation + // or resume here according to load policy. + if (load_policy_ == LoadPolicy::DISALLOW) { + HandleDisallowedLoad(); + NotifyLoadPolicy(); CancelDeferredNavigation(BLOCK_REQUEST_AND_COLLAPSE); } else { Resume(); } } +void SubframeNavigationFilteringThrottle::DeferStart(DeferStage stage) { + DCHECK(defer_stage_ == DeferStage::kNotDeferring); + DCHECK(stage != DeferStage::kNotDeferring); + defer_stage_ = stage; + last_defer_timestamp_ = base::TimeTicks::Now(); +} + void SubframeNavigationFilteringThrottle::NotifyLoadPolicy() const { auto* observer_manager = SubresourceFilterObserverManager::FromWebContents( navigation_handle()->GetWebContents());
diff --git a/components/subresource_filter/content/browser/subframe_navigation_filtering_throttle.h b/components/subresource_filter/content/browser/subframe_navigation_filtering_throttle.h index a0b99720..317f823 100644 --- a/components/subresource_filter/content/browser/subframe_navigation_filtering_throttle.h +++ b/components/subresource_filter/content/browser/subframe_navigation_filtering_throttle.h
@@ -67,14 +67,27 @@ const char* GetNameForLogging() override; private: - content::NavigationThrottle::ThrottleCheckResult DeferToCalculateLoadPolicy(); + enum class DeferStage { + kNotDeferring, + kWillStartOrRedirectRequest, + kWillProcessResponse + }; + + content::NavigationThrottle::ThrottleCheckResult + MaybeDeferToCalculateLoadPolicy(); + void OnCalculatedLoadPolicy(LoadPolicy policy); + void HandleDisallowedLoad(); void NotifyLoadPolicy() const; + void DeferStart(DeferStage stage); + // Must outlive this class. AsyncDocumentSubresourceFilter* parent_frame_filter_; + int pending_load_policy_calculations_ = 0; + DeferStage defer_stage_ = DeferStage::kNotDeferring; base::TimeTicks last_defer_timestamp_; base::TimeDelta total_defer_time_; LoadPolicy load_policy_ = LoadPolicy::ALLOW;
diff --git a/components/subresource_filter/core/common/BUILD.gn b/components/subresource_filter/core/common/BUILD.gn index e5aa774..066fd90 100644 --- a/components/subresource_filter/core/common/BUILD.gn +++ b/components/subresource_filter/core/common/BUILD.gn
@@ -19,6 +19,7 @@ "first_party_origin.h", "indexed_ruleset.cc", "indexed_ruleset.h", + "load_policy.cc", "load_policy.h", "memory_mapped_ruleset.cc", "memory_mapped_ruleset.h", @@ -66,6 +67,7 @@ "document_subresource_filter_unittest.cc", "first_party_origin_unittest.cc", "indexed_ruleset_unittest.cc", + "load_policy_unittest.cc", "scoped_timers_unittest.cc", "unindexed_ruleset_unittest.cc", ]
diff --git a/components/subresource_filter/core/common/load_policy.cc b/components/subresource_filter/core/common/load_policy.cc new file mode 100644 index 0000000..d6c89e3 --- /dev/null +++ b/components/subresource_filter/core/common/load_policy.cc
@@ -0,0 +1,15 @@ +// Copyright 2019 The Chromium 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 <algorithm> + +#include "components/subresource_filter/core/common/load_policy.h" + +namespace subresource_filter { + +LoadPolicy MoreRestrictiveLoadPolicy(LoadPolicy a, LoadPolicy b) { + return std::max(a, b); +} + +} // namespace subresource_filter
diff --git a/components/subresource_filter/core/common/load_policy.h b/components/subresource_filter/core/common/load_policy.h index 0a235a7e..44faca7 100644 --- a/components/subresource_filter/core/common/load_policy.h +++ b/components/subresource_filter/core/common/load_policy.h
@@ -8,13 +8,18 @@ namespace subresource_filter { // Represents the value returned by the DocumentSubresourceFilter corresponding -// to a resource load. +// to a resource load. Ordered by in increasing severity. enum class LoadPolicy { ALLOW, - DISALLOW, + // Policy for disallowed resources when the filter is running in dry run mode. WOULD_DISALLOW, + DISALLOW, }; +// Returns the stricter of the two load policies, as determined by the order +// of the LoadPolicy enum. +LoadPolicy MoreRestrictiveLoadPolicy(LoadPolicy a, LoadPolicy b); + } // namespace subresource_filter #endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_LOAD_POLICY_H_
diff --git a/components/subresource_filter/core/common/load_policy_unittest.cc b/components/subresource_filter/core/common/load_policy_unittest.cc new file mode 100644 index 0000000..bf00c6e --- /dev/null +++ b/components/subresource_filter/core/common/load_policy_unittest.cc
@@ -0,0 +1,22 @@ +// 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/subresource_filter/core/common/load_policy.h" + +#include "testing/gtest/include/gtest/gtest.h" + +namespace subresource_filter { + +TEST(SubresourceFilterLoadPolicyTest, MoreRestrictiveLoadPolicy) { + EXPECT_EQ(MoreRestrictiveLoadPolicy(LoadPolicy::DISALLOW, + LoadPolicy::WOULD_DISALLOW), + LoadPolicy::DISALLOW); + EXPECT_EQ(MoreRestrictiveLoadPolicy(LoadPolicy::DISALLOW, LoadPolicy::ALLOW), + LoadPolicy::DISALLOW); + EXPECT_EQ( + MoreRestrictiveLoadPolicy(LoadPolicy::WOULD_DISALLOW, LoadPolicy::ALLOW), + LoadPolicy::WOULD_DISALLOW); +} + +} // namespace subresource_filter
diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc index 5abe50de8..3ce23fd 100644 --- a/components/variations/service/variations_field_trial_creator.cc +++ b/components/variations/service/variations_field_trial_creator.cc
@@ -444,6 +444,7 @@ const char* kDisableFeatures, const std::set<std::string>& unforceable_field_trials, const std::vector<std::string>& variation_ids, + const std::vector<base::FeatureList::FeatureOverrideInfo>& extra_overrides, std::unique_ptr<const base::FieldTrial::EntropyProvider> low_entropy_provider, std::unique_ptr<base::FeatureList> feature_list, @@ -508,6 +509,13 @@ command_line->GetSwitchValueASCII(kEnableFeatures), command_line->GetSwitchValueASCII(kDisableFeatures)); + // This needs to happen here: After the InitializeFromCommandLine() call, + // because the explicit cmdline --disable-features and --enable-features + // should take precedence over these extra overrides. Before the call to + // SetInstance(), because overrides cannot be registered after the FeatureList + // instance is set. + feature_list->RegisterExtraFeatureOverrides(extra_overrides); + bool used_testing_config = false; #if BUILDFLAG(FIELDTRIAL_TESTING_ENABLED) if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) &&
diff --git a/components/variations/service/variations_field_trial_creator.h b/components/variations/service/variations_field_trial_creator.h index 5159583..8b99b3a 100644 --- a/components/variations/service/variations_field_trial_creator.h +++ b/components/variations/service/variations_field_trial_creator.h
@@ -73,16 +73,26 @@ // |safe_seed_manager| should be notified of the combined server and client // state that was activated to create the field trials (only when the return // value is true). - bool SetupFieldTrials(const char* kEnableGpuBenchmarking, - const char* kEnableFeatures, - const char* kDisableFeatures, - const std::set<std::string>& unforceable_field_trials, - const std::vector<std::string>& variation_ids, - std::unique_ptr<const base::FieldTrial::EntropyProvider> - low_entropy_provider, - std::unique_ptr<base::FeatureList> feature_list, - PlatformFieldTrials* platform_field_trials, - SafeSeedManager* safe_seed_manager); + // |extra_overrides| gives a list of feature overrides that should be applied + // after the features explicitly disabled/enabled from the command line via + // --disable-features and --enable-features, but before field trials. + // Note: The ordering of the FeatureList method calls is such that the + // explicit --disable-features and --enable-features from the command line + // take precedence over the |extra_overrides|, which take precedence over the + // field trials. + bool SetupFieldTrials( + const char* kEnableGpuBenchmarking, + const char* kEnableFeatures, + const char* kDisableFeatures, + const std::set<std::string>& unforceable_field_trials, + const std::vector<std::string>& variation_ids, + const std::vector<base::FeatureList::FeatureOverrideInfo>& + extra_overrides, + std::unique_ptr<const base::FieldTrial::EntropyProvider> + low_entropy_provider, + std::unique_ptr<base::FeatureList> feature_list, + PlatformFieldTrials* platform_field_trials, + SafeSeedManager* safe_seed_manager); // Returns all of the client state used for filtering studies. // As a side-effect, may update the stored permanent consistency country.
diff --git a/components/variations/service/variations_field_trial_creator_unittest.cc b/components/variations/service/variations_field_trial_creator_unittest.cc index 8da72309..590c7680 100644 --- a/components/variations/service/variations_field_trial_creator_unittest.cc +++ b/components/variations/service/variations_field_trial_creator_unittest.cc
@@ -260,7 +260,8 @@ TestPlatformFieldTrials platform_field_trials; return VariationsFieldTrialCreator::SetupFieldTrials( "", "", "", std::set<std::string>(), std::vector<std::string>(), - nullptr, std::make_unique<base::FeatureList>(), &platform_field_trials, + std::vector<base::FeatureList::FeatureOverrideInfo>(), nullptr, + std::make_unique<base::FeatureList>(), &platform_field_trials, safe_seed_manager_); } @@ -512,7 +513,8 @@ // |initial_seed| included the country code for India, this study should be // active. EXPECT_TRUE(field_trial_creator.SetupFieldTrials( - "", "", "", std::set<std::string>(), std::vector<std::string>(), nullptr, + "", "", "", std::set<std::string>(), std::vector<std::string>(), + std::vector<base::FeatureList::FeatureOverrideInfo>(), nullptr, std::make_unique<base::FeatureList>(), &platform_field_trials, &safe_seed_manager));
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc index 90e687b4..f26c56a 100644 --- a/components/variations/service/variations_service.cc +++ b/components/variations/service/variations_service.cc
@@ -908,12 +908,14 @@ const char* kDisableFeatures, const std::set<std::string>& unforceable_field_trials, const std::vector<std::string>& variation_ids, + const std::vector<base::FeatureList::FeatureOverrideInfo>& extra_overrides, std::unique_ptr<base::FeatureList> feature_list, variations::PlatformFieldTrials* platform_field_trials) { return field_trial_creator_.SetupFieldTrials( kEnableGpuBenchmarking, kEnableFeatures, kDisableFeatures, - unforceable_field_trials, variation_ids, CreateLowEntropyProvider(), - std::move(feature_list), platform_field_trials, &safe_seed_manager_); + unforceable_field_trials, variation_ids, extra_overrides, + CreateLowEntropyProvider(), std::move(feature_list), + platform_field_trials, &safe_seed_manager_); } void VariationsService::OverrideCachedUIStrings() {
diff --git a/components/variations/service/variations_service.h b/components/variations/service/variations_service.h index 9943cc5..dbc17ce 100644 --- a/components/variations/service/variations_service.h +++ b/components/variations/service/variations_service.h
@@ -186,13 +186,16 @@ } // Wrapper around VariationsFieldTrialCreator::SetupFieldTrials(). - bool SetupFieldTrials(const char* kEnableGpuBenchmarking, - const char* kEnableFeatures, - const char* kDisableFeatures, - const std::set<std::string>& unforceable_field_trials, - const std::vector<std::string>& variation_ids, - std::unique_ptr<base::FeatureList> feature_list, - variations::PlatformFieldTrials* platform_field_trials); + bool SetupFieldTrials( + const char* kEnableGpuBenchmarking, + const char* kEnableFeatures, + const char* kDisableFeatures, + const std::set<std::string>& unforceable_field_trials, + const std::vector<std::string>& variation_ids, + const std::vector<base::FeatureList::FeatureOverrideInfo>& + extra_overrides, + std::unique_ptr<base::FeatureList> feature_list, + variations::PlatformFieldTrials* platform_field_trials); // Overrides cached UI strings on the resource bundle once it is initialized. void OverrideCachedUIStrings();
diff --git a/components/viz/host/client_frame_sink_video_capturer.h b/components/viz/host/client_frame_sink_video_capturer.h index 0494421..a5be9bf8 100644 --- a/components/viz/host/client_frame_sink_video_capturer.h +++ b/components/viz/host/client_frame_sink_video_capturer.h
@@ -34,7 +34,7 @@ : private mojom::FrameSinkVideoConsumer { public: // A re-connectable FrameSinkVideoCaptureOverlay. See CreateOverlay(). - class Overlay : public mojom::FrameSinkVideoCaptureOverlay { + class VIZ_HOST_EXPORT Overlay : public mojom::FrameSinkVideoCaptureOverlay { public: Overlay(base::WeakPtr<ClientFrameSinkVideoCapturer> client_capturer, int32_t stacking_index);
diff --git a/content/browser/background_sync/background_sync_service_impl_test_harness.cc b/content/browser/background_sync/background_sync_service_impl_test_harness.cc index 3c534f3..126aad88 100644 --- a/content/browser/background_sync/background_sync_service_impl_test_harness.cc +++ b/content/browser/background_sync/background_sync_service_impl_test_harness.cc
@@ -144,7 +144,6 @@ storage_partition_impl_ = StoragePartitionImpl::Create( embedded_worker_helper_->browser_context(), /* in_memory= */ true, base::FilePath(), /* partition_domain= */ ""); - storage_partition_impl_->Initialize(); embedded_worker_helper_->context_wrapper()->set_storage_partition( storage_partition_impl_.get()); }
diff --git a/content/browser/browsing_data/browsing_data_test_utils.cc b/content/browser/browsing_data/browsing_data_test_utils.cc new file mode 100644 index 0000000..3f80d1e --- /dev/null +++ b/content/browser/browsing_data/browsing_data_test_utils.cc
@@ -0,0 +1,67 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/browsing_data/browsing_data_test_utils.h" + +#include <string> +#include <vector> + +#include "base/bind.h" +#include "base/run_loop.h" +#include "base/test/bind_test_util.h" +#include "content/public/browser/browser_context.h" +#include "content/public/browser/storage_partition.h" +#include "services/network/public/mojom/cookie_manager.mojom.h" +#include "testing/gtest/include/gtest/gtest.h" + +using CookieInclusionStatus = net::CanonicalCookie::CookieInclusionStatus; + +namespace content { + +network::mojom::CookieManager* GetCookieManager( + BrowserContext* browser_context) { + StoragePartition* storage_partition = + BrowserContext::GetDefaultStoragePartition(browser_context); + return storage_partition->GetCookieManagerForBrowserProcess(); +} + +void CreateCookieForTest( + const std::string& cookie_name, + const std::string& cookie_domain, + net::CookieSameSite same_site, + net::CookieOptions::SameSiteCookieContext cookie_context, + BrowserContext* browser_context) { + base::RunLoop run_loop; + net::CookieOptions options; + options.set_same_site_cookie_context(cookie_context); + bool result_out; + GetCookieManager(browser_context) + ->SetCanonicalCookie( + net::CanonicalCookie(cookie_name, "1", cookie_domain, "/", + base::Time(), base::Time(), base::Time(), false, + false, same_site, net::COOKIE_PRIORITY_LOW), + "https", options, + base::BindLambdaForTesting([&](CookieInclusionStatus result) { + result_out = (result == CookieInclusionStatus::INCLUDE); + run_loop.Quit(); + })); + run_loop.Run(); + EXPECT_TRUE(result_out); +} + +std::vector<net::CanonicalCookie> GetAllCookies( + BrowserContext* browser_context) { + base::RunLoop run_loop; + std::vector<net::CanonicalCookie> cookies_out; + GetCookieManager(browser_context) + ->GetAllCookies(base::BindLambdaForTesting( + [&](const std::vector<net::CanonicalCookie>& cookies) { + cookies_out = cookies; + run_loop.Quit(); + })); + run_loop.Run(); + return cookies_out; +} + +} // namespace content
diff --git a/content/browser/browsing_data/browsing_data_test_utils.h b/content/browser/browsing_data/browsing_data_test_utils.h new file mode 100644 index 0000000..780715c66 --- /dev/null +++ b/content/browser/browsing_data/browsing_data_test_utils.h
@@ -0,0 +1,31 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_BROWSING_DATA_BROWSING_DATA_TEST_UTILS_H_ +#define CONTENT_BROWSER_BROWSING_DATA_BROWSING_DATA_TEST_UTILS_H_ + +#include <string> +#include <vector> + +#include "services/network/public/mojom/cookie_manager.mojom.h" + +namespace content { +class BrowserContext; + +network::mojom::CookieManager* GetCookieManager( + BrowserContext* browser_context); + +void CreateCookieForTest( + const std::string& cookie_name, + const std::string& cookie_domain, + net::CookieSameSite same_site, + net::CookieOptions::SameSiteCookieContext cookie_context, + BrowserContext* browser_context); + +std::vector<net::CanonicalCookie> GetAllCookies( + BrowserContext* browser_context); + +} // namespace content + +#endif // CONTENT_BROWSER_BROWSING_DATA_BROWSING_DATA_TEST_UTILS_H_
diff --git a/content/browser/browsing_data/same_site_data_remover_impl.cc b/content/browser/browsing_data/same_site_data_remover_impl.cc index 8ec9e8e..33f4b76 100644 --- a/content/browser/browsing_data/same_site_data_remover_impl.cc +++ b/content/browser/browsing_data/same_site_data_remover_impl.cc
@@ -4,6 +4,7 @@ #include "content/browser/browsing_data/same_site_data_remover_impl.h" +#include <memory> #include <set> #include <string> #include <utility> @@ -54,6 +55,17 @@ return false; } +void OnDeleteSameSiteNoneCookies( + base::OnceClosure closure, + std::unique_ptr<SameSiteDataRemoverImpl> remover, + bool clear_storage) { + if (clear_storage) { + remover->ClearStoragePartitionData(std::move(closure)); + } else { + std::move(closure).Run(); + } +} + } // namespace SameSiteDataRemoverImpl::SameSiteDataRemoverImpl( @@ -101,4 +113,15 @@ nullptr, false, base::Time(), base::Time::Max(), std::move(closure)); } +void SameSiteDataRemoverImpl::ClearData(base::OnceClosure closure, + BrowserContext* context, + bool clear_storage) { + auto same_site_remover = std::make_unique<SameSiteDataRemoverImpl>(context); + SameSiteDataRemoverImpl* remover = same_site_remover.get(); + + remover->DeleteSameSiteNoneCookies( + base::BindOnce(&OnDeleteSameSiteNoneCookies, std::move(closure), + std::move(same_site_remover), clear_storage)); +} + } // namespace content
diff --git a/content/browser/browsing_data/same_site_data_remover_impl.h b/content/browser/browsing_data/same_site_data_remover_impl.h index 3e05535..7cc619a 100644 --- a/content/browser/browsing_data/same_site_data_remover_impl.h +++ b/content/browser/browsing_data/same_site_data_remover_impl.h
@@ -35,8 +35,17 @@ // Clears additional storage for domains that have cookies with SameSite value // NO_RESTRICTION from the StoragePartition. Storage is cleared based on the // domains of the cookies deleted in DeleteSameSiteNoneCookies(). + // + // This is called safely on an instance which is destroyed after the function + // call since it's not needed for the function execution. void ClearStoragePartitionData(base::OnceClosure closure); + // Clears cookies and associated data available in third-party contexts if + // clear_storage is set to true. + static void ClearData(base::OnceClosure closure, + BrowserContext* context, + bool clear_storage); + // For testing purposes only. void OverrideStoragePartitionForTesting(StoragePartition* storage_partition);
diff --git a/content/browser/browsing_data/same_site_data_remover_impl_browsertest.cc b/content/browser/browsing_data/same_site_data_remover_impl_browsertest.cc new file mode 100644 index 0000000..e5887974 --- /dev/null +++ b/content/browser/browsing_data/same_site_data_remover_impl_browsertest.cc
@@ -0,0 +1,285 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/browsing_data/same_site_data_remover_impl.h" + +#include <memory> +#include <string> +#include <vector> + +#include "base/bind.h" +#include "base/command_line.h" +#include "base/run_loop.h" +#include "base/scoped_observer.h" +#include "base/task/post_task.h" +#include "components/network_session_configurator/common/network_switches.h" +#include "content/browser/browsing_data/browsing_data_test_utils.h" +#include "content/browser/service_worker/service_worker_context_wrapper.h" +#include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/storage_partition.h" +#include "content/public/browser/storage_usage_info.h" +#include "content/public/browser/system_connector.h" +#include "content/public/common/content_switches.h" +#include "content/public/common/network_service_util.h" +#include "content/public/common/service_names.mojom.h" +#include "content/public/test/content_browser_test.h" +#include "content/public/test/content_browser_test_utils.h" +#include "content/shell/browser/shell.h" +#include "net/base/url_util.h" +#include "net/dns/mock_host_resolver.h" +#include "net/test/embedded_test_server/http_request.h" +#include "net/test/embedded_test_server/http_response.h" +#include "services/network/public/mojom/cookie_manager.mojom.h" +#include "services/network/public/mojom/network_service_test.mojom.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +using testing::IsEmpty; + +namespace content { + +namespace { + +class ServiceWorkerActivationObserver + : public ServiceWorkerContextCoreObserver { + public: + static void SignalActivation(ServiceWorkerContextWrapper* context, + const base::Closure& callback) { + new ServiceWorkerActivationObserver(context, callback); + } + + private: + ServiceWorkerActivationObserver(ServiceWorkerContextWrapper* context, + const base::Closure& callback) + : context_(context), scoped_observer_(this), callback_(callback) { + scoped_observer_.Add(context); + } + + ~ServiceWorkerActivationObserver() override {} + + // ServiceWorkerContextCoreObserver overrides. + void OnVersionStateChanged(int64_t version_id, + const GURL& scope, + ServiceWorkerVersion::Status) override { + if (context_->GetLiveVersion(version_id)->status() == + ServiceWorkerVersion::ACTIVATED) { + callback_.Run(); + delete this; + } + } + + ServiceWorkerContextWrapper* context_; + ScopedObserver<ServiceWorkerContextWrapper, ServiceWorkerContextCoreObserver> + scoped_observer_; + base::Closure callback_; +}; + +} // namespace + +class SameSiteDataRemoverBrowserTest : public ContentBrowserTest { + public: + SameSiteDataRemoverBrowserTest() {} + + void SetUpOnMainThread() override { + ContentBrowserTest::SetUpOnMainThread(); + + // Set up HTTP and HTTPS test servers that handle all hosts. + host_resolver()->AddRule("*", "127.0.0.1"); + + if (IsOutOfProcessNetworkService()) + SetUpMockCertVerifier(net::OK); + + https_server_.reset(new net::EmbeddedTestServer( + net::test_server::EmbeddedTestServer::TYPE_HTTPS)); + https_server_->SetSSLConfig(net::EmbeddedTestServer::CERT_OK); + https_server_->RegisterRequestHandler( + base::BindRepeating(&SameSiteDataRemoverBrowserTest::HandleRequest, + base::Unretained(this))); + ASSERT_TRUE(https_server_->Start()); + } + + void SetUpCommandLine(base::CommandLine* command_line) override { + ContentBrowserTest::SetUpCommandLine(command_line); + + if (IsOutOfProcessNetworkService()) { + // |MockCertVerifier| only seems to work when Network Service was enabled. + command_line->AppendSwitch(switches::kUseMockCertVerifierForTesting); + } else { + // We're redirecting all hosts to localhost even on HTTPS, so we'll get + // certificate errors. + command_line->AppendSwitch(switches::kIgnoreCertificateErrors); + } + } + + BrowserContext* GetBrowserContext() { + return shell()->web_contents()->GetBrowserContext(); + } + + net::EmbeddedTestServer* GetHttpsServer() { return https_server_.get(); } + + void SetUpMockCertVerifier(int32_t default_result) { + network::mojom::NetworkServiceTestPtr network_service_test; + GetSystemConnector()->BindInterface(mojom::kNetworkServiceName, + &network_service_test); + + base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed); + network_service_test->MockCertVerifierSetDefaultResult( + default_result, run_loop.QuitClosure()); + run_loop.Run(); + } + + void AddServiceWorker(const std::string& origin) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + StoragePartition* partition = + BrowserContext::GetDefaultStoragePartition(GetBrowserContext()); + ServiceWorkerContextWrapper* service_worker_context = + static_cast<ServiceWorkerContextWrapper*>( + partition->GetServiceWorkerContext()); + + GURL scope_url = GetHttpsServer()->GetURL(origin, "/"); + GURL js_url = GetHttpsServer()->GetURL(origin, "/?file=worker.js"); + + // Register the worker. + blink::mojom::ServiceWorkerRegistrationOptions options( + scope_url, blink::mojom::ScriptType::kClassic, + blink::mojom::ServiceWorkerUpdateViaCache::kImports); + base::PostTask( + FROM_HERE, {BrowserThread::IO}, + base::BindOnce( + &ServiceWorkerContextWrapper::RegisterServiceWorker, + base::Unretained(service_worker_context), js_url, options, + base::Bind( + &SameSiteDataRemoverBrowserTest::AddServiceWorkerCallback, + base::Unretained(this)))); + + // Wait for its activation. + base::RunLoop run_loop; + base::PostTask( + FROM_HERE, {BrowserThread::IO}, + base::BindOnce(&ServiceWorkerActivationObserver::SignalActivation, + base::Unretained(service_worker_context), + run_loop.QuitClosure())); + run_loop.Run(); + } + + std::vector<StorageUsageInfo> GetServiceWorkers() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + StoragePartition* partition = + BrowserContext::GetDefaultStoragePartition(GetBrowserContext()); + ServiceWorkerContextWrapper* service_worker_context = + static_cast<ServiceWorkerContextWrapper*>( + partition->GetServiceWorkerContext()); + + std::vector<StorageUsageInfo> service_workers; + base::RunLoop run_loop; + base::PostTask( + FROM_HERE, {BrowserThread::IO}, + base::BindOnce( + &ServiceWorkerContextWrapper::GetAllOriginsInfo, + base::Unretained(service_worker_context), + base::Bind( + &SameSiteDataRemoverBrowserTest::GetServiceWorkersCallback, + base::Unretained(this), run_loop.QuitClosure(), + base::Unretained(&service_workers)))); + run_loop.Run(); + + return service_workers; + } + + void ClearData(bool clear_storage) { + base::RunLoop run_loop; + SameSiteDataRemoverImpl::ClearData(run_loop.QuitClosure(), + GetBrowserContext(), clear_storage); + run_loop.Run(); + } + + private: + void AddServiceWorkerCallback(bool success) { ASSERT_TRUE(success); } + + void GetServiceWorkersCallback( + base::OnceClosure callback, + std::vector<StorageUsageInfo>* out_service_workers, + const std::vector<StorageUsageInfo>& service_workers) { + *out_service_workers = service_workers; + std::move(callback).Run(); + } + + // Handles all requests. + // + // Supports the following <key>=<value> query parameters in the url: + // <key>="file" responds with the content of file <value> + std::unique_ptr<net::test_server::HttpResponse> HandleRequest( + const net::test_server::HttpRequest& request) { + auto response(std::make_unique<net::test_server::BasicHttpResponse>()); + + std::string value; + if (net::GetValueForKeyInQuery(request.GetURL(), "file", &value)) { + base::FilePath path(GetTestFilePath("browsing_data", value.c_str())); + base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ); + EXPECT_TRUE(file.IsValid()); + int64_t length = file.GetLength(); + EXPECT_GE(length, 0); + std::unique_ptr<char[]> buffer(new char[length + 1]); + file.Read(0, buffer.get(), length); + buffer[length] = '\0'; + + if (path.Extension() == FILE_PATH_LITERAL(".js")) + response->set_content_type("application/javascript"); + else + NOTREACHED(); + + response->set_content(buffer.get()); + } + + return std::move(response); + } + + std::unique_ptr<net::EmbeddedTestServer> https_server_; + + DISALLOW_COPY_AND_ASSIGN(SameSiteDataRemoverBrowserTest); +}; + +IN_PROC_BROWSER_TEST_F(SameSiteDataRemoverBrowserTest, + TestClearDataWithStorageRemoval) { + CreateCookieForTest("TestCookie", "www.google.com", + net::CookieSameSite::NO_RESTRICTION, + net::CookieOptions::SameSiteCookieContext::CROSS_SITE, + GetBrowserContext()); + AddServiceWorker("www.google.com"); + + ClearData(/* clear_storage= */ true); + + // Check that cookies were deleted. + const std::vector<net::CanonicalCookie>& cookies = + GetAllCookies(GetBrowserContext()); + EXPECT_THAT(cookies, IsEmpty()); + + // Check that the service worker for the cookie domain was removed. + std::vector<StorageUsageInfo> service_workers = GetServiceWorkers(); + EXPECT_THAT(service_workers, IsEmpty()); +} + +IN_PROC_BROWSER_TEST_F(SameSiteDataRemoverBrowserTest, + TestClearDataWithoutStorageRemoval) { + CreateCookieForTest("TestCookie", "www.google.com", + net::CookieSameSite::NO_RESTRICTION, + net::CookieOptions::SameSiteCookieContext::CROSS_SITE, + GetBrowserContext()); + AddServiceWorker("www.google.com"); + + ClearData(/* clear_storage= */ false); + + // Check that cookies were deleted. + const std::vector<net::CanonicalCookie>& cookies = + GetAllCookies(GetBrowserContext()); + EXPECT_THAT(cookies, IsEmpty()); + + // Storage partition data should NOT have been cleared. + std::vector<StorageUsageInfo> service_workers = GetServiceWorkers(); + ASSERT_EQ(1u, service_workers.size()); + EXPECT_EQ(service_workers[0].origin.GetURL(), + GetHttpsServer()->GetURL("www.google.com", "/")); +} + +} // namespace content
diff --git a/content/browser/browsing_data/same_site_data_remover_impl_unittest.cc b/content/browser/browsing_data/same_site_data_remover_impl_unittest.cc index 209e472..db91755b 100644 --- a/content/browser/browsing_data/same_site_data_remover_impl_unittest.cc +++ b/content/browser/browsing_data/same_site_data_remover_impl_unittest.cc
@@ -11,6 +11,7 @@ #include "base/run_loop.h" #include "base/test/bind_test_util.h" #include "base/time/time.h" +#include "content/browser/browsing_data/browsing_data_test_utils.h" #include "content/browser/browsing_data/same_site_data_remover_impl.h" #include "content/public/browser/storage_partition.h" #include "content/public/test/test_browser_context.h" @@ -75,55 +76,11 @@ void TearDown() override { browser_context_.reset(); } - void CreateCookieForTest( - const std::string& cookie_name, - const std::string& cookie_domain, - net::CookieSameSite same_site, - net::CookieOptions::SameSiteCookieContext cookie_context) { - network::mojom::CookieManager* cookie_manager = GetCookieManager(); - - base::RunLoop run_loop; - net::CookieOptions options; - options.set_same_site_cookie_context(cookie_context); - bool result_out; - cookie_manager->SetCanonicalCookie( - net::CanonicalCookie(cookie_name, "1", cookie_domain, "/", base::Time(), - base::Time(), base::Time(), false, false, - same_site, net::COOKIE_PRIORITY_LOW), - "https", options, - base::BindLambdaForTesting( - [&](net::CanonicalCookie::CookieInclusionStatus result) { - result_out = - (result == - net::CanonicalCookie::CookieInclusionStatus::INCLUDE); - run_loop.Quit(); - })); - run_loop.Run(); - EXPECT_TRUE(result_out); - } - - std::vector<net::CanonicalCookie> GetAllCookies( - network::mojom::CookieManager* cookie_manager) { - base::RunLoop run_loop; - std::vector<net::CanonicalCookie> cookies_out; - cookie_manager->GetAllCookies(base::BindLambdaForTesting( - [&](const std::vector<net::CanonicalCookie>& cookies) { - cookies_out = cookies; - run_loop.Quit(); - })); - run_loop.Run(); - return cookies_out; - } - SameSiteDataRemoverImpl* GetSameSiteDataRemoverImpl() { return same_site_remover_.get(); } - network::mojom::CookieManager* GetCookieManager() { - StoragePartition* storage_partition = - BrowserContext::GetDefaultStoragePartition(browser_context_.get()); - return storage_partition->GetCookieManagerForBrowserProcess(); - } + BrowserContext* GetBrowserContext() { return browser_context_.get(); } void DeleteSameSiteNoneCookies() { base::RunLoop run_loop; @@ -148,12 +105,15 @@ }; TEST_F(SameSiteDataRemoverImplTest, TestRemoveSameSiteNoneCookies) { - CreateCookieForTest("TestCookie1", "www.google.com", - net::CookieSameSite::NO_RESTRICTION, - net::CookieOptions::SameSiteCookieContext::CROSS_SITE); + BrowserContext* browser_context = GetBrowserContext(); + + CreateCookieForTest( + "TestCookie1", "www.google.com", net::CookieSameSite::NO_RESTRICTION, + net::CookieOptions::SameSiteCookieContext::CROSS_SITE, browser_context); CreateCookieForTest("TestCookie2", "www.gmail.google.com", net::CookieSameSite::NO_RESTRICTION, - net::CookieOptions::SameSiteCookieContext::CROSS_SITE); + net::CookieOptions::SameSiteCookieContext::CROSS_SITE, + browser_context); DeleteSameSiteNoneCookies(); @@ -161,18 +121,20 @@ UnorderedElementsAre("www.google.com", "www.gmail.google.com")); const std::vector<net::CanonicalCookie>& cookies = - GetAllCookies(GetCookieManager()); + GetAllCookies(browser_context); EXPECT_THAT(cookies, IsEmpty()); } TEST_F(SameSiteDataRemoverImplTest, TestRemoveOnlySameSiteNoneCookies) { - CreateCookieForTest("TestCookie1", "www.google.com", - net::CookieSameSite::NO_RESTRICTION, - net::CookieOptions::SameSiteCookieContext::CROSS_SITE); + BrowserContext* browser_context = GetBrowserContext(); + CreateCookieForTest( + "TestCookie1", "www.google.com", net::CookieSameSite::NO_RESTRICTION, + net::CookieOptions::SameSiteCookieContext::CROSS_SITE, browser_context); // The second cookie has SameSite value STRICT_MODE instead of NO_RESTRICTION. CreateCookieForTest( "TestCookie2", "www.gmail.google.com", net::CookieSameSite::STRICT_MODE, - net::CookieOptions::SameSiteCookieContext::SAME_SITE_STRICT); + net::CookieOptions::SameSiteCookieContext::SAME_SITE_STRICT, + browser_context); DeleteSameSiteNoneCookies(); @@ -180,20 +142,22 @@ UnorderedElementsAre("www.google.com")); const std::vector<net::CanonicalCookie>& cookies = - GetAllCookies(GetCookieManager()); + GetAllCookies(browser_context); ASSERT_EQ(1u, cookies.size()); ASSERT_EQ(cookies[0].Name(), "TestCookie2"); } TEST_F(SameSiteDataRemoverImplTest, TestRemoveSameDomainCookies) { - CreateCookieForTest("TestCookie1", "www.google.com", - net::CookieSameSite::NO_RESTRICTION, - net::CookieOptions::SameSiteCookieContext::CROSS_SITE); + BrowserContext* browser_context = GetBrowserContext(); + CreateCookieForTest( + "TestCookie1", "www.google.com", net::CookieSameSite::NO_RESTRICTION, + net::CookieOptions::SameSiteCookieContext::CROSS_SITE, browser_context); // The second cookie has the same domain as the first cookie, but also has // SameSite value STRICT_MODE instead of NO_RESTRICTION. CreateCookieForTest( "TestCookie2", "www.google.com", net::CookieSameSite::STRICT_MODE, - net::CookieOptions::SameSiteCookieContext::SAME_SITE_STRICT); + net::CookieOptions::SameSiteCookieContext::SAME_SITE_STRICT, + browser_context); DeleteSameSiteNoneCookies(); @@ -201,18 +165,21 @@ UnorderedElementsAre("www.google.com")); const std::vector<net::CanonicalCookie>& cookies = - GetAllCookies(GetCookieManager()); + GetAllCookies(browser_context); ASSERT_EQ(1u, cookies.size()); ASSERT_EQ(cookies[0].Name(), "TestCookie2"); } TEST_F(SameSiteDataRemoverImplTest, TestKeepSameSiteCookies) { + BrowserContext* browser_context = GetBrowserContext(); CreateCookieForTest("TestCookie1", "www.google.com", net::CookieSameSite::LAX_MODE, - net::CookieOptions::SameSiteCookieContext::SAME_SITE_LAX); + net::CookieOptions::SameSiteCookieContext::SAME_SITE_LAX, + browser_context); CreateCookieForTest( "TestCookie2", "www.gmail.google.com", net::CookieSameSite::STRICT_MODE, - net::CookieOptions::SameSiteCookieContext::SAME_SITE_STRICT); + net::CookieOptions::SameSiteCookieContext::SAME_SITE_STRICT, + browser_context); DeleteSameSiteNoneCookies(); @@ -220,12 +187,14 @@ IsEmpty()); const std::vector<net::CanonicalCookie>& cookies = - GetAllCookies(GetCookieManager()); + GetAllCookies(browser_context); EXPECT_THAT(2u, cookies.size()); } TEST_F(SameSiteDataRemoverImplTest, TestCookieRemovalUnaffectedByParameters) { - network::mojom::CookieManager* cookie_manager = GetCookieManager(); + BrowserContext* browser_context = GetBrowserContext(); + network::mojom::CookieManager* cookie_manager = + GetCookieManager(browser_context); base::RunLoop run_loop1; net::CookieOptions options; @@ -271,20 +240,23 @@ UnorderedElementsAre("google.com")); const std::vector<net::CanonicalCookie>& cookies = - GetAllCookies(cookie_manager); + GetAllCookies(browser_context); ASSERT_EQ(1u, cookies.size()); ASSERT_EQ(cookies[0].Name(), "TestCookie2"); } TEST_F(SameSiteDataRemoverImplTest, TestStoragePartitionDataRemoval) { + BrowserContext* browser_context = GetBrowserContext(); + network::mojom::CookieManager* cookie_manager = + GetCookieManager(browser_context); SameSiteRemoverTestStoragePartition storage_partition; - storage_partition.set_cookie_manager_for_browser_process(GetCookieManager()); + storage_partition.set_cookie_manager_for_browser_process(cookie_manager); GetSameSiteDataRemoverImpl()->OverrideStoragePartitionForTesting( &storage_partition); - CreateCookieForTest("TestCookie1", ".google.com", - net::CookieSameSite::NO_RESTRICTION, - net::CookieOptions::SameSiteCookieContext::CROSS_SITE); + CreateCookieForTest( + "TestCookie1", ".google.com", net::CookieSameSite::NO_RESTRICTION, + net::CookieOptions::SameSiteCookieContext::CROSS_SITE, browser_context); DeleteSameSiteNoneCookies(); ClearStoragePartitionData();
diff --git a/content/browser/cookie_store/cookie_store_manager_unittest.cc b/content/browser/cookie_store/cookie_store_manager_unittest.cc index e0b9511..7bde04f 100644 --- a/content/browser/cookie_store/cookie_store_manager_unittest.cc +++ b/content/browser/cookie_store/cookie_store_manager_unittest.cc
@@ -262,11 +262,9 @@ base::BindOnce([](bool success) { CHECK(success) << "Initialize failed"; })); - storage_partition_impl_ = StoragePartitionImpl::Create( - worker_test_helper_->browser_context(), true /* in_memory */, - base::FilePath() /* relative_partition_path */, - std::string() /* partition_domain */); - storage_partition_impl_->Initialize(); + storage_partition_impl_ = base::WrapUnique( + new StoragePartitionImpl(worker_test_helper_->browser_context(), + user_data_directory_.GetPath(), nullptr)); ::network::mojom::NetworkContext* network_context = storage_partition_impl_->GetNetworkContext(); cookie_store_context_->ListenToCookieChanges(
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc index cde58a3..fc154b7b 100644 --- a/content/browser/download/download_manager_impl.cc +++ b/content/browser/download/download_manager_impl.cc
@@ -298,9 +298,13 @@ base::CreateSingleThreadTaskRunner({BrowserThread::IO})); if (!in_progress_manager_) { + auto* proto_db_provider = + BrowserContext::GetDefaultStoragePartition(browser_context) + ->GetProtoDatabaseProvider(); in_progress_manager_ = std::make_unique<download::InProgressDownloadManager>( - this, base::FilePath(), base::BindRepeating(&IsOriginSecure), + this, base::FilePath(), proto_db_provider, + base::BindRepeating(&IsOriginSecure), base::BindRepeating(&DownloadRequestUtils::IsURLSafe), nullptr); } else { in_progress_manager_->SetDelegate(this); @@ -461,7 +465,8 @@ // We'll have nothing more to report to the observers after this point. observers_.Clear(); - in_progress_manager_->ShutDown(); + if (in_progress_manager_) + in_progress_manager_->ShutDown(); if (delegate_) delegate_->Shutdown();
diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc index 4a5f4fe..a6ebb59 100644 --- a/content/browser/download/download_manager_impl_unittest.cc +++ b/content/browser/download/download_manager_impl_unittest.cc
@@ -372,6 +372,7 @@ : download::InProgressDownloadManager( nullptr, base::FilePath(), + nullptr, download::InProgressDownloadManager::IsOriginSecureCallback(), base::BindRepeating(&URLAlwaysSafe), nullptr) {}
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc index 7fad8410..b059935 100644 --- a/content/browser/frame_host/frame_tree_node.cc +++ b/content/browser/frame_host/frame_tree_node.cc
@@ -626,20 +626,42 @@ return true; } +bool FrameTreeNode::VerifyUserActivation() { + if (!base::FeatureList::IsEnabled(features::kBrowserVerifiedUserActivation)) + return true; + return render_manager_.current_frame_host() + ->GetRenderWidgetHost() + ->ConsumePendingUserActivationIfAllowed(); +} + bool FrameTreeNode::UpdateUserActivationState( blink::UserActivationUpdateType update_type) { - render_manager_.UpdateUserActivationState(update_type); + bool update_result = false; switch (update_type) { case blink::UserActivationUpdateType::kConsumeTransientActivation: - return ConsumeTransientUserActivation(); - + update_result = ConsumeTransientUserActivation(); + break; case blink::UserActivationUpdateType::kNotifyActivation: - return NotifyUserActivation(); - + update_result = NotifyUserActivation(); + break; + case blink::UserActivationUpdateType:: + kNotifyActivationPendingBrowserVerification: + if (VerifyUserActivation()) { + update_result = NotifyUserActivation(); + update_type = blink::UserActivationUpdateType::kNotifyActivation; + } else { + // TODO(crbug.com/848778): We need to decide what to do when user + // activation verification failed. NOTREACHED here will make all + // unrelated tests that inject event to renderer fail. + return false; + } + break; case blink::UserActivationUpdateType::kClearActivation: - return ClearUserActivation(); + update_result = ClearUserActivation(); + break; } - NOTREACHED() << "Invalid update_type."; + render_manager_.UpdateUserActivationState(update_type); + return update_result; } void FrameTreeNode::OnSetHasReceivedUserGestureBeforeNavigation(bool value) {
diff --git a/content/browser/frame_host/frame_tree_node.h b/content/browser/frame_host/frame_tree_node.h index 03d419c..cc214ad 100644 --- a/content/browser/frame_host/frame_tree_node.h +++ b/content/browser/frame_host/frame_tree_node.h
@@ -436,6 +436,13 @@ bool ClearUserActivation(); + // Verify that the renderer process is allowed to set user activation on this + // frame by checking whether this frame's RenderWidgetHost had previously seen + // an input event that might lead to user activation. If user activation + // should be allowed, this returns true and also clears corresponding pending + // user activation state in the widget. Otherwise, this returns false. + bool VerifyUserActivation(); + // The next available browser-global FrameTreeNode ID. static int next_frame_tree_node_id_;
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc index 17e66f5e..7c2f729 100644 --- a/content/browser/frame_host/navigator_impl.cc +++ b/content/browser/frame_host/navigator_impl.cc
@@ -675,6 +675,14 @@ } NavigationEntryImpl* pending_entry = controller_->GetPendingEntry(); NavigationEntryImpl* current_entry = controller_->GetLastCommittedEntry(); + if (current_entry && common_params->url == current_entry->GetReferrer().url) { + // Looks like a potential client redirect loop. Turn off any preview + // interventions in case they are at fault. Motivated by crbug.com/987062 + common_params->previews_state = PREVIEWS_OFF; + UMA_HISTOGRAM_BOOLEAN("Navigation.ClientRedirectCycle.RedirectToReferrer", + true); + } + // Only consult the delegate for override state if there is no current entry, // since that state should only apply to newly created tabs (and not cases // where the NavigationEntry recorded the state).
diff --git a/content/browser/pointer_lock_browsertest.cc b/content/browser/pointer_lock_browsertest.cc index 6b820bd..ded423d 100644 --- a/content/browser/pointer_lock_browsertest.cc +++ b/content/browser/pointer_lock_browsertest.cc
@@ -4,6 +4,7 @@ #include "content/browser/pointer_lock_browsertest.h" +#include "build/build_config.h" #include "content/browser/frame_host/frame_tree.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_input_event_router.h" @@ -187,7 +188,14 @@ EXECUTE_SCRIPT_NO_USER_GESTURE)); } -IN_PROC_BROWSER_TEST_F(PointerLockBrowserTest, PointerLockEventRouting) { +// Flaky on Windows. https://crbug.com/992529 +#if defined(OS_WIN) +#define MAYBE_PointerLockEventRouting DISABLED_PointerLockEventRouting +#else +#define MAYBE_PointerLockEventRouting PointerLockEventRouting +#endif + +IN_PROC_BROWSER_TEST_F(PointerLockBrowserTest, MAYBE_PointerLockEventRouting) { GURL main_url(embedded_test_server()->GetURL( "a.com", "/cross_site_iframe_factory.html?a(b)")); EXPECT_TRUE(NavigateToURL(shell(), main_url));
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index 0cda89d4..7c3c2bbd 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -453,8 +453,6 @@ prefs.remote_fonts_enabled = !command_line.HasSwitch(switches::kDisableRemoteFonts); prefs.application_cache_enabled = true; - prefs.xss_auditor_enabled = - !command_line.HasSwitch(switches::kDisableXSSAuditor); prefs.local_storage_enabled = !command_line.HasSwitch(switches::kDisableLocalStorage); prefs.databases_enabled =
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 0ba907f..f9d900c 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -505,6 +505,10 @@ synthetic_gesture_controller_.reset(); } +// static +const base::TimeDelta RenderWidgetHostImpl::kActivationNotificationExpireTime = + base::TimeDelta::FromMilliseconds(300); + RenderProcessHost* RenderWidgetHostImpl::GetProcess() { return process_; } @@ -1169,6 +1173,8 @@ return; new_content_rendering_timeout_->Start(new_content_rendering_delay_); + + ClearPendingUserActivation(); } void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { @@ -2629,10 +2635,38 @@ SetNeedsBeginFrame(true); } +void RenderWidgetHostImpl::AddPendingUserActivation( + const WebInputEvent& event) { + if (base::FeatureList::IsEnabled(features::kBrowserVerifiedUserActivation) && + (event.GetType() == WebInputEvent::kMouseDown || + event.GetType() == WebInputEvent::kKeyDown || + event.GetType() == WebInputEvent::kRawKeyDown)) { + pending_user_activation_timer_.Start( + FROM_HERE, kActivationNotificationExpireTime, + base::BindOnce(&RenderWidgetHostImpl::ClearPendingUserActivation, + base::Unretained(this))); + pending_user_activation_counter_++; + } +} + +void RenderWidgetHostImpl::ClearPendingUserActivation() { + pending_user_activation_counter_ = 0; + pending_user_activation_timer_.Stop(); +} + +bool RenderWidgetHostImpl::ConsumePendingUserActivationIfAllowed() { + if (pending_user_activation_counter_ > 0) { + pending_user_activation_counter_--; + return true; + } + return false; +} + void RenderWidgetHostImpl::DispatchInputEventWithLatencyInfo( const blink::WebInputEvent& event, ui::LatencyInfo* latency) { latency_tracker_.OnInputEvent(event, latency); + AddPendingUserActivation(event); for (auto& observer : input_event_observers_) observer.OnInputEvent(event); }
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 5ab1218..e81662ef 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -765,6 +765,13 @@ // Marks all views in the frame tree as evicted. std::vector<viz::SurfaceId> CollectSurfaceIdsForEviction(); + // This function validates a renderer's attempt to enable user activation on a + // frame. Gaining user activation is allowed if this widget had previously + // seen an input event (e.g., mousedown or keydown) that may lead to user + // activation; in this case, this "pending user activation" is consumed and + // this function returns true. Otherwise, this function returns false. + bool ConsumePendingUserActivationIfAllowed(); + protected: // --------------------------------------------------------------------------- // The following method is overridden by RenderViewHost to send upwards to @@ -804,6 +811,7 @@ FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, DontPostponeInputEventAckTimeout); FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, HideShowMessages); + FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, PendingUserActivationTimeout); FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, RendererExitedNoDrag); FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostTest, StopAndStartInputEventAckTimeout); @@ -975,6 +983,19 @@ void CreateSyntheticGestureControllerIfNecessary(); + // The following functions are used to keep track of pending user activation + // events, which are input events (e.g., mousedown or keydown) that allow a + // renderer to gain user activation. AddPendingUserActivation() increments a + // counter of such events and sets a timer, which allows the renderer to claim + // user activation within |kActivationNotificationExpireTime| ms. + // ClearPendingUserActivation() clears the counter and is called after + // navigations or timeouts + void AddPendingUserActivation(const blink::WebInputEvent& event); + void ClearPendingUserActivation(); + + // An expiry time for resetting the pending_user_activation_timer_. + static const base::TimeDelta kActivationNotificationExpireTime; + // true if a renderer has once been valid. We use this flag to display a sad // tab only when we lose our renderer and not if a paint occurs during // initialization. @@ -1226,6 +1247,12 @@ // necessarily sent yet. bool autoscroll_in_progress_ = false; + // Counter for possible-activation-triggering input event. + int pending_user_activation_counter_ = 0; + // This timer resets |pending_user_activation_counter_| after a short delay. + // See comments on Add/ClearPendingUserActivation(). + base::OneShotTimer pending_user_activation_timer_; + base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_{this}; DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index 3d40855..db01a08 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -15,6 +15,7 @@ #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "base/test/metrics/histogram_tester.h" +#include "base/test/scoped_feature_list.h" #include "base/test/simple_test_tick_clock.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" @@ -2013,4 +2014,33 @@ tester.ExpectUniqueSample("Renderer.Hung.Duration", 17000, 1); } +TEST_F(RenderWidgetHostTest, PendingUserActivationTimeout) { + base::test::ScopedFeatureList scoped_feature_list_; + scoped_feature_list_.InitAndEnableFeature( + features::kBrowserVerifiedUserActivation); + + // One event allows one activation notification. + SimulateMouseEvent(WebInputEvent::kMouseDown); + EXPECT_TRUE(host_->ConsumePendingUserActivationIfAllowed()); + EXPECT_FALSE(host_->ConsumePendingUserActivationIfAllowed()); + + // Mouse move and up does not increase pending user activation counter. + SimulateMouseEvent(WebInputEvent::kMouseMove); + SimulateMouseEvent(WebInputEvent::kMouseUp); + EXPECT_FALSE(host_->ConsumePendingUserActivationIfAllowed()); + + // 2 events allow 2 activation notifications. + SimulateMouseEvent(WebInputEvent::kMouseDown); + SimulateKeyboardEvent(WebInputEvent::kKeyDown); + EXPECT_TRUE(host_->ConsumePendingUserActivationIfAllowed()); + EXPECT_TRUE(host_->ConsumePendingUserActivationIfAllowed()); + EXPECT_FALSE(host_->ConsumePendingUserActivationIfAllowed()); + + // Pending activation is reset after |kActivationNotificationExpireTime|. + SimulateMouseEvent(WebInputEvent::kMouseDown); + SimulateMouseEvent(WebInputEvent::kMouseDown); + RunLoopFor(RenderWidgetHostImpl::kActivationNotificationExpireTime); + EXPECT_FALSE(host_->ConsumePendingUserActivationIfAllowed()); +} + } // namespace content
diff --git a/content/browser/service_worker/service_worker_registration_unittest.cc b/content/browser/service_worker/service_worker_registration_unittest.cc index e3d58447..d433ba47 100644 --- a/content/browser/service_worker/service_worker_registration_unittest.cc +++ b/content/browser/service_worker/service_worker_registration_unittest.cc
@@ -183,7 +183,6 @@ storage_partition_impl_ = StoragePartitionImpl::Create( helper_->browser_context(), /* in_memory= */ true, base::FilePath(), /* partition_domain= */ ""); - storage_partition_impl_->Initialize(); helper_->context_wrapper()->set_storage_partition( storage_partition_impl_.get());
diff --git a/content/browser/site_per_process_hit_test_browsertest.cc b/content/browser/site_per_process_hit_test_browsertest.cc index 9976836..6a3ac14 100644 --- a/content/browser/site_per_process_hit_test_browsertest.cc +++ b/content/browser/site_per_process_hit_test_browsertest.cc
@@ -6338,6 +6338,89 @@ } } +IN_PROC_BROWSER_TEST_P(SitePerProcessHitTestBrowserTest, + RenderWidgetUserActivationStateTest) { + base::test::ScopedFeatureList scoped_feature_list_; + scoped_feature_list_.InitAndEnableFeature( + features::kBrowserVerifiedUserActivation); + + GURL main_url(embedded_test_server()->GetURL( + "foo.com", "/frame_tree/page_with_positioned_frame.html")); + EXPECT_TRUE(NavigateToURL(shell(), main_url)); + + FrameTreeNode* root = web_contents()->GetFrameTree()->root(); + FrameTreeNode* child = root->child_at(0); + ASSERT_EQ( + " Site A ------------ proxies for B\n" + " +--Site B ------- proxies for A\n" + "Where A = http://foo.com/\n" + " B = http://baz.com/", + DepictFrameTree(root)); + + WaitForHitTestData(child->current_frame_host()); + + RenderWidgetHostMouseEventMonitor main_frame_monitor( + root->current_frame_host()->GetRenderWidgetHost()); + RenderWidgetHostMouseEventMonitor child_frame_monitor( + child->current_frame_host()->GetRenderWidgetHost()); + + RenderWidgetHostViewBase* rwhv_root = static_cast<RenderWidgetHostViewBase*>( + root->current_frame_host()->GetRenderWidgetHost()->GetView()); + RenderWidgetHostViewBase* rwhv_child = static_cast<RenderWidgetHostViewBase*>( + child->current_frame_host()->GetRenderWidgetHost()->GetView()); + + // Send a mouse down event to main frame. + blink::WebMouseEvent mouse_event( + blink::WebInputEvent::kMouseDown, blink::WebInputEvent::kNoModifiers, + blink::WebInputEvent::GetStaticTimeStampForTests()); + mouse_event.button = blink::WebPointerProperties::Button::kLeft; + mouse_event.click_count = 1; + main_frame_monitor.ResetEventReceived(); + + gfx::PointF click_point(10, 10); + DispatchMouseEventAndWaitUntilDispatch(web_contents(), mouse_event, rwhv_root, + click_point, rwhv_root, click_point); + EXPECT_TRUE(main_frame_monitor.EventWasReceived()); + + // Root frame pending activation state has been cleared by activation + // notification, and it has user activation. + EXPECT_FALSE(root->current_frame_host() + ->GetRenderWidgetHost() + ->ConsumePendingUserActivationIfAllowed()); + EXPECT_TRUE(root->HasTransientUserActivation()); + // Child frame doesn't have allowed_activation state set, and does not have + // user activation. + EXPECT_FALSE(child->current_frame_host() + ->GetRenderWidgetHost() + ->ConsumePendingUserActivationIfAllowed()); + EXPECT_FALSE(child->HasTransientUserActivation()); + + // Clear the activation state. + root->UpdateUserActivationState( + blink::UserActivationUpdateType::kClearActivation); + + // Send a mouse down to child frame. + mouse_event.SetType(blink::WebInputEvent::kMouseDown); + child_frame_monitor.ResetEventReceived(); + DispatchMouseEventAndWaitUntilDispatch(web_contents(), mouse_event, + rwhv_child, click_point, rwhv_child, + click_point); + EXPECT_TRUE(child_frame_monitor.EventWasReceived()); + + // Child frame's activation state has been cleared by + // the activation notification, and it has user activation. + EXPECT_FALSE(child->current_frame_host() + ->GetRenderWidgetHost() + ->ConsumePendingUserActivationIfAllowed()); + EXPECT_TRUE(child->HasTransientUserActivation()); + // Root frame doesn't have allowed_activation state set, but has user + // activation because with UAv2, ancestor frames get activated as well. + EXPECT_FALSE(root->current_frame_host() + ->GetRenderWidgetHost() + ->ConsumePendingUserActivationIfAllowed()); + EXPECT_TRUE(root->HasTransientUserActivation()); +} + class SitePerProcessHitTestDataGenerationBrowserTest : public SitePerProcessHitTestBrowserTest { public:
diff --git a/content/browser/startup_helper.cc b/content/browser/startup_helper.cc index aec43ef..481d07f 100644 --- a/content/browser/startup_helper.cc +++ b/content/browser/startup_helper.cc
@@ -16,6 +16,7 @@ #include "base/task/thread_pool/thread_pool.h" #include "build/build_config.h" #include "content/common/thread_pool_util.h" +#include "content/public/common/content_switch_dependent_feature_overrides.h" #include "content/public/common/content_switches.h" namespace content { @@ -40,7 +41,8 @@ base::FeatureList::InitializeInstance( command_line->GetSwitchValueASCII(switches::kEnableFeatures), - command_line->GetSwitchValueASCII(switches::kDisableFeatures)); + command_line->GetSwitchValueASCII(switches::kDisableFeatures), + GetSwitchDependentFeatureOverrides(*command_line)); return field_trial_list; }
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc index 443809d..2c57964 100644 --- a/content/browser/storage_partition_impl.cc +++ b/content/browser/storage_partition_impl.cc
@@ -721,17 +721,11 @@ StoragePartitionImpl::StoragePartitionImpl( BrowserContext* browser_context, const base::FilePath& partition_path, - bool is_in_memory, - const base::FilePath& relative_partition_path, - const std::string& partition_domain, storage::SpecialStoragePolicy* special_storage_policy) - : browser_context_(browser_context), - partition_path_(partition_path), - is_in_memory_(is_in_memory), - relative_partition_path_(relative_partition_path), - partition_domain_(partition_domain), + : partition_path_(partition_path), special_storage_policy_(special_storage_policy), network_context_client_binding_(this), + browser_context_(browser_context), deletion_helpers_running_(0) {} StoragePartitionImpl::~StoragePartitionImpl() { @@ -804,155 +798,156 @@ base::FilePath partition_path = context->GetPath().Append(relative_partition_path); - return base::WrapUnique(new StoragePartitionImpl( - context, partition_path, in_memory, relative_partition_path, - partition_domain, context->GetSpecialStoragePolicy())); -} + std::unique_ptr<StoragePartitionImpl> partition = + base::WrapUnique(new StoragePartitionImpl( + context, partition_path, context->GetSpecialStoragePolicy())); -void StoragePartitionImpl::Initialize() { - // Ensure that these methods are called on the UI thread, except for - // unittests where a UI thread might not have been created. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || - !BrowserThread::IsThreadInitialized(BrowserThread::UI)); - DCHECK(!initialized_); - initialized_ = true; + partition->is_in_memory_ = in_memory; + partition->relative_partition_path_ = relative_partition_path; // All of the clients have to be created and registered with the // QuotaManager prior to the QuotaManger being used. We do them // all together here prior to handing out a reference to anything // that utilizes the QuotaManager. - quota_manager_ = new storage::QuotaManager( - is_in_memory_, partition_path_, + partition->quota_manager_ = new storage::QuotaManager( + in_memory, partition_path, base::CreateSingleThreadTaskRunner({BrowserThread::IO}).get(), - browser_context_->GetSpecialStoragePolicy(), + context->GetSpecialStoragePolicy(), base::BindRepeating(&StoragePartitionImpl::GetQuotaSettings, - weak_factory_.GetWeakPtr())); + partition->weak_factory_.GetWeakPtr())); scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy = - quota_manager_->proxy(); + partition->quota_manager_->proxy(); // Each consumer is responsible for registering its QuotaClient during // its construction. - filesystem_context_ = - CreateFileSystemContext(browser_context_, partition_path_, is_in_memory_, - quota_manager_proxy.get()); + partition->filesystem_context_ = CreateFileSystemContext( + context, partition_path, in_memory, quota_manager_proxy.get()); - database_tracker_ = base::MakeRefCounted<storage::DatabaseTracker>( - partition_path_, is_in_memory_, - browser_context_->GetSpecialStoragePolicy(), quota_manager_proxy.get()); + partition->database_tracker_ = base::MakeRefCounted<storage::DatabaseTracker>( + partition_path, in_memory, context->GetSpecialStoragePolicy(), + quota_manager_proxy.get()); - dom_storage_context_ = DOMStorageContextWrapper::Create( - BrowserContext::GetConnectorFor(browser_context_), - is_in_memory_ ? base::FilePath() : browser_context_->GetPath(), - relative_partition_path_, browser_context_->GetSpecialStoragePolicy()); + partition->dom_storage_context_ = DOMStorageContextWrapper::Create( + BrowserContext::GetConnectorFor(context), + in_memory ? base::FilePath() : context->GetPath(), + relative_partition_path, context->GetSpecialStoragePolicy()); - idle_manager_ = std::make_unique<IdleManager>(); - lock_manager_ = new LockManager(); + partition->idle_manager_ = std::make_unique<IdleManager>(); + partition->lock_manager_ = new LockManager(); - base::FilePath path = is_in_memory_ ? base::FilePath() : partition_path_; - indexed_db_context_ = new IndexedDBContextImpl( - path, browser_context_->GetSpecialStoragePolicy(), quota_manager_proxy, + base::FilePath path = in_memory ? base::FilePath() : partition_path; + partition->indexed_db_context_ = new IndexedDBContextImpl( + path, context->GetSpecialStoragePolicy(), quota_manager_proxy, base::DefaultClock::GetInstance(), /*task_runner=*/nullptr); - cache_storage_context_ = new CacheStorageContextImpl(browser_context_); - cache_storage_context_->Init( - path, browser_context_->GetSpecialStoragePolicy(), quota_manager_proxy); + partition->cache_storage_context_ = new CacheStorageContextImpl(context); + partition->cache_storage_context_->Init( + path, context->GetSpecialStoragePolicy(), quota_manager_proxy); - service_worker_context_ = new ServiceWorkerContextWrapper(browser_context_); - service_worker_context_->set_storage_partition(this); + partition->service_worker_context_ = new ServiceWorkerContextWrapper(context); + partition->service_worker_context_->set_storage_partition(partition.get()); - appcache_service_ = base::MakeRefCounted<ChromeAppCacheService>( - quota_manager_proxy.get(), weak_factory_.GetWeakPtr()); + partition->appcache_service_ = base::MakeRefCounted<ChromeAppCacheService>( + quota_manager_proxy.get(), partition->weak_factory_.GetWeakPtr()); - shared_worker_service_ = std::make_unique<SharedWorkerServiceImpl>( - this, service_worker_context_, appcache_service_); + partition->shared_worker_service_ = std::make_unique<SharedWorkerServiceImpl>( + partition.get(), partition->service_worker_context_, + partition->appcache_service_); - push_messaging_context_ = - new PushMessagingContext(browser_context_, service_worker_context_); + partition->push_messaging_context_ = + new PushMessagingContext(context, partition->service_worker_context_); #if !defined(OS_ANDROID) - host_zoom_level_context_ = new HostZoomLevelContext( - browser_context_->CreateZoomLevelDelegate(partition_path_)); + partition->host_zoom_level_context_ = new HostZoomLevelContext( + context->CreateZoomLevelDelegate(partition_path)); #endif // !defined(OS_ANDROID) - platform_notification_context_ = new PlatformNotificationContextImpl( - path, browser_context_, service_worker_context_); - platform_notification_context_->Initialize(); + partition->platform_notification_context_ = + new PlatformNotificationContextImpl(path, context, + partition->service_worker_context_); + partition->platform_notification_context_->Initialize(); - devtools_background_services_context_ = + partition->devtools_background_services_context_ = base::MakeRefCounted<DevToolsBackgroundServicesContextImpl>( - browser_context_, service_worker_context_); + context, partition->service_worker_context_); - content_index_context_ = base::MakeRefCounted<ContentIndexContextImpl>( - browser_context_, service_worker_context_); + partition->content_index_context_ = + base::MakeRefCounted<ContentIndexContextImpl>( + context, partition->service_worker_context_); - background_fetch_context_ = base::MakeRefCounted<BackgroundFetchContext>( - browser_context_, service_worker_context_, cache_storage_context_, - quota_manager_proxy, devtools_background_services_context_); + partition->background_fetch_context_ = + base::MakeRefCounted<BackgroundFetchContext>( + context, partition->service_worker_context_, + partition->cache_storage_context_, quota_manager_proxy, + partition->devtools_background_services_context_); - background_sync_context_ = base::MakeRefCounted<BackgroundSyncContextImpl>(); - background_sync_context_->Init(service_worker_context_, - devtools_background_services_context_); + partition->background_sync_context_ = + base::MakeRefCounted<BackgroundSyncContextImpl>(); + partition->background_sync_context_->Init( + partition->service_worker_context_, + partition->devtools_background_services_context_); - payment_app_context_ = new PaymentAppContextImpl(); - payment_app_context_->Init(service_worker_context_); + partition->payment_app_context_ = new PaymentAppContextImpl(); + partition->payment_app_context_->Init(partition->service_worker_context_); - broadcast_channel_provider_ = new BroadcastChannelProvider(); + partition->broadcast_channel_provider_ = new BroadcastChannelProvider(); - bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); + partition->bluetooth_allowed_devices_map_ = new BluetoothAllowedDevicesMap(); scoped_refptr<ChromeBlobStorageContext> blob_context = - ChromeBlobStorageContext::GetFor(browser_context_); + ChromeBlobStorageContext::GetFor(context); - url_loader_factory_getter_ = new URLLoaderFactoryGetter(); - url_loader_factory_getter_->Initialize(this); + partition->url_loader_factory_getter_ = new URLLoaderFactoryGetter(); + partition->url_loader_factory_getter_->Initialize(partition.get()); - service_worker_context_->Init(path, quota_manager_proxy.get(), - browser_context_->GetSpecialStoragePolicy(), - blob_context.get(), - url_loader_factory_getter_.get()); + partition->service_worker_context_->Init( + path, quota_manager_proxy.get(), context->GetSpecialStoragePolicy(), + blob_context.get(), partition->url_loader_factory_getter_.get()); - blob_registry_ = - BlobRegistryWrapper::Create(blob_context, filesystem_context_); + partition->blob_registry_ = + BlobRegistryWrapper::Create(blob_context, partition->filesystem_context_); - prefetch_url_loader_service_ = - base::MakeRefCounted<PrefetchURLLoaderService>(browser_context_); + partition->prefetch_url_loader_service_ = + base::MakeRefCounted<PrefetchURLLoaderService>(context); - cookie_store_context_ = base::MakeRefCounted<CookieStoreContext>(); + partition->cookie_store_context_ = base::MakeRefCounted<CookieStoreContext>(); // Unit tests use the Initialize() callback to crash early if restoring the // CookieManagerStore's state from ServiceWorkerStorage fails. Production and // browser tests rely on CookieStoreManager's well-defined behavior when // restoring the state fails. - cookie_store_context_->Initialize(service_worker_context_, base::DoNothing()); + partition->cookie_store_context_->Initialize( + partition->service_worker_context_, base::DoNothing()); - native_file_system_manager_ = + partition->native_file_system_manager_ = base::MakeRefCounted<NativeFileSystemManagerImpl>( - filesystem_context_, blob_context, - browser_context_->GetNativeFileSystemPermissionContext()); + partition->filesystem_context_, blob_context, + context->GetNativeFileSystemPermissionContext()); GeneratedCodeCacheSettings settings = - GetContentClient()->browser()->GetGeneratedCodeCacheSettings( - browser_context_); + GetContentClient()->browser()->GetGeneratedCodeCacheSettings(context); // For Incognito mode, we should not persist anything on the disk so // we do not create a code cache. Caching the generated code in memory // is not useful, since V8 already maintains one copy in memory. - if (!is_in_memory_ && settings.enabled()) { - generated_code_cache_context_ = + if (!in_memory && settings.enabled()) { + partition->generated_code_cache_context_ = base::MakeRefCounted<GeneratedCodeCacheContext>(); base::FilePath code_cache_path; - if (partition_domain_.empty()) { + if (partition_domain.empty()) { code_cache_path = settings.path().AppendASCII("Code Cache"); } else { // For site isolated partitions use the config directory. code_cache_path = settings.path() - .Append(relative_partition_path_) + .Append(relative_partition_path) .AppendASCII("Code Cache"); } DCHECK_GE(settings.size_in_bytes(), 0); - GetGeneratedCodeCacheContext()->Initialize(code_cache_path, - settings.size_in_bytes()); + partition->GetGeneratedCodeCacheContext()->Initialize( + code_cache_path, settings.size_in_bytes()); } + + return partition; } base::FilePath StoragePartitionImpl::GetPath() { @@ -960,7 +955,6 @@ } network::mojom::NetworkContext* StoragePartitionImpl::GetNetworkContext() { - DCHECK(initialized_); if (!network_context_.is_bound()) InitNetworkContext(); return network_context_.get(); @@ -968,7 +962,6 @@ scoped_refptr<network::SharedURLLoaderFactory> StoragePartitionImpl::GetURLLoaderFactoryForBrowserProcess() { - DCHECK(initialized_); if (!shared_url_loader_factory_for_browser_process_) { shared_url_loader_factory_for_browser_process_ = new URLLoaderFactoryForBrowserProcess(this, false /* corb_enabled */); @@ -978,7 +971,6 @@ scoped_refptr<network::SharedURLLoaderFactory> StoragePartitionImpl::GetURLLoaderFactoryForBrowserProcessWithCORBEnabled() { - DCHECK(initialized_); if (!shared_url_loader_factory_for_browser_process_with_corb_) { shared_url_loader_factory_for_browser_process_with_corb_ = new URLLoaderFactoryForBrowserProcess(this, true /* corb_enabled */); @@ -988,13 +980,11 @@ std::unique_ptr<network::SharedURLLoaderFactoryInfo> StoragePartitionImpl::GetURLLoaderFactoryForBrowserProcessIOThread() { - DCHECK(initialized_); return url_loader_factory_getter_->GetNetworkFactoryInfo(); } network::mojom::CookieManager* StoragePartitionImpl::GetCookieManagerForBrowserProcess() { - DCHECK(initialized_); // Create the CookieManager as needed. if (!cookie_manager_for_browser_process_ || cookie_manager_for_browser_process_.encountered_error()) { @@ -1011,7 +1001,6 @@ int process_id, int routing_id, network::mojom::RestrictedCookieManagerRequest request) { - DCHECK(initialized_); if (!GetContentClient()->browser()->WillCreateRestrictedCookieManager( role, browser_context_, origin, is_service_worker, process_id, routing_id, &request)) { @@ -1022,85 +1011,69 @@ } storage::QuotaManager* StoragePartitionImpl::GetQuotaManager() { - DCHECK(initialized_); return quota_manager_.get(); } ChromeAppCacheService* StoragePartitionImpl::GetAppCacheService() { - DCHECK(initialized_); return appcache_service_.get(); } BackgroundSyncContextImpl* StoragePartitionImpl::GetBackgroundSyncContext() { - DCHECK(initialized_); return background_sync_context_.get(); } storage::FileSystemContext* StoragePartitionImpl::GetFileSystemContext() { - DCHECK(initialized_); return filesystem_context_.get(); } storage::DatabaseTracker* StoragePartitionImpl::GetDatabaseTracker() { - DCHECK(initialized_); return database_tracker_.get(); } DOMStorageContextWrapper* StoragePartitionImpl::GetDOMStorageContext() { - DCHECK(initialized_); return dom_storage_context_.get(); } IdleManager* StoragePartitionImpl::GetIdleManager() { - DCHECK(initialized_); return idle_manager_.get(); } LockManager* StoragePartitionImpl::GetLockManager() { - DCHECK(initialized_); return lock_manager_.get(); } IndexedDBContextImpl* StoragePartitionImpl::GetIndexedDBContext() { - DCHECK(initialized_); return indexed_db_context_.get(); } NativeFileSystemEntryFactory* StoragePartitionImpl::GetNativeFileSystemEntryFactory() { - DCHECK(initialized_); return native_file_system_manager_.get(); } CacheStorageContextImpl* StoragePartitionImpl::GetCacheStorageContext() { - DCHECK(initialized_); return cache_storage_context_.get(); } ServiceWorkerContextWrapper* StoragePartitionImpl::GetServiceWorkerContext() { - DCHECK(initialized_); return service_worker_context_.get(); } SharedWorkerServiceImpl* StoragePartitionImpl::GetSharedWorkerService() { - DCHECK(initialized_); return shared_worker_service_.get(); } #if !defined(OS_ANDROID) HostZoomMap* StoragePartitionImpl::GetHostZoomMap() { - DCHECK(initialized_); DCHECK(host_zoom_level_context_.get()); return host_zoom_level_context_->GetHostZoomMap(); } HostZoomLevelContext* StoragePartitionImpl::GetHostZoomLevelContext() { - DCHECK(initialized_); return host_zoom_level_context_.get(); } ZoomLevelDelegate* StoragePartitionImpl::GetZoomLevelDelegate() { - DCHECK(initialized_); DCHECK(host_zoom_level_context_.get()); return host_zoom_level_context_->GetZoomLevelDelegate(); } @@ -1108,66 +1081,54 @@ PlatformNotificationContextImpl* StoragePartitionImpl::GetPlatformNotificationContext() { - DCHECK(initialized_); return platform_notification_context_.get(); } BackgroundFetchContext* StoragePartitionImpl::GetBackgroundFetchContext() { - DCHECK(initialized_); return background_fetch_context_.get(); } PaymentAppContextImpl* StoragePartitionImpl::GetPaymentAppContext() { - DCHECK(initialized_); return payment_app_context_.get(); } BroadcastChannelProvider* StoragePartitionImpl::GetBroadcastChannelProvider() { - DCHECK(initialized_); return broadcast_channel_provider_.get(); } BluetoothAllowedDevicesMap* StoragePartitionImpl::GetBluetoothAllowedDevicesMap() { - DCHECK(initialized_); return bluetooth_allowed_devices_map_.get(); } BlobRegistryWrapper* StoragePartitionImpl::GetBlobRegistry() { - DCHECK(initialized_); return blob_registry_.get(); } PrefetchURLLoaderService* StoragePartitionImpl::GetPrefetchURLLoaderService() { - DCHECK(initialized_); return prefetch_url_loader_service_.get(); } CookieStoreContext* StoragePartitionImpl::GetCookieStoreContext() { - DCHECK(initialized_); return cookie_store_context_.get(); } GeneratedCodeCacheContext* StoragePartitionImpl::GetGeneratedCodeCacheContext() { - DCHECK(initialized_); return generated_code_cache_context_.get(); } DevToolsBackgroundServicesContextImpl* StoragePartitionImpl::GetDevToolsBackgroundServicesContext() { - DCHECK(initialized_); return devtools_background_services_context_.get(); } NativeFileSystemManagerImpl* StoragePartitionImpl::GetNativeFileSystemManager() { - DCHECK(initialized_); return native_file_system_manager_.get(); } ContentIndexContextImpl* StoragePartitionImpl::GetContentIndexContext() { - DCHECK(initialized_); return content_index_context_.get(); } @@ -1189,7 +1150,6 @@ void StoragePartitionImpl::OpenLocalStorage( const url::Origin& origin, blink::mojom::StorageAreaRequest request) { - DCHECK(initialized_); int process_id = bindings_.dispatch_context(); // TODO(943887): Replace HasSecurityState() call with something that can // preserve security state after process shutdown. The security state check @@ -1210,7 +1170,6 @@ void StoragePartitionImpl::OpenSessionStorage( const std::string& namespace_id, blink::mojom::SessionStorageNamespaceRequest request) { - DCHECK(initialized_); int process_id = bindings_.dispatch_context(); dom_storage_context_->OpenSessionStorage(process_id, namespace_id, bindings_.GetBadMessageCallback(), @@ -1220,7 +1179,6 @@ void StoragePartitionImpl::OnCanSendReportingReports( const std::vector<url::Origin>& origins, OnCanSendReportingReportsCallback callback) { - DCHECK(initialized_); PermissionController* permission_controller = BrowserContext::GetPermissionController(browser_context_); DCHECK(permission_controller); @@ -1241,7 +1199,6 @@ void StoragePartitionImpl::OnCanSendDomainReliabilityUpload( const GURL& origin, OnCanSendDomainReliabilityUploadCallback callback) { - DCHECK(initialized_); PermissionController* permission_controller = BrowserContext::GetPermissionController(browser_context_); std::move(callback).Run( @@ -1256,7 +1213,6 @@ const std::string& header_value, int load_flags, OnClearSiteDataCallback callback) { - DCHECK(initialized_); auto browser_context_getter = base::BindRepeating( GetBrowserContextFromStoragePartition, weak_factory_.GetWeakPtr()); auto web_contents_getter = base::BindRepeating( @@ -1274,7 +1230,6 @@ const GURL& site_for_cookies, const std::vector<net::CookieWithStatus>& cookie_list) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - DCHECK(initialized_); if (is_service_worker) { base::PostTask(FROM_HERE, {BrowserThread::IO}, base::BindOnce(&OnServiceWorkerCookiesChangedOnIO, @@ -1295,7 +1250,6 @@ const GURL& site_for_cookies, const std::vector<net::CookieWithStatus>& cookie_list) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - DCHECK(initialized_); if (is_service_worker) { base::PostTask( FROM_HERE, {BrowserThread::IO}, @@ -1600,7 +1554,6 @@ uint32_t quota_storage_remove_mask, const GURL& storage_origin) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - DCHECK(initialized_); CookieDeletionFilterPtr deletion_filter = CookieDeletionFilter::New(); if (!storage_origin.host().empty()) deletion_filter->host_name = storage_origin.host(); @@ -1615,7 +1568,6 @@ const base::Time begin, const base::Time end, base::OnceClosure callback) { - DCHECK(initialized_); CookieDeletionFilterPtr deletion_filter = CookieDeletionFilter::New(); if (!storage_origin.host().empty()) deletion_filter->host_name = storage_origin.host(); @@ -1635,7 +1587,6 @@ const base::Time begin, const base::Time end, base::OnceClosure callback) { - DCHECK(initialized_); ClearDataImpl(remove_mask, quota_storage_remove_mask, GURL(), origin_matcher, std::move(cookie_deletion_filter), perform_storage_cleanup, begin, end, std::move(callback)); @@ -1646,7 +1597,6 @@ const base::Time end, const base::RepeatingCallback<bool(const GURL&)>& url_matcher, base::OnceClosure callback) { - DCHECK(initialized_); // StoragePartitionCodeCacheDataRemover deletes itself when it is done. StoragePartitionCodeCacheDataRemover::Create(this, url_matcher, begin, end) ->Remove(std::move(callback)); @@ -1654,13 +1604,11 @@ void StoragePartitionImpl::Flush() { DCHECK_CURRENTLY_ON(BrowserThread::UI); - DCHECK(initialized_); if (GetDOMStorageContext()) GetDOMStorageContext()->Flush(); } void StoragePartitionImpl::ResetURLLoaderFactories() { - DCHECK(initialized_); GetNetworkContext()->ResetURLLoaderFactories(); url_loader_factory_for_browser_process_.reset(); url_loader_factory_for_browser_process_with_corb_.reset(); @@ -1668,12 +1616,10 @@ } void StoragePartitionImpl::ClearBluetoothAllowedDevicesMapForTesting() { - DCHECK(initialized_); bluetooth_allowed_devices_map_->Clear(); } void StoragePartitionImpl::FlushNetworkInterfaceForTesting() { - DCHECK(initialized_); DCHECK(network_context_); network_context_.FlushForTesting(); if (url_loader_factory_for_browser_process_) @@ -1687,7 +1633,6 @@ } void StoragePartitionImpl::WaitForDeletionTasksForTesting() { - DCHECK(initialized_); if (deletion_helpers_running_) { base::RunLoop loop; on_deletion_helpers_done_callback_ = loop.QuitClosure(); @@ -1696,7 +1641,6 @@ } void StoragePartitionImpl::WaitForCodeCacheShutdownForTesting() { - DCHECK(initialized_); if (generated_code_cache_context_) { // If this is still running its initialization task it may check // enabled features on a sequenced worker pool which could race @@ -1718,36 +1662,30 @@ mojo::BindingId StoragePartitionImpl::Bind( int process_id, mojo::InterfaceRequest<blink::mojom::StoragePartitionService> request) { - DCHECK(initialized_); return bindings_.AddBinding(this, std::move(request), process_id); } void StoragePartitionImpl::Unbind(mojo::BindingId binding_id) { - DCHECK(initialized_); bindings_.RemoveBinding(binding_id); } void StoragePartitionImpl::OverrideQuotaManagerForTesting( storage::QuotaManager* quota_manager) { - DCHECK(initialized_); quota_manager_ = quota_manager; } void StoragePartitionImpl::OverrideSpecialStoragePolicyForTesting( storage::SpecialStoragePolicy* special_storage_policy) { - DCHECK(initialized_); special_storage_policy_ = special_storage_policy; } void StoragePartitionImpl::ShutdownBackgroundSyncContextForTesting() { - DCHECK(initialized_); if (GetBackgroundSyncContext()) GetBackgroundSyncContext()->Shutdown(); } void StoragePartitionImpl::OverrideBackgroundSyncContextForTesting( BackgroundSyncContextImpl* background_sync_context) { - DCHECK(initialized_); DCHECK(!GetBackgroundSyncContext() || !GetBackgroundSyncContext()->background_sync_manager()); background_sync_context_ = background_sync_context; @@ -1816,7 +1754,6 @@ network::mojom::OriginPolicyManager* StoragePartitionImpl::GetOriginPolicyManagerForBrowserProcess() { - DCHECK(initialized_); if (!origin_policy_manager_for_browser_process_ || origin_policy_manager_for_browser_process_.encountered_error()) { GetNetworkContext()->GetOriginPolicyManager( @@ -1827,14 +1764,12 @@ void StoragePartitionImpl::SetOriginPolicyManagerForBrowserProcessForTesting( network::mojom::OriginPolicyManagerPtr test_origin_policy_manager) { - DCHECK(initialized_); origin_policy_manager_for_browser_process_ = std::move(test_origin_policy_manager); } void StoragePartitionImpl:: ResetOriginPolicyManagerForBrowserProcessForTesting() { - DCHECK(initialized_); origin_policy_manager_for_browser_process_ = nullptr; }
diff --git a/content/browser/storage_partition_impl.h b/content/browser/storage_partition_impl.h index 2ef45ac..40df282f6 100644 --- a/content/browser/storage_partition_impl.h +++ b/content/browser/storage_partition_impl.h
@@ -302,8 +302,6 @@ // If |in_memory| is true, the |relative_partition_path| is (ab)used as a way // of distinguishing different in-memory partitions, but nothing is persisted // on to disk. - // - // Initialize() must be called on the StoragePartitionImpl before using it. static std::unique_ptr<StoragePartitionImpl> Create( BrowserContext* context, bool in_memory, @@ -312,18 +310,8 @@ StoragePartitionImpl(BrowserContext* browser_context, const base::FilePath& partition_path, - bool is_in_memory, - const base::FilePath& relative_partition_path, - const std::string& partition_domain, storage::SpecialStoragePolicy* special_storage_policy); - // This must be called before calling any members of the StoragePartitionImpl - // except for GetPath and browser_context(). - // The purpose of the Create, Initialize sequence is that code that - // initializes members of the StoragePartitionImpl and gets a pointer to it - // can query properties of the StoragePartitionImpl (notably GetPath()). - void Initialize(); - // We will never have both remove_origin be populated and a cookie_matcher. void ClearDataImpl( uint32_t remove_mask, @@ -349,24 +337,11 @@ network::mojom::URLLoaderFactory* GetURLLoaderFactoryForBrowserProcessInternal(bool corb_enabled); - // Raw pointer that should always be valid. The BrowserContext owns the - // StoragePartitionImplMap which then owns StoragePartitionImpl. When the - // BrowserContext is destroyed, |this| will be destroyed too. - BrowserContext* browser_context_; - - const base::FilePath partition_path_; - - // |is_in_memory_|, |relative_partition_path_| and |partition_domain_| are - // cached from |StoragePartitionImpl::Create()| in order to re-create - // |NetworkContext|. - const bool is_in_memory_; - const base::FilePath relative_partition_path_; - const std::string partition_domain_; - - // Until a StoragePartitionImpl is initialized using Initialize(), only - // querying its path abd BrowserContext is allowed. - bool initialized_ = false; - + // |is_in_memory_| and |relative_partition_path_| are cached from + // |StoragePartitionImpl::Create()| in order to re-create |NetworkContext|. + bool is_in_memory_; + base::FilePath relative_partition_path_; + base::FilePath partition_path_; scoped_refptr<URLLoaderFactoryGetter> url_loader_factory_getter_; scoped_refptr<storage::QuotaManager> quota_manager_; scoped_refptr<ChromeAppCacheService> appcache_service_; @@ -435,6 +410,11 @@ network::mojom::OriginPolicyManagerPtr origin_policy_manager_for_browser_process_; + // Raw pointer that should always be valid. The BrowserContext owns the + // StoragePartitionImplMap which then owns StoragePartitionImpl. When the + // BrowserContext is destroyed, |this| will be destroyed too. + BrowserContext* browser_context_; + // See comments for site_for_service_worker(). GURL site_for_service_worker_;
diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc index b11e9dd..a68b4c5 100644 --- a/content/browser/storage_partition_impl_map.cc +++ b/content/browser/storage_partition_impl_map.cc
@@ -350,7 +350,6 @@ relative_partition_path, partition_domain)); StoragePartitionImpl* partition = partition_ptr.get(); partitions_[partition_config] = std::move(partition_ptr); - partition->Initialize(); // Arm the serviceworker cookie change observation API. partition->GetCookieStoreContext()->ListenToCookieChanges(
diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index 17bc64cd..0ab6494ae 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc
@@ -938,7 +938,7 @@ return http_response; } - // A basic worker that loads 3p.com/script + // A basic cacheable worker that loads 3p.com/script if (absolute_url.path() == "/worker.js") { auto http_response = std::make_unique<net::test_server::BasicHttpResponse>(); @@ -950,6 +950,7 @@ http_response->set_content(content); http_response->set_content_type("application/javascript"); + http_response->AddCustomHeader("Cache-Control", "max-age=100000"); return http_response; } @@ -962,8 +963,8 @@ return http_response; } - // A worker that loads a nested /worker.js on an origin provided as a query - // param. + // A cacheable worker that loads a nested /worker.js on an origin provided + // as a query param. if (absolute_url.path() == "/embedding_worker.js") { auto http_response = std::make_unique<net::test_server::BasicHttpResponse>(); @@ -979,6 +980,7 @@ http_response->set_content(content); http_response->set_content_type("application/javascript"); + http_response->AddCustomHeader("Cache-Control", "max-age=100000"); return http_response; } @@ -1036,39 +1038,21 @@ RenderFrameHostImpl* main_frame = static_cast<RenderFrameHostImpl*>(host_to_load_resource); - // If there is supposed to be a sub-frame, create it. + // If there is supposed to be a subframe, create it. if (sub_frame.is_valid()) { - const char kLoadIframeScript[] = R"( - let iframe = document.createElement('iframe'); - iframe.src = $1; - document.body.appendChild(iframe); - )"; - EXPECT_TRUE( - ExecuteScript(shell(), JsReplace(kLoadIframeScript, sub_frame))); - EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); - - host_to_load_resource = - static_cast<WebContentsImpl*>(shell()->web_contents()) - ->GetFrameTree() - ->root() - ->child_at(0) - ->current_frame_host(); + host_to_load_resource = CreateSubframe(sub_frame); } GURL resource = GenURL("3p.com", "/script"); + // If there is supposed to be a worker to load this resource, create it. + // Otherwise, load the resource directly. if (worker.is_valid()) { - const char kLoadWorkerScript[] = R"(let w = new Worker($1);)"; - EXPECT_TRUE(ExecuteScript(host_to_load_resource, - JsReplace(kLoadWorkerScript, worker))); + EXPECT_TRUE( + ExecuteScript(host_to_load_resource, GetWorkerScript(worker))); } else { - const char kLoadResourceScript[] = R"( - let script = document.createElement('script'); - script.src = $1; - document.body.appendChild(script); - )"; EXPECT_TRUE(ExecuteScript(host_to_load_resource, - JsReplace(kLoadResourceScript, resource))); + GetLoadResourceScript(resource))); } observer.WaitForResourceCompletion(resource); @@ -1138,6 +1122,79 @@ return (*observer.FindResource(main_url))->was_cached; } + // Loads a dedicated worker script and checks to see whether or not the + // script was cached. + bool DedicatedWorkerScriptCached(const GURL& url, + const GURL& sub_frame, + const GURL& worker) { + DCHECK(url.is_valid()); + DCHECK(worker.is_valid()); + + // Do a cross-process navigation to clear the in-memory cache. + // We assume that we don't start this call from "chrome://gpu", as + // otherwise it won't be a cross-process navigation. We are relying + // on this navigation to discard the old process. + EXPECT_TRUE(NavigateToURL(shell(), GetWebUIURL("gpu"))); + + // Observe network requests. + ResourceLoadObserver observer(shell()); + + EXPECT_TRUE(NavigateToURL(shell(), url)); + + RenderFrameHost* host_to_load_resource = + shell()->web_contents()->GetMainFrame(); + + // If there is supposed to be a subframe, create it. + if (sub_frame.is_valid()) { + host_to_load_resource = CreateSubframe(sub_frame); + } + + EXPECT_TRUE(ExecuteScript(host_to_load_resource, GetWorkerScript(worker))); + + observer.WaitForResourceCompletion(GenURL("3p.com", "/script")); + + return (*observer.FindResource(worker))->was_cached; + } + + // Gets script to create subframe. + std::string GetSubframeScript(const GURL& sub_frame) { + const char kLoadIframeScript[] = R"( + let iframe = document.createElement('iframe'); + iframe.src = $1; + document.body.appendChild(iframe); + )"; + return JsReplace(kLoadIframeScript, sub_frame); + } + + // Gets script to create worker. + std::string GetWorkerScript(const GURL& worker) { + const char kLoadWorkerScript[] = "let w = new Worker($1);"; + return JsReplace(kLoadWorkerScript, worker); + } + + // Gets script to load resource. + std::string GetLoadResourceScript(const GURL& resource) { + const char kLoadResourceScript[] = R"( + let script = document.createElement('script'); + script.src = $1; + document.body.appendChild(script); + )"; + return JsReplace(kLoadResourceScript, resource); + } + + // Creates and loads subframe, waits for load to stop, and then returns + // subframe from the web contents frame tree. + RenderFrameHost* CreateSubframe(const GURL& sub_frame) { + EXPECT_TRUE(ExecuteScript(shell(), GetSubframeScript(sub_frame))); + EXPECT_TRUE(WaitForLoadStop(shell()->web_contents())); + + return static_cast<WebContentsImpl*>(shell()->web_contents()) + ->GetFrameTree() + ->root() + ->child_at(0) + ->current_frame_host(); + } + GURL GenURL(const std::string& host, const std::string& path) { return embedded_test_server()->GetURL(host, path); } @@ -1475,6 +1532,46 @@ GenURL("e.com", "/worker.js"))); } +IN_PROC_BROWSER_TEST_P(WebContentsSplitCacheBrowserTestEnabled, + SplitCacheDedicatedWorkerScripts) { + // Load a.com's worker. The first time the worker script is loaded from the + // network and the second it's cached. + EXPECT_FALSE(DedicatedWorkerScriptCached( + GenURL("a.com", "/title1.html"), GURL(), GenURL("a.com", "/worker.js"))); + EXPECT_TRUE(DedicatedWorkerScriptCached( + GenURL("a.com", "/title1.html"), GURL(), GenURL("a.com", "/worker.js"))); + + // Load a nested worker with a new top-frame origin. It's a cache miss for + // the embedding worker the first time, as it hasn't been loaded yet, and + // then the second time it's cached. + EXPECT_FALSE( + DedicatedWorkerScriptCached(GenURL("c.com", "/title1.html"), GURL(), + GenURL("c.com", "/embedding_worker.js?c"))); + EXPECT_TRUE( + DedicatedWorkerScriptCached(GenURL("c.com", "/title1.html"), GURL(), + GenURL("c.com", "/embedding_worker.js?c"))); + + // Load a worker with a new top-frame origin and nested in a cross-origin + // iframe. It's a cache miss for the worker script the first time, then + // the second time it's cached. + EXPECT_FALSE(DedicatedWorkerScriptCached(GenURL("d.com", "/title1.html"), + GenURL("e.com", "/title1.html"), + GenURL("e.com", "/worker.js"))); + EXPECT_TRUE(DedicatedWorkerScriptCached(GenURL("d.com", "/title1.html"), + GenURL("e.com", "/title1.html"), + GenURL("e.com", "/worker.js"))); + + // Load a worker with a new top-frame origin and nested in a cross-origin + // iframe whose URL has previously been loaded. Due to split caching it's a + // cache miss for the worker script the first time. + EXPECT_FALSE(DedicatedWorkerScriptCached(GenURL("f.com", "/title1.html"), + GenURL("e.com", "/title1.html"), + GenURL("e.com", "/worker.js"))); + EXPECT_TRUE(DedicatedWorkerScriptCached(GenURL("f.com", "/title1.html"), + GenURL("e.com", "/title1.html"), + GenURL("e.com", "/worker.js"))); +} + IN_PROC_BROWSER_TEST_F(WebContentsSplitCacheBrowserTestDisabled, SplitCacheDedicatedWorkers) { // Load 3p.com/script from a.com's worker. The first time it's loaded from the
diff --git a/content/browser/worker_host/dedicated_worker_host.cc b/content/browser/worker_host/dedicated_worker_host.cc index 136a0d5..3f5f28c 100644 --- a/content/browser/worker_host/dedicated_worker_host.cc +++ b/content/browser/worker_host/dedicated_worker_host.cc
@@ -93,13 +93,25 @@ auto* storage_partition_impl = static_cast<StoragePartitionImpl*>( worker_process_host->GetStoragePartition()); - // Get a storage domain. + // Compute network isolation key. RenderFrameHostImpl* ancestor_render_frame_host = GetAncestorRenderFrameHost(); if (!ancestor_render_frame_host) { client_->OnScriptLoadStartFailed(); return; } + // Get the origin of the frame tree's root to use as top-frame origin. + // TODO(crbug.com/986167): Resolve issue of potential race condition. + url::Origin top_frame_origin(ancestor_render_frame_host->frame_tree_node() + ->frame_tree() + ->root() + ->current_origin()); + url::Origin current_frame_origin( + ancestor_render_frame_host->GetLastCommittedOrigin()); + network_isolation_key_ = + net::NetworkIsolationKey(top_frame_origin, current_frame_origin); + + // Get a storage domain. SiteInstance* site_instance = ancestor_render_frame_host->GetSiteInstance(); if (!site_instance) { client_->OnScriptLoadStartFailed(); @@ -135,8 +147,9 @@ WorkerScriptFetchInitiator::Start( worker_process_id_, script_url, request_initiator_origin, - credentials_mode, std::move(outside_fetch_client_settings_object), - ResourceType::kWorker, storage_partition_impl->GetServiceWorkerContext(), + network_isolation_key_, credentials_mode, + std::move(outside_fetch_client_settings_object), ResourceType::kWorker, + storage_partition_impl->GetServiceWorkerContext(), service_worker_handle_.get(), appcache_handle_->core(), std::move(blob_url_loader_factory), nullptr, storage_partition_impl, storage_domain, @@ -244,19 +257,11 @@ DCHECK(render_frame_host); network::mojom::TrustedURLLoaderHeaderClientPtrInfo no_header_client; - // Get the origin of the frame tree's root to use as top-frame origin. - // TODO(crbug.com/986167): Resolve issue of potential race condition. - url::Origin top_frame_origin(render_frame_host->frame_tree_node() - ->frame_tree() - ->root() - ->current_origin()); - RenderProcessHost* worker_process_host = render_frame_host->GetProcess(); DCHECK(worker_process_host); worker_process_host->CreateURLLoaderFactory( origin_, render_frame_host->cross_origin_embedder_policy(), - nullptr /* preferences */, - net::NetworkIsolationKey(top_frame_origin, origin_), + nullptr /* preferences */, network_isolation_key_, std::move(no_header_client), std::move(request)); }
diff --git a/content/browser/worker_host/dedicated_worker_host.h b/content/browser/worker_host/dedicated_worker_host.h index 07b6da6..f97635b 100644 --- a/content/browser/worker_host/dedicated_worker_host.h +++ b/content/browser/worker_host/dedicated_worker_host.h
@@ -118,6 +118,10 @@ const url::Origin origin_; + // The network isolation key to be used for both the worker script and the + // worker's subresources. + net::NetworkIsolationKey network_isolation_key_; + // This is kept alive during the lifetime of the dedicated worker, since it's // associated with Mojo interfaces (ServiceWorkerContainer and // URLLoaderFactory) that are needed to stay alive while the worker is
diff --git a/content/browser/worker_host/shared_worker_service_impl.cc b/content/browser/worker_host/shared_worker_service_impl.cc index aab76445..195875f 100644 --- a/content/browser/worker_host/shared_worker_service_impl.cc +++ b/content/browser/worker_host/shared_worker_service_impl.cc
@@ -237,10 +237,12 @@ // credentials mode specified by WorkerOptions for module script. const auto credentials_mode = network::mojom::CredentialsMode::kSameOrigin; + // TODO(crbug.com/955476): Populate the network isolation key based + // on script origin here and add test coverage. WorkerScriptFetchInitiator::Start( weak_host->worker_process_id(), weak_host->instance()->url(), - weak_host->instance()->constructor_origin(), credentials_mode, - std::move(outside_fetch_client_settings_object), + weak_host->instance()->constructor_origin(), net::NetworkIsolationKey(), + credentials_mode, std::move(outside_fetch_client_settings_object), ResourceType::kSharedWorker, service_worker_context_, service_worker_handle_raw, appcache_handle_core, std::move(blob_url_loader_factory), url_loader_factory_override_,
diff --git a/content/browser/worker_host/worker_script_fetch_initiator.cc b/content/browser/worker_host/worker_script_fetch_initiator.cc index 1ac0fbb0..93d41527 100644 --- a/content/browser/worker_host/worker_script_fetch_initiator.cc +++ b/content/browser/worker_host/worker_script_fetch_initiator.cc
@@ -58,6 +58,7 @@ int worker_process_id, const GURL& script_url, const url::Origin& request_initiator, + const net::NetworkIsolationKey& trusted_network_isolation_key, network::mojom::CredentialsMode credentials_mode, blink::mojom::FetchClientSettingsObjectPtr outside_fetch_client_settings_object, @@ -118,6 +119,8 @@ resource_request = std::make_unique<network::ResourceRequest>(); resource_request->url = script_url; resource_request->site_for_cookies = script_url; + resource_request->trusted_network_isolation_key = + trusted_network_isolation_key; resource_request->request_initiator = request_initiator; resource_request->referrer = sanitized_referrer.url, resource_request->referrer_policy = Referrer::ReferrerPolicyForUrlRequest(
diff --git a/content/browser/worker_host/worker_script_fetch_initiator.h b/content/browser/worker_host/worker_script_fetch_initiator.h index bbaacff..ea91b8e 100644 --- a/content/browser/worker_host/worker_script_fetch_initiator.h +++ b/content/browser/worker_host/worker_script_fetch_initiator.h
@@ -60,6 +60,7 @@ int worker_process_id, const GURL& script_url, const url::Origin& request_initiator, + const net::NetworkIsolationKey& trusted_network_isolation_key, network::mojom::CredentialsMode credentials_mode, blink::mojom::FetchClientSettingsObjectPtr outside_fetch_client_settings_object,
diff --git a/content/child/field_trial.cc b/content/child/field_trial.cc index 26b6e3e1..c9ec207d 100644 --- a/content/child/field_trial.cc +++ b/content/child/field_trial.cc
@@ -10,6 +10,7 @@ #include "base/macros.h" #include "base/metrics/field_trial.h" #include "build/build_config.h" +#include "content/public/common/content_switch_dependent_feature_overrides.h" #include "content/public/common/content_switches.h" #include "services/service_manager/embedder/descriptors.h" @@ -48,6 +49,16 @@ base::FieldTrialList::CreateFeaturesFromCommandLine( command_line, switches::kEnableFeatures, switches::kDisableFeatures, feature_list.get()); + // TODO(crbug.com/988603): This may be redundant. The way this is supposed to + // work is that the parent process's state should be passed via command-line + // to the child process, such that a feature explicitly enabled or disabled in + // the parent process via this mechanism (since the browser process also + // registers these switch-dependent overrides), it will get passed via the + // command line - so then no extra logic would be needed in the child. + // TODO(chlily): Test this more thoroughly and understand the behavior to see + // whether this is actually needed. + feature_list->RegisterExtraFeatureOverrides( + GetSwitchDependentFeatureOverrides(command_line)); base::FeatureList::SetInstance(std::move(feature_list)); }
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 08ff5124..9cc7f0c 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -197,6 +197,9 @@ if (base::FeatureList::IsEnabled(features::kWebXrHitTest)) WebRuntimeFeatures::EnableWebXRHitTest(true); + if (base::FeatureList::IsEnabled(features::kWebXrAnchors)) + WebRuntimeFeatures::EnableWebXRAnchors(true); + if (base::FeatureList::IsEnabled(features::kWebXrPlaneDetection)) WebRuntimeFeatures::EnableWebXRPlaneDetection(true); @@ -521,9 +524,9 @@ features::IsFormControlsRefreshEnabled()); if (base::FeatureList::IsEnabled( - blink::features::kAudioWorkletRealtimeThread)) { - WebRuntimeFeatures::EnableFeatureFromString( - "AudioWorkletRealtimeThread", true); + blink::features::kAudioWorkletRealtimeThread)) { + WebRuntimeFeatures::EnableFeatureFromString("AudioWorkletRealtimeThread", + true); } if (!base::FeatureList::IsEnabled(
diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn index ba06df0..452fe8ef 100644 --- a/content/public/common/BUILD.gn +++ b/content/public/common/BUILD.gn
@@ -135,6 +135,8 @@ "content_features.h", "content_ipc_logging.h", "content_paths.h", + "content_switch_dependent_feature_overrides.cc", + "content_switch_dependent_feature_overrides.h", "content_switches.cc", "content_switches.h", "context_menu_params.cc",
diff --git a/content/public/common/common_param_traits_macros.h b/content/public/common/common_param_traits_macros.h index a46588b8..bdf9e4ac5 100644 --- a/content/public/common/common_param_traits_macros.h +++ b/content/public/common/common_param_traits_macros.h
@@ -127,7 +127,6 @@ IPC_STRUCT_TRAITS_MEMBER(remote_fonts_enabled) IPC_STRUCT_TRAITS_MEMBER(javascript_can_access_clipboard) IPC_STRUCT_TRAITS_MEMBER(xslt_enabled) - IPC_STRUCT_TRAITS_MEMBER(xss_auditor_enabled) IPC_STRUCT_TRAITS_MEMBER(dns_prefetching_enabled) IPC_STRUCT_TRAITS_MEMBER(data_saver_enabled) IPC_STRUCT_TRAITS_MEMBER(data_saver_holdback_web_api_enabled)
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 949b9e8..01cae5a 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -73,6 +73,10 @@ const base::Feature kBlockCredentialedSubresources{ "BlockCredentialedSubresources", base::FEATURE_ENABLED_BY_DEFAULT}; +// Verify user activation notification by the browser side state. +const base::Feature kBrowserVerifiedUserActivation{ + "BrowserVerifiedUserActivation", base::FEATURE_DISABLED_BY_DEFAULT}; + // Controls whether Bundled HTTP Exchanges is enabled. // https://wicg.github.io/webpackage/draft-yasskin-wpack-bundled-exchanges.html const base::Feature kBundledHTTPExchanges{"BundledHTTPExchanges", @@ -356,6 +360,10 @@ #endif }; +// Whether we should composite a PLSA even if it means losing lcd text. +const base::Feature kPreferCompositingToLCDText = { + "PreferCompositingToLCDText", base::FEATURE_DISABLED_BY_DEFAULT}; + // Enables process sharing for sites that do not require a dedicated process // by using a default SiteInstance. Default SiteInstances will only be used // on platforms that do not use full site isolation. @@ -714,6 +722,10 @@ // Controls whether the WebXR Device API is enabled. const base::Feature kWebXr{"WebXR", base::FEATURE_DISABLED_BY_DEFAULT}; +// Enables access to anchors via WebXR API. +const base::Feature kWebXrAnchors{"WebXRAnchors", + base::FEATURE_DISABLED_BY_DEFAULT}; + // Enables access to raycasting against estimated XR scene geometry. const base::Feature kWebXrHitTest{"WebXRHitTest", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index c71e539e..f05012c 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -27,6 +27,7 @@ CONTENT_EXPORT extern const base::Feature kBackgroundFetch; CONTENT_EXPORT extern const base::Feature kBackForwardCache; CONTENT_EXPORT extern const base::Feature kBlockCredentialedSubresources; +CONTENT_EXPORT extern const base::Feature kBrowserVerifiedUserActivation; CONTENT_EXPORT extern const base::Feature kBundledHTTPExchanges; CONTENT_EXPORT extern const base::Feature kCacheInlineScriptCode; CONTENT_EXPORT extern const base::Feature kCacheStorageParallelOps; @@ -83,6 +84,7 @@ CONTENT_EXPORT extern const base::Feature kPeriodicBackgroundSync; CONTENT_EXPORT extern const base::Feature kPerNavigationMojoInterface; CONTENT_EXPORT extern const base::Feature kPepper3DImageChromium; +CONTENT_EXPORT extern const base::Feature kPreferCompositingToLCDText; CONTENT_EXPORT extern const base::Feature kPrioritizeBootstrapTasks; CONTENT_EXPORT extern const base::Feature kProactivelySwapBrowsingInstance; CONTENT_EXPORT extern const base::Feature @@ -148,6 +150,7 @@ CONTENT_EXPORT extern const base::Feature kWebRtcHideLocalIpsWithMdns; CONTENT_EXPORT extern const base::Feature kWebUsb; CONTENT_EXPORT extern const base::Feature kWebXr; +CONTENT_EXPORT extern const base::Feature kWebXrAnchors; CONTENT_EXPORT extern const base::Feature kWebXrHitTest; CONTENT_EXPORT extern const base::Feature kWebXrPlaneDetection; CONTENT_EXPORT extern const base::Feature kScriptStreamingOnPreload;
diff --git a/content/public/common/content_switch_dependent_feature_overrides.cc b/content/public/common/content_switch_dependent_feature_overrides.cc new file mode 100644 index 0000000..6883f00 --- /dev/null +++ b/content/public/common/content_switch_dependent_feature_overrides.cc
@@ -0,0 +1,43 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/public/common/content_switch_dependent_feature_overrides.h" + +namespace content { + +std::vector<base::FeatureList::FeatureOverrideInfo> +GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) { + // Describes a switch-dependent override. + struct SwitchDependentFeatureOverrideInfo { + // Switch that the override depends upon. The override will be registered if + // this switch is present. + const char* switch_name; + // Feature to override. + const std::reference_wrapper<const base::Feature> feature; + // State to override the feature with. + base::FeatureList::OverrideState override_state; + } override_info[] = { + // TODO(chlily): Add the Experimental Cookie SameSite features. (Coming in + // next CL, https://crrev.com/c/1691522). + }; + + // TODO(chlily): There are currently a few places where, to check if some + // functionality should be enabled, we check base::FeatureList::IsEnabled on + // some base::Feature and then also check whether the CommandLine for the + // current process has the switch kEnableExperimentalWebPlatformFeatures. It + // would be nice to have those features get set up here as switch-dependent + // feature overrides. That way, we could eliminate directly checking the + // command line for --enable-experimental-web-platform-features, and would + // have the base::Feature corresponding to that functionality correctly + // reflect whether it should be enabled. + + std::vector<base::FeatureList::FeatureOverrideInfo> overrides; + for (const auto& info : override_info) { + if (command_line.HasSwitch(info.switch_name)) + overrides.emplace_back(std::make_pair(info.feature, info.override_state)); + } + return overrides; +} + +} // namespace content
diff --git a/content/public/common/content_switch_dependent_feature_overrides.h b/content/public/common/content_switch_dependent_feature_overrides.h new file mode 100644 index 0000000..a08f8cc --- /dev/null +++ b/content/public/common/content_switch_dependent_feature_overrides.h
@@ -0,0 +1,26 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_PUBLIC_COMMON_CONTENT_SWITCH_DEPENDENT_FEATURE_OVERRIDES_H_ +#define CONTENT_PUBLIC_COMMON_CONTENT_SWITCH_DEPENDENT_FEATURE_OVERRIDES_H_ + +#include <vector> + +#include "base/command_line.h" +#include "base/feature_list.h" +#include "content/common/content_export.h" + +namespace content { + +// Returns a list of extra switch-dependent feature overrides to be applied +// during FeatureList initialization. +// TODO(chlily): Test more to understand whether this needs to be called for +// child processes, or if it's sufficient to just call this for the browser +// process and have that state propagate to child processes. +CONTENT_EXPORT std::vector<base::FeatureList::FeatureOverrideInfo> +GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line); + +} // namespace content + +#endif // CONTENT_PUBLIC_COMMON_CONTENT_SWITCH_DEPENDENT_FEATURE_OVERRIDES_H_
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index cb0218d..3014fd6 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc
@@ -301,9 +301,6 @@ // Don't enforce the same-origin policy. (Used by people testing their sites.) const char kDisableWebSecurity[] = "disable-web-security"; -// Disables Blink's XSSAuditor. The XSSAuditor mitigates reflective XSS. -const char kDisableXSSAuditor[] = "disable-xss-auditor"; - // Disable rasterizer that writes directly to GPU memory associated with tiles. const char kDisableZeroCopy[] = "disable-zero-copy";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 040997f..9252c4b 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h
@@ -99,7 +99,6 @@ extern const char kDisableV8IdleTasks[]; CONTENT_EXPORT extern const char kDisableWebGLImageChromium[]; CONTENT_EXPORT extern const char kDisableWebSecurity[]; -extern const char kDisableXSSAuditor[]; CONTENT_EXPORT extern const char kDisableZeroCopy[]; CONTENT_EXPORT extern const char kDisableZeroCopyDxgiVideo[]; CONTENT_EXPORT extern const char kDomAutomationController[];
diff --git a/content/public/common/web_preferences.cc b/content/public/common/web_preferences.cc index 6b17b58f..79a0b5fb 100644 --- a/content/public/common/web_preferences.cc +++ b/content/public/common/web_preferences.cc
@@ -79,7 +79,6 @@ remote_fonts_enabled(true), javascript_can_access_clipboard(false), xslt_enabled(true), - xss_auditor_enabled(true), dns_prefetching_enabled(true), data_saver_enabled(false), data_saver_holdback_web_api_enabled(false),
diff --git a/content/public/common/web_preferences.h b/content/public/common/web_preferences.h index 03f58a8c..93b31db 100644 --- a/content/public/common/web_preferences.h +++ b/content/public/common/web_preferences.h
@@ -95,7 +95,6 @@ bool remote_fonts_enabled; bool javascript_can_access_clipboard; bool xslt_enabled; - bool xss_auditor_enabled; // We don't use dns_prefetching_enabled to disable DNS prefetching. Instead, // we disable the feature at a lower layer so that we catch non-WebKit uses // of DNS prefetch as well.
diff --git a/content/renderer/media/stream/OWNERS b/content/renderer/media/stream/OWNERS deleted file mode 100644 index 32889cc..0000000 --- a/content/renderer/media/stream/OWNERS +++ /dev/null
@@ -1,6 +0,0 @@ -file://third_party/blink/common/mediastream/OWNERS - -per-file media_stream_audio_processor*=aluebs@chromium.org - -# TEAM: webrtc-dev@chromium.org -# COMPONENT: Blink>GetUserMedia
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 5a5e4844..9142891 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc
@@ -385,6 +385,8 @@ return true; if (!compositor_deps->IsLcdTextEnabled()) return true; + if (base::FeatureList::IsEnabled(features::kPreferCompositingToLCDText)) + return true; return DeviceScaleEnsuresTextQuality(device_scale_factor); }
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc index 15432c3..6fbe4b3 100644 --- a/content/shell/browser/shell_content_browser_client.cc +++ b/content/shell/browser/shell_content_browser_client.cc
@@ -413,6 +413,10 @@ } else { prefs->preferred_color_scheme = blink::PreferredColorScheme::kLight; } + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kForceHighContrast)) { + prefs->forced_colors = blink::ForcedColors::kActive; + } } DevToolsManagerDelegate*
diff --git a/content/shell/browser/web_test/blink_test_controller.cc b/content/shell/browser/web_test/blink_test_controller.cc index b2ee3b5..fce7fd5f 100644 --- a/content/shell/browser/web_test/blink_test_controller.cc +++ b/content/shell/browser/web_test/blink_test_controller.cc
@@ -78,6 +78,7 @@ #include "services/network/public/cpp/features.h" #include "services/network/public/mojom/network_service.mojom.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" +#include "ui/base/ui_base_switches.h" #include "ui/gfx/codec/png_codec.h" #if defined(OS_MACOSX) @@ -565,6 +566,10 @@ prefs->accelerated_2d_canvas_enabled = true; prefs->mock_scrollbars_enabled = true; } + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kForceHighContrast)) { + prefs->forced_colors = blink::ForcedColors::kActive; + } } }
diff --git a/content/shell/renderer/web_test/blink_test_helpers.cc b/content/shell/renderer/web_test/blink_test_helpers.cc index ff39fe90..26dc55b 100644 --- a/content/shell/renderer/web_test/blink_test_helpers.cc +++ b/content/shell/renderer/web_test/blink_test_helpers.cc
@@ -72,7 +72,6 @@ void ExportWebTestSpecificPreferences(const test_runner::TestPreferences& from, WebPreferences* to) { to->javascript_can_access_clipboard = from.java_script_can_access_clipboard; - to->xss_auditor_enabled = from.xss_auditor_enabled; to->editing_behavior = static_cast<EditingBehavior>(from.editing_behavior); to->default_font_size = from.default_font_size; to->minimum_font_size = from.minimum_font_size; @@ -105,7 +104,6 @@ prefs->dom_paste_enabled = true; prefs->javascript_can_access_clipboard = true; prefs->xslt_enabled = true; - prefs->xss_auditor_enabled = false; #if defined(OS_MACOSX) prefs->editing_behavior = EDITING_BEHAVIOR_MAC; #else
diff --git a/content/shell/test_runner/test_preferences.cc b/content/shell/test_runner/test_preferences.cc index 5a999fc..5729fa3 100644 --- a/content/shell/test_runner/test_preferences.cc +++ b/content/shell/test_runner/test_preferences.cc
@@ -18,7 +18,6 @@ void TestPreferences::Reset() { default_font_size = 16; minimum_font_size = 0; - xss_auditor_enabled = false; allow_file_access_from_file_urls = true; allow_running_of_insecure_content = true; default_text_encoding_name = WebString::FromUTF8("ISO-8859-1");
diff --git a/content/shell/test_runner/test_preferences.h b/content/shell/test_runner/test_preferences.h index 886ee2d5..318f5566 100644 --- a/content/shell/test_runner/test_preferences.h +++ b/content/shell/test_runner/test_preferences.h
@@ -15,7 +15,6 @@ struct TEST_RUNNER_EXPORT TestPreferences { int default_font_size; int minimum_font_size; - bool xss_auditor_enabled; bool allow_file_access_from_file_urls; bool allow_running_of_insecure_content; blink::WebString default_text_encoding_name;
diff --git a/content/shell/test_runner/test_runner.cc b/content/shell/test_runner/test_runner.cc index 7bd54bb..be5ed67a 100644 --- a/content/shell/test_runner/test_runner.cc +++ b/content/shell/test_runner/test_runner.cc
@@ -269,7 +269,6 @@ void SetViewSourceForFrame(const std::string& name, bool enabled); void SetWillSendRequestClearHeader(const std::string& header); void SetWindowIsKey(bool value); - void SetXSSAuditorEnabled(bool enabled); void NavigateSecondaryWindow(const std::string& url); void InspectSecondaryWindow(); void SimulateWebNotificationClick(gin::Arguments* args); @@ -597,8 +596,6 @@ .SetMethod("setWillSendRequestClearHeader", &TestRunnerBindings::SetWillSendRequestClearHeader) .SetMethod("setWindowIsKey", &TestRunnerBindings::SetWindowIsKey) - .SetMethod("setXSSAuditorEnabled", - &TestRunnerBindings::SetXSSAuditorEnabled) .SetMethod("navigateSecondaryWindow", &TestRunnerBindings::NavigateSecondaryWindow) .SetMethod("inspectSecondaryWindow", @@ -949,11 +946,6 @@ runner_->SetJavaScriptCanAccessClipboard(can_access); } -void TestRunnerBindings::SetXSSAuditorEnabled(bool enabled) { - if (runner_) - runner_->SetXSSAuditorEnabled(enabled); -} - void TestRunnerBindings::SetAllowFileAccessFromFileURLs(bool allow) { if (runner_) runner_->SetAllowFileAccessFromFileURLs(allow); @@ -2195,11 +2187,6 @@ delegate_->ApplyPreferences(); } -void TestRunner::SetXSSAuditorEnabled(bool enabled) { - delegate_->Preferences()->xss_auditor_enabled = enabled; - delegate_->ApplyPreferences(); -} - void TestRunner::SetAllowFileAccessFromFileURLs(bool allow) { delegate_->Preferences()->allow_file_access_from_file_urls = allow; delegate_->ApplyPreferences();
diff --git a/content/shell/test_runner/test_runner.h b/content/shell/test_runner/test_runner.h index cbdce21..7ec7ca59 100644 --- a/content/shell/test_runner/test_runner.h +++ b/content/shell/test_runner/test_runner.h
@@ -291,7 +291,6 @@ void SetPopupBlockingEnabled(bool block_popups); void SetJavaScriptCanAccessClipboard(bool can_access); - void SetXSSAuditorEnabled(bool enabled); void SetAllowFileAccessFromFileURLs(bool allow); void OverridePreference(gin::Arguments* arguments);
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index e6a6e31d..4bfcd3f5 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -52,6 +52,8 @@ "../browser/background_fetch/background_fetch_test_service_worker.h", "../browser/background_fetch/mock_background_fetch_delegate.cc", "../browser/background_fetch/mock_background_fetch_delegate.h", + "../browser/browsing_data/browsing_data_test_utils.cc", + "../browser/browsing_data/browsing_data_test_utils.h", "../browser/media/session/mock_media_session_player_observer.cc", "../browser/media/session/mock_media_session_player_observer.h", "../browser/media/session/mock_media_session_service_impl.cc", @@ -868,6 +870,7 @@ "../browser/browsing_data/browsing_data_remover_impl_browsertest.cc", "../browser/browsing_data/clear_site_data_handler_browsertest.cc", "../browser/browsing_data/conditional_cache_deletion_helper_browsertest.cc", + "../browser/browsing_data/same_site_data_remover_impl_browsertest.cc", "../browser/child_process_launcher_browsertest.cc", "../browser/child_process_security_policy_browsertest.cc", "../browser/content_service_browsertest.cc", @@ -1266,6 +1269,8 @@ libs = [ "uiautomationcore.lib" ] + configs += [ "//build/config/win:delayloads" ] + if (symbol_level != 0) { data += [ "$root_out_dir/content_browsertests.exe.pdb" ] } @@ -1911,7 +1916,6 @@ "../renderer/media/audio/mojo_audio_output_ipc_unittest.cc", "../renderer/media/render_media_log_unittest.cc", "../renderer/media/renderer_webaudiodevice_impl_unittest.cc", - "../renderer/media/stream/processed_local_audio_source_unittest.cc", "../renderer/media/webrtc/fake_rtc_rtp_transceiver.cc", "../renderer/media/webrtc/fake_rtc_rtp_transceiver.h", "../renderer/media/webrtc/media_stream_remote_video_source_unittest.cc",
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt index ff905f0..906c3dc 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
@@ -231,6 +231,7 @@ crbug.com/844483 [ d3d11 win amd ] conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8_alpha8-rgba-unsigned_byte.html [ RetryOnFailure ] crbug.com/828984 [ d3d11 win amd ] conformance2/textures/misc/copy-texture-image-webgl-specific.html [ RetryOnFailure ] crbug.com/878780 [ win amd ] conformance2/textures/webgl_canvas/* [ RetryOnFailure ] +crbug.com/992457 [ win amd ] conformance2/textures/canvas_sub_rectangle/tex-2d-srgb8-rgb-unsigned_byte.html [ RetryOnFailure ] # Recent AMD drivers seem to have a regression with 3D textures. crbug.com/angleproject/2424 [ d3d11 win amd ] conformance2/textures/canvas_sub_rectangle/tex-3d-* [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt index 89bc7b6..5012aa3 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt
@@ -342,6 +342,7 @@ crbug.com/923080 [ mac nvidia-0xfe9 ] conformance/ogles/GL/exp2/exp2_001_to_008.html [ RetryOnFailure ] crbug.com/635081 [ mac nvidia-0xfe9 ] conformance/programs/gl-bind-attrib-location-long-names-test.html [ Failure ] crbug.com/635081 [ mac nvidia-0xfe9 ] conformance/programs/gl-bind-attrib-location-test.html [ Failure ] +crbug.com/992313 [ mac nvidia-0xfe9 ] conformance/rendering/rendering-stencil-large-viewport.html [ RetryOnFailure ] crbug.com/635081 [ mac nvidia-0xfe9 no-passthrough ] conformance/renderbuffers/framebuffer-object-attachment.html [ Failure ] crbug.com/635081 [ mac nvidia-0xfe9 no-passthrough ] conformance/textures/misc/tex-input-validation.html [ Failure ] crbug.com/784817 [ mac nvidia-0xfe9 ] conformance/glsl/bugs/init-array-with-loop.html [ Failure ]
diff --git a/device/fido/bio/enrollment_handler.cc b/device/fido/bio/enrollment_handler.cc index 7872339..1fdd87a0b 100644 --- a/device/fido/bio/enrollment_handler.cc +++ b/device/fido/bio/enrollment_handler.cc
@@ -55,6 +55,10 @@ void BioEnrollmentHandler::Cancel(StatusCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + // Must CTAPHID_CANCEL before cancelCurrentEnrollment so the + // authenticator doesn't queue the enrollment cancel behind + // an ongoing enrollment. + authenticator_->Cancel(); authenticator_->BioEnrollCancel( base::BindOnce(&BioEnrollmentHandler::OnCancel, weak_factory_.GetWeakPtr(), std::move(callback))); @@ -62,6 +66,7 @@ void BioEnrollmentHandler::EnumerateTemplates(EnumerationCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(pin_token_response_); authenticator_->BioEnrollEnumerate( *pin_token_response_, base::BindOnce(&BioEnrollmentHandler::OnEnumerateTemplates, @@ -104,10 +109,7 @@ } authenticator_ = nullptr; - std::move(error_callback_) - .Run(pin_token_response_ - ? FidoReturnCode::kAuthenticatorRemovedDuringPINEntry - : FidoReturnCode::kSuccess); + std::move(error_callback_).Run(FidoReturnCode::kSuccess); } void BioEnrollmentHandler::OnTouch(FidoAuthenticator* authenticator) {
diff --git a/device/fido/features.h b/device/fido/features.h index 56d45e9..310aa788 100644 --- a/device/fido/features.h +++ b/device/fido/features.h
@@ -27,7 +27,7 @@ // Enable biometric enrollment in the security keys settings UI. COMPONENT_EXPORT(DEVICE_FIDO) extern const base::Feature kWebAuthBiometricEnrollment; -// + // Enable credential management in the security keys settings UI. COMPONENT_EXPORT(DEVICE_FIDO) extern const base::Feature kWebAuthCredentialManagement;
diff --git a/infra/config/cr-buildbucket.cfg b/infra/config/cr-buildbucket.cfg index 49f30bb..ddddaf1 100644 --- a/infra/config/cr-buildbucket.cfg +++ b/infra/config/cr-buildbucket.cfg
@@ -4252,6 +4252,11 @@ } builders { mixins: "linux-try" + mixins: "builderless" + name: "linux-viz-rel" + } + builders { + mixins: "linux-try" mixins: "goma-j150" mixins: "builderless" name: "linux_chromium_tsan_rel_ng"
diff --git a/infra/config/luci-milo.cfg b/infra/config/luci-milo.cfg index 9d2ac5e6..cfc60d9 100644 --- a/infra/config/luci-milo.cfg +++ b/infra/config/luci-milo.cfg
@@ -4365,6 +4365,9 @@ name: "buildbucket/luci.chromium.try/linux_upload_clang" } builders { + name: "buildbucket/luci.chromium.try/linux-viz-rel" + } + builders { name: "buildbucket/luci.chromium.try/linux_vr" } builder_view_only: true @@ -5111,6 +5114,9 @@ name: "buildbucket/luci.chromium.try/linux_upload_clang" } builders { + name: "buildbucket/luci.chromium.try/linux-viz-rel" + } + builders { name: "buildbucket/luci.chromium.try/ios-device" } builders {
diff --git a/ios/chrome/browser/crash_report/breakpad_helper.h b/ios/chrome/browser/crash_report/breakpad_helper.h index a9698e7..dee1904 100644 --- a/ios/chrome/browser/crash_report/breakpad_helper.h +++ b/ios/chrome/browser/crash_report/breakpad_helper.h
@@ -103,20 +103,17 @@ // state is in progress, otherwise remove the key. void SetDestroyingAndRebuildingIncognitoBrowserState(bool in_progress); -// Sets a key indicating the view controller that was being presented, iff the -// view controller's view was already in the view hierarchy before the BVC -// attempted to present it. |active_view_controller| is the view controller -// being presented by BVC. |presenting_view_controller| is -// |active_view_controller|'s presenting view controller. -// |parent_view_controller| is |active_view_controller|'s parent view -// controller. -void SetBVCPresentingActiveViewController(NSString* active_view_controller, - NSString* presenting_view_controller, - NSString* parent_view_controller); +// Sets a key to help debug a crash when animating from grid to visible tab. +// |to_view_controller| is the view controller about to be presented. The +// remaining parameters relate to the |to_view_controller|. +void SetGridToVisibleTabAnimation(NSString* to_view_controller, + NSString* presenting_view_controller, + NSString* presented_view_controller, + NSString* parent_view_controller); -// Removes the key indicating that the BVC is presenting an active view -// controller. -void RemoveBVCPresentingActiveViewController(); +// Removes the key to help debug a crash when animating from grid to visible +// tab. +void RemoveGridToVisibleTabAnimation(); // Sets a key in browser to store the playback state of media player (audio or // video). This function records a new start. This function is called for each
diff --git a/ios/chrome/browser/crash_report/breakpad_helper.mm b/ios/chrome/browser/crash_report/breakpad_helper.mm index b30e3f8..279fddc 100644 --- a/ios/chrome/browser/crash_report/breakpad_helper.mm +++ b/ios/chrome/browser/crash_report/breakpad_helper.mm
@@ -49,8 +49,7 @@ NSString* const kMemoryWarningCount = @"memory_warning_count"; NSString* const kUptimeAtRestoreInMs = @"uptime_at_restore_in_ms"; NSString* const kUploadedInRecoveryMode = @"uploaded_in_recovery_mode"; -NSString* const kBVCPresentingActiveViewController = - @"bvc_presenting_active_vc"; +NSString* const kGridToVisibleTabAnimation = @"grid_to_visible_tab_animation"; // Multiple state information are combined into one CrachReportMultiParameter // to save limited and finite number of ReportParameters. @@ -342,18 +341,20 @@ } } -void SetBVCPresentingActiveViewController(NSString* active_view_controller, - NSString* presenting_view_controller, - NSString* parent_view_controller) { - NSString* formatted_value = [NSString - stringWithFormat:@"{activeVC:%@, presentingVC:%@, parentVC:%@}", - active_view_controller, presenting_view_controller, - parent_view_controller]; - AddReportParameter(kBVCPresentingActiveViewController, formatted_value, true); +void SetGridToVisibleTabAnimation(NSString* to_view_controller, + NSString* presenting_view_controller, + NSString* presented_view_controller, + NSString* parent_view_controller) { + NSString* formatted_value = + [NSString stringWithFormat: + @"{toVC:%@, presentingVC:%@, presentedVC:%@, parentVC:%@}", + to_view_controller, presenting_view_controller, + presented_view_controller, parent_view_controller]; + AddReportParameter(kGridToVisibleTabAnimation, formatted_value, true); } -void RemoveBVCPresentingActiveViewController() { - RemoveReportParameter(kBVCPresentingActiveViewController); +void RemoveGridToVisibleTabAnimation() { + RemoveReportParameter(kGridToVisibleTabAnimation); } void MediaStreamPlaybackDidStart() {
diff --git a/ios/chrome/browser/ios_chrome_main_parts.mm b/ios/chrome/browser/ios_chrome_main_parts.mm index f503a5cf..4e1a170 100644 --- a/ios/chrome/browser/ios_chrome_main_parts.mm +++ b/ios/chrome/browser/ios_chrome_main_parts.mm
@@ -232,10 +232,13 @@ // On iOS, GPU benchmarking is not supported. So, pass in a dummy value for // the name of the switch that enables gpu benchmarking. + // TODO(crbug.com/988603): This should also set up extra switch-dependent + // feature overrides. application_context_->GetVariationsService()->SetupFieldTrials( "dummy-enable-gpu-benchmarking", switches::kEnableFeatures, switches::kDisableFeatures, /*unforceable_field_trials=*/std::set<std::string>(), variation_ids, + std::vector<base::FeatureList::FeatureOverrideInfo>(), std::move(feature_list), &ios_field_trials_); }
diff --git a/ios/chrome/browser/ui/browser_view/BUILD.gn b/ios/chrome/browser/ui/browser_view/BUILD.gn index fa3d619..4946272 100644 --- a/ios/chrome/browser/ui/browser_view/BUILD.gn +++ b/ios/chrome/browser/ui/browser_view/BUILD.gn
@@ -43,7 +43,6 @@ "//ios/chrome/browser/autofill:autofill_internal", "//ios/chrome/browser/bookmarks", "//ios/chrome/browser/browser_state", - "//ios/chrome/browser/crash_report", "//ios/chrome/browser/download", "//ios/chrome/browser/download:features", "//ios/chrome/browser/feature_engagement",
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm index 805a9abf..f4e03652 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
@@ -32,7 +32,6 @@ #include "ios/chrome/app/tests_hook.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/chrome_url_constants.h" -#include "ios/chrome/browser/crash_report/breakpad_helper.h" #import "ios/chrome/browser/download/download_manager_tab_helper.h" #include "ios/chrome/browser/feature_engagement/tracker_factory.h" #include "ios/chrome/browser/feature_engagement/tracker_util.h" @@ -1591,6 +1590,7 @@ [self updateDialogPresenterActiveState]; [self updateBroadcastState]; [_toolbarUIUpdater updateState]; + [self.infobarContainerCoordinator baseViewDidAppear]; // |viewDidAppear| can be called after |browserState| is destroyed. Since // |presentBubblesIfEligible| requires that |self.browserState| is not NULL, @@ -1857,30 +1857,6 @@ [self.sideSwipeController resetContentView]; } - // TODO(crbug.com/959774): The logging below is to better understand a - // NSInvalidArgumentException crash with the note "Application tried to - // present modally an active controller <BrowserViewController: 0x13e88d000>". - // Code experiments showed that the referenced BrowserViewController is the - // presenter, not the presentee. - if (viewControllerToPresent.view.window) { - NSString* activeViewController = - NSStringFromClass([viewControllerToPresent class]); - NSString* presentingViewController = NSStringFromClass( - [viewControllerToPresent.presentingViewController class]); - NSString* parentViewController = - NSStringFromClass([viewControllerToPresent.parentViewController class]); - breakpad_helper::SetBVCPresentingActiveViewController( - activeViewController, presentingViewController, parentViewController); - - ProceduralBlock finalCompletionHandlerCopy = [finalCompletionHandler copy]; - finalCompletionHandler = ^{ - if (finalCompletionHandlerCopy) - finalCompletionHandlerCopy(); - // Remove the crash log since the presentation completed without a crash. - breakpad_helper::RemoveBVCPresentingActiveViewController(); - }; - } - // TODO(crbug.com/965688): An Infobar message is currently the only presented // controller that allows interaction with the rest of the App while its being // presented. Dismiss it in case the user or system has triggered another
diff --git a/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm b/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm index 5299005e..a22ec62 100644 --- a/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm +++ b/ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator.mm
@@ -10,6 +10,7 @@ #import "ios/chrome/browser/ui/infobars/banners/infobar_banner_presentation_state.h" #import "ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator_implementation.h" #import "ios/chrome/browser/ui/infobars/infobar_badge_ui_delegate.h" +#import "ios/chrome/browser/ui/infobars/infobar_container.h" #import "ios/chrome/browser/ui/infobars/presentation/infobar_banner_positioner.h" #import "ios/chrome/browser/ui/infobars/presentation/infobar_banner_transition_driver.h" #import "ios/chrome/browser/ui/infobars/presentation/infobar_modal_positioner.h" @@ -238,6 +239,7 @@ self.bannerTransitionDriver = nil; animatedFullscreenDisabler_ = nullptr; [self infobarWasDismissed]; + [self.infobarContainer childCoordinatorBannerWasDismissed:self.infobarType]; } #pragma mark InfobarBannerPositioner
diff --git a/ios/chrome/browser/ui/infobars/infobar_container.h b/ios/chrome/browser/ui/infobars/infobar_container.h index 1468725..0aaf5212 100644 --- a/ios/chrome/browser/ui/infobars/infobar_container.h +++ b/ios/chrome/browser/ui/infobars/infobar_container.h
@@ -14,6 +14,10 @@ @protocol InfobarContainer // Informs the InfobarContainer Coordinator that its child coordinator of type +// |infobarType| has dismissed its banner. +- (void)childCoordinatorBannerWasDismissed:(InfobarType)infobarType; + +// Informs the InfobarContainer Coordinator that its child coordinator of type // |infobarType| has stopped. - (void)childCoordinatorStopped:(InfobarType)infobarType;
diff --git a/ios/chrome/browser/ui/infobars/infobar_container_coordinator.h b/ios/chrome/browser/ui/infobars/infobar_container_coordinator.h index eb057eb..005350d 100644 --- a/ios/chrome/browser/ui/infobars/infobar_container_coordinator.h +++ b/ios/chrome/browser/ui/infobars/infobar_container_coordinator.h
@@ -49,6 +49,10 @@ // Updates the InfobarContainer according to the positioner information. - (void)updateInfobarContainer; +// Notifies the coordinator that its baseViewController's viewDidAppear. This +// means the view is now visible and part of the main window hierarchy. +- (void)baseViewDidAppear; + // YES if an Infobar is being presented for |webState|. - (BOOL)isInfobarPresentingForWebState:(web::WebState*)webState;
diff --git a/ios/chrome/browser/ui/infobars/infobar_container_coordinator.mm b/ios/chrome/browser/ui/infobars/infobar_container_coordinator.mm index 865b68a..507ebda 100644 --- a/ios/chrome/browser/ui/infobars/infobar_container_coordinator.mm +++ b/ios/chrome/browser/ui/infobars/infobar_container_coordinator.mm
@@ -48,6 +48,11 @@ // can display. @property(nonatomic, strong) NSMutableDictionary<NSNumber*, InfobarCoordinator*>* infobarCoordinators; +// Array of Coordinators which banners haven't been presented yet. Once a +// Coordinator banner is presented it should be removed from this Array. If +// empty then it means there are no banners queued to be presented. +@property(nonatomic, strong) + NSMutableArray<InfobarCoordinator*>* infobarCoordinatorsToPresent; @end @@ -62,6 +67,7 @@ if (self) { _webStateList = webStateList; _infobarCoordinators = [NSMutableDictionary dictionary]; + _infobarCoordinatorsToPresent = [NSMutableArray array]; } return self; } @@ -156,6 +162,13 @@ completion(); } +- (void)baseViewDidAppear { + InfobarCoordinator* coordinator = + [self.infobarCoordinatorsToPresent firstObject]; + if (coordinator) + [self presentBannerForInfobarCoordinator:coordinator]; +} + #pragma mark - ChromeCoordinator - (MutableCoordinatorArray*)childCoordinators { @@ -193,7 +206,9 @@ return InfobarBannerPresentationState::NotPresented; } -#pragma mark - InfobarConsumer +#pragma mark - Protocols + +#pragma mark InfobarContainerConsumer - (void)addInfoBarWithDelegate:(id<InfobarUIDelegate>)infoBarDelegate { DCHECK(IsInfobarUIRebootEnabled()); @@ -211,24 +226,12 @@ infobarCoordinator.baseViewController = self.baseViewController; infobarCoordinator.dispatcher = self.dispatcher; infobarCoordinator.infobarContainer = self; - if (!infobarCoordinator.bannerWasPresented) - [infobarCoordinator presentInfobarBannerAnimated:YES completion:nil]; - self.infobarViewController = infobarCoordinator.bannerViewController; - - // Dismisses the presented InfobarCoordinator banner after - // kInfobarBannerPresentationDurationInSeconds seconds. - if (!UIAccessibilityIsVoiceOverRunning()) { - dispatch_time_t popTime = dispatch_time( - DISPATCH_TIME_NOW, - kInfobarBannerPresentationDurationInSeconds * NSEC_PER_SEC); - dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { - [infobarCoordinator dismissInfobarBannerAfterInteraction]; - }); - } + [self presentBannerForInfobarCoordinator:infobarCoordinator]; } - (void)infobarManagerWillChange { self.infobarCoordinators = [NSMutableDictionary dictionary]; + self.infobarCoordinatorsToPresent = [NSMutableArray array]; } - (void)setUserInteractionEnabled:(BOOL)enabled { @@ -243,13 +246,20 @@ #pragma mark InfobarContainer +- (void)childCoordinatorBannerWasDismissed:(InfobarType)infobarType { + InfobarCoordinator* coordinator = + [self.infobarCoordinatorsToPresent firstObject]; + if (coordinator) + [self presentBannerForInfobarCoordinator:coordinator]; +} + - (void)childCoordinatorStopped:(InfobarType)infobarType { DCHECK(IsInfobarUIRebootEnabled()); NSNumber* infobarKey = [NSNumber numberWithInt:static_cast<int>(infobarType)]; [self.infobarCoordinators removeObjectForKey:infobarKey]; } -#pragma mark - InfobarCommands +#pragma mark InfobarCommands - (void)displayModalInfobar:(InfobarType)infobarType { NSArray* allCoordinators = [self.infobarCoordinators allValues]; @@ -257,4 +267,42 @@ [infobarCoordinator presentInfobarModal]; } +#pragma mark - Private + +// Presents the infobarBanner for |infobarCoordinator| if possible, if not it +// queues the banner in self.infobarCoordinatorsToPresent for future +// presentation. +- (void)presentBannerForInfobarCoordinator: + (InfobarCoordinator*)infobarCoordinator { + // Each banner can only be presented once. + if (infobarCoordinator.bannerWasPresented) + return; + + // If a banner is being presented or base VC is not in window, queue it then + // return. + if (!(self.infobarBannerState == + InfobarBannerPresentationState::NotPresented) || + (!self.baseViewController.view.window)) { + if (![self.infobarCoordinatorsToPresent containsObject:infobarCoordinator]) + [self.infobarCoordinatorsToPresent addObject:infobarCoordinator]; + return; + } + + // Present Banner. + [infobarCoordinator presentInfobarBannerAnimated:YES completion:nil]; + self.infobarViewController = infobarCoordinator.bannerViewController; + [self.infobarCoordinatorsToPresent removeObject:infobarCoordinator]; + + // Dismisses the presented InfobarCoordinator banner after + // kInfobarBannerPresentationDurationInSeconds seconds. + if (!UIAccessibilityIsVoiceOverRunning()) { + dispatch_time_t popTime = dispatch_time( + DISPATCH_TIME_NOW, + kInfobarBannerPresentationDurationInSeconds * NSEC_PER_SEC); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { + [infobarCoordinator dismissInfobarBannerAfterInteraction]; + }); + } +} + @end
diff --git a/ios/chrome/browser/ui/infobars/infobar_container_coordinator_unittest.mm b/ios/chrome/browser/ui/infobars/infobar_container_coordinator_unittest.mm index ded3d4d..a951007d 100644 --- a/ios/chrome/browser/ui/infobars/infobar_container_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/infobars/infobar_container_coordinator_unittest.mm
@@ -48,6 +48,17 @@ } @end +@interface FakeBaseViewController : UIViewController +@property(nonatomic, weak) InfobarContainerCoordinator* containerCoordinator; +@end + +@implementation FakeBaseViewController +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [self.containerCoordinator baseViewDidAppear]; +} +@end + // Test fixture for testing InfobarContainerCoordinatorTest. class InfobarContainerCoordinatorTest : public PlatformTest { protected: @@ -55,7 +66,7 @@ : browser_state_(TestChromeBrowserState::Builder().Build()), web_state_list_( std::make_unique<WebStateList>(&web_state_list_delegate_)), - base_view_controller_([[UIViewController alloc] init]), + base_view_controller_([[FakeBaseViewController alloc] init]), positioner_([[TestContainerCoordinatorPositioner alloc] init]) { // Enable kInfobarUIReboot flag. feature_list_.InitAndEnableFeature(kInfobarUIReboot); @@ -85,6 +96,7 @@ initWithBaseViewController:base_view_controller_ browserState:browser_state_.get() webStateList:web_state_list_.get()]; + base_view_controller_.containerCoordinator = infobar_container_coordinator_; [scoped_key_window_.Get() setRootViewController:base_view_controller_]; positioner_.baseView = base_view_controller_.view; infobar_container_coordinator_.positioner = positioner_; @@ -140,14 +152,14 @@ // Setup the InfobarCoordinator and InfobarDelegate. TestInfoBarDelegate* test_infobar_delegate = new TestInfoBarDelegate(@"Title 2"); - InfobarConfirmCoordinator* coordinator = [[InfobarConfirmCoordinator alloc] + second_coordinator_ = [[InfobarConfirmCoordinator alloc] initWithInfoBarDelegate:test_infobar_delegate type:InfobarType::kInfobarTypePasswordSave]; std::unique_ptr<ConfirmInfoBarDelegate> infobar_delegate = std::unique_ptr<ConfirmInfoBarDelegate>(test_infobar_delegate); - GetInfobarManager()->AddInfoBar( - std::make_unique<InfoBarIOS>(coordinator, std::move(infobar_delegate))); + GetInfobarManager()->AddInfoBar(std::make_unique<InfoBarIOS>( + second_coordinator_, std::move(infobar_delegate))); } void AddSecondWebstate() { @@ -180,9 +192,10 @@ FakeWebStateListDelegate web_state_list_delegate_; web::TestNavigationManager* navigation_manager_; ScopedKeyWindow scoped_key_window_; - UIViewController* base_view_controller_; + FakeBaseViewController* base_view_controller_; TestContainerCoordinatorPositioner* positioner_; InfobarConfirmCoordinator* coordinator_; + InfobarConfirmCoordinator* second_coordinator_; std::unique_ptr<ConfirmInfoBarDelegate> infobar_delegate_; ConfirmInfoBarController* legacy_controller_; std::unique_ptr<ConfirmInfoBarDelegate> legacy_infobar_delegate_; @@ -577,4 +590,88 @@ [coordinator_ stop]; ASSERT_EQ(NSUInteger(1), infobar_container_coordinator_.childCoordinators.count); + + // Stop the second Coordinator. + [second_coordinator_ stop]; + ASSERT_EQ(NSUInteger(0), + infobar_container_coordinator_.childCoordinators.count); +} + +// Tests that that a second Infobar (added right after the first one) is +// displayed after the first one has been dismissed. +TEST_F(InfobarContainerCoordinatorTest, TestInfobarQueueAndDisplay) { + AddInfobar(); + AddSecondInfobar(); + ASSERT_EQ(NSUInteger(2), + infobar_container_coordinator_.childCoordinators.count); + + EXPECT_TRUE(base::test::ios::WaitUntilConditionOrTimeout( + base::test::ios::kWaitForUIElementTimeout, ^bool { + return coordinator_.infobarBannerState == + InfobarBannerPresentationState::Presented; + })); + ASSERT_EQ(infobar_container_coordinator_.infobarBannerState, + InfobarBannerPresentationState::Presented); + + [infobar_container_coordinator_ dismissInfobarBannerAnimated:NO + completion:nil]; + ASSERT_TRUE(base::test::ios::WaitUntilConditionOrTimeout( + base::test::ios::kWaitForUIElementTimeout, ^bool { + return coordinator_.infobarBannerState == + InfobarBannerPresentationState::NotPresented; + })); + + EXPECT_TRUE(base::test::ios::WaitUntilConditionOrTimeout( + base::test::ios::kWaitForUIElementTimeout, ^bool { + return second_coordinator_.infobarBannerState == + InfobarBannerPresentationState::Presented; + })); + ASSERT_EQ(infobar_container_coordinator_.infobarBannerState, + InfobarBannerPresentationState::Presented); + + ASSERT_EQ(NSUInteger(2), + infobar_container_coordinator_.childCoordinators.count); +} + +// Tests that Infobars added while the baseVC is not in window will be displayed +// once the baseVC moves to it. +TEST_F(InfobarContainerCoordinatorTest, + TestInfobarQueueAndDisplayWhenAppeared) { + [scoped_key_window_.Get() setRootViewController:nil]; + AddInfobar(); + AddSecondInfobar(); + + ASSERT_EQ(infobar_container_coordinator_.infobarBannerState, + InfobarBannerPresentationState::NotPresented); + ASSERT_EQ(NSUInteger(2), + infobar_container_coordinator_.childCoordinators.count); + + [scoped_key_window_.Get() setRootViewController:base_view_controller_]; + + EXPECT_TRUE(base::test::ios::WaitUntilConditionOrTimeout( + base::test::ios::kWaitForUIElementTimeout, ^bool { + return coordinator_.infobarBannerState == + InfobarBannerPresentationState::Presented; + })); + ASSERT_EQ(coordinator_.infobarBannerState, + InfobarBannerPresentationState::Presented); + + [infobar_container_coordinator_ dismissInfobarBannerAnimated:NO + completion:nil]; + ASSERT_TRUE(base::test::ios::WaitUntilConditionOrTimeout( + base::test::ios::kWaitForUIElementTimeout, ^bool { + return coordinator_.infobarBannerState == + InfobarBannerPresentationState::NotPresented; + })); + + EXPECT_TRUE(base::test::ios::WaitUntilConditionOrTimeout( + base::test::ios::kWaitForUIElementTimeout, ^bool { + return second_coordinator_.infobarBannerState == + InfobarBannerPresentationState::Presented; + })); + ASSERT_EQ(infobar_container_coordinator_.infobarBannerState, + InfobarBannerPresentationState::Presented); + + ASSERT_EQ(NSUInteger(2), + infobar_container_coordinator_.childCoordinators.count); }
diff --git a/ios/chrome/browser/ui/tab_grid/transitions/BUILD.gn b/ios/chrome/browser/ui/tab_grid/transitions/BUILD.gn index 3854b734..1349ffd 100644 --- a/ios/chrome/browser/ui/tab_grid/transitions/BUILD.gn +++ b/ios/chrome/browser/ui/tab_grid/transitions/BUILD.gn
@@ -24,7 +24,7 @@ deps = [ "//base", - "//ios/chrome/browser/ui/util", + "//ios/chrome/browser/crash_report", "//ios/chrome/browser/ui/util", ] }
diff --git a/ios/chrome/browser/ui/tab_grid/transitions/grid_to_visible_tab_animator.mm b/ios/chrome/browser/ui/tab_grid/transitions/grid_to_visible_tab_animator.mm index 76525adf..bab89d9 100644 --- a/ios/chrome/browser/ui/tab_grid/transitions/grid_to_visible_tab_animator.mm +++ b/ios/chrome/browser/ui/tab_grid/transitions/grid_to_visible_tab_animator.mm
@@ -4,6 +4,7 @@ #import "ios/chrome/browser/ui/tab_grid/transitions/grid_to_visible_tab_animator.h" +#include "ios/chrome/browser/crash_report/breakpad_helper.h" #import "ios/chrome/browser/ui/tab_grid/transitions/grid_transition_animation.h" #import "ios/chrome/browser/ui/tab_grid/transitions/grid_transition_layout.h" #import "ios/chrome/browser/ui/tab_grid/transitions/grid_transition_state_providing.h" @@ -142,8 +143,29 @@ presentedView.alpha = 1; [gridView removeFromSuperview]; } + + // TODO(crbug.com/959774): The logging below is to better understand a crash + // when |-completeTransition| is called. We expect the |toViewController| to + // be BVC. We are testing the assumption below that there should be no + // presentingViewController, presentedViewController, or parentViewController. + UIViewController* toViewController = [self.transitionContext + viewControllerForKey:UITransitionContextToViewControllerKey]; + NSString* toViewControllerName = NSStringFromClass([toViewController class]); + NSString* presentingViewControllerName = + NSStringFromClass([toViewController.presentingViewController class]); + NSString* presentedViewControllerName = + NSStringFromClass([toViewController.presentedViewController class]); + NSString* parentViewControllerName = + NSStringFromClass([toViewController.parentViewController class]); + breakpad_helper::SetGridToVisibleTabAnimation( + toViewControllerName, presentingViewControllerName, + presentedViewControllerName, parentViewControllerName); + // Mark the transition as completed. [self.transitionContext completeTransition:YES]; + + // Remove the crash log since the presentation completed without a crash. + breakpad_helper::RemoveGridToVisibleTabAnimation(); } @end
diff --git a/ipc/ipc_test_base.h b/ipc/ipc_test_base.h index 2555611..b8505be3 100644 --- a/ipc/ipc_test_base.h +++ b/ipc/ipc_test_base.h
@@ -9,9 +9,9 @@ #include <string> #include "base/macros.h" -#include "base/message_loop/message_loop.h" #include "base/process/process.h" #include "base/test/multiprocess_test.h" +#include "base/test/scoped_task_environment.h" #include "build/build_config.h" #include "ipc/ipc_channel.h" #include "ipc/ipc_channel_factory.h" @@ -75,7 +75,8 @@ IPC::Channel* channel() const { return channel_.get(); } private: - base::MessageLoopForIO main_message_loop_; + base::test::ScopedTaskEnvironment scoped_task_environment_{ + base::test::ScopedTaskEnvironment::MainThreadType::IO}; mojo::ScopedMessagePipeHandle handle_; std::unique_ptr<IPC::Channel> channel_; };
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java b/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java index 682b656..df8be32 100644 --- a/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java +++ b/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java
@@ -187,7 +187,11 @@ for (String supportedType : info.getSupportedTypes()) { if (supportedType.equalsIgnoreCase(mime)) { - return info.getCapabilitiesForType(supportedType).colorFormats; + try { + return info.getCapabilitiesForType(supportedType).colorFormats; + } catch (IllegalArgumentException e) { + // Type is not supported. + } } } } @@ -305,14 +309,19 @@ // support. In this case, estimate the level from MediaCodecInfo.VideoCapabilities // instead. Assume VP9 is not supported before L. For more information, consult // https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html - CodecCapabilities codecCapabilities = info.getCapabilitiesForType(mime); - if (mime.endsWith("vp9") && Build.VERSION_CODES.LOLLIPOP <= Build.VERSION.SDK_INT - && Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) { - addVp9CodecProfileLevels(profileLevels, codecCapabilities); - continue; - } - for (CodecProfileLevel profileLevel : codecCapabilities.profileLevels) { - profileLevels.addCodecProfileLevel(mime, profileLevel); + try { + CodecCapabilities codecCapabilities = info.getCapabilitiesForType(mime); + if (mime.endsWith("vp9") + && Build.VERSION_CODES.LOLLIPOP <= Build.VERSION.SDK_INT + && Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) { + addVp9CodecProfileLevels(profileLevels, codecCapabilities); + continue; + } + for (CodecProfileLevel profileLevel : codecCapabilities.profileLevels) { + profileLevels.addCodecProfileLevel(mime, profileLevel); + } + } catch (IllegalArgumentException e) { + // Type is not supported. } } }
diff --git a/mojo/public/cpp/platform/named_platform_channel.h b/mojo/public/cpp/platform/named_platform_channel.h index 177136e..e233341 100644 --- a/mojo/public/cpp/platform/named_platform_channel.h +++ b/mojo/public/cpp/platform/named_platform_channel.h
@@ -23,8 +23,9 @@ // NamedPlatformChannel encapsulates a Mojo invitation transport channel which // can listen for inbound connections established by clients connecting to -// a named system resource (i.e. a named pipe server on Windows, a named -// Unix domain socket on POSIX; other platforms not supported). +// a named system resource (i.e. a named pipe server on Windows, a named Unix +// domain socket on POSIX, a Mach bootstrap server on macOS, other platforms +// not supported). // // This can be especially useful when the local process has no way to transfer // handles to the remote process, e.g. it does not control process launch or
diff --git a/mojo/public/cpp/platform/platform_channel.h b/mojo/public/cpp/platform/platform_channel.h index 74a060d..01d3ae19 100644 --- a/mojo/public/cpp/platform/platform_channel.h +++ b/mojo/public/cpp/platform/platform_channel.h
@@ -15,11 +15,11 @@ namespace mojo { // PlatformChannel encapsulates construction and ownership of two entangled -// endpoints of a platform-specific communication primitive, e.g. a Windows pipe -// or a Unix domain socket. One endpoint is designated as the "local" endpoint -// and should be retained by the creating process; the other endpoint is -// designated as the "remote" endpoint and should be passed to an external -// process. +// endpoints of a platform-specific communication primitive, e.g. a Windows +// pipe, a Unix domain socket, or a macOS Mach port pair. One endpoint is +// designated as the "local" endpoint and should be retained by the creating +// process; the other endpoint is designated as the "remote" endpoint and +// should be passed to an external process. // // PlatformChannels can be used to bootstrap Mojo IPC between one process and // another. Typically the other process is a child of this process, and there
diff --git a/mojo/public/cpp/platform/platform_handle.h b/mojo/public/cpp/platform/platform_handle.h index 07a49f4a..ae3cefe 100644 --- a/mojo/public/cpp/platform/platform_handle.h +++ b/mojo/public/cpp/platform/platform_handle.h
@@ -26,9 +26,9 @@ namespace mojo { // A PlatformHandle is a generic wrapper around a platform-specific system -// handle type, e.g. a POSIX file descriptor or Windows HANDLE. This can wrap -// any of various such types depending on the host platform for which it's -// compiled. +// handle type, e.g. a POSIX file descriptor, Windows HANDLE, or macOS Mach +// port. This can wrap any of various such types depending on the host platform +// for which it's compiled. // // This is useful primarily for two reasons: //
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h index 3150f3e..0064c6c 100644 --- a/net/base/net_error_list.h +++ b/net/base/net_error_list.h
@@ -115,9 +115,7 @@ // checks and 'Cross-Origin-Resource-Policy', for instance). NET_ERROR(BLOCKED_BY_RESPONSE, -27) -// The request failed after the response was received, based on client-side -// heuristics that point to the possiblility of a cross-site scripting attack. -NET_ERROR(BLOCKED_BY_XSS_AUDITOR, -28) +// Error -28 was removed (BLOCKED_BY_XSS_AUDITOR). // The request was blocked by system policy disallowing some or all cleartext // requests. Used for NetworkSecurityPolicy on Android.
diff --git a/net/quic/quic_flags_list.h b/net/quic/quic_flags_list.h index 1c3b8b2..ed99c66c 100644 --- a/net/quic/quic_flags_list.h +++ b/net/quic/quic_flags_list.h
@@ -281,7 +281,7 @@ QUIC_FLAG( bool, FLAGS_quic_reloadable_flag_quic_change_default_lumpy_pacing_size_to_two, - false) + true) // If true, QuicSpdySession::GetSpdyDataStream() will close the connection // if the returned stream is static. @@ -382,3 +382,9 @@ QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_track_ack_height_in_bandwidth_sampler, false) + +// If true, QuicSession::ShouldKeepConnectionAlive() will not consider locally +// closed streams whose highest byte offset is not received yet. +QUIC_FLAG(bool, + FLAGS_quic_reloadable_flag_quic_aggressive_connection_aliveness, + false)
diff --git a/services/media_session/public/cpp/test/test_media_controller.cc b/services/media_session/public/cpp/test/test_media_controller.cc index 87e83644..747b410b 100644 --- a/services/media_session/public/cpp/test/test_media_controller.cc +++ b/services/media_session/public/cpp/test/test_media_controller.cc
@@ -261,6 +261,11 @@ } } +void TestMediaController::SeekTo(base::TimeDelta seek_time) { + seek_to_time_ = seek_time; + ++seek_to_count_; +} + void TestMediaController::SimulateMediaSessionInfoChanged( mojom::MediaSessionInfoPtr session_info) { for (auto& observer : observers_)
diff --git a/services/media_session/public/cpp/test/test_media_controller.h b/services/media_session/public/cpp/test/test_media_controller.h index 100f934..d61c5a2 100644 --- a/services/media_session/public/cpp/test/test_media_controller.h +++ b/services/media_session/public/cpp/test/test_media_controller.h
@@ -153,7 +153,7 @@ int desired_size_px, mojo::PendingRemote<mojom::MediaControllerImageObserver> observer) override {} - void SeekTo(base::TimeDelta seek_time) override {} + void SeekTo(base::TimeDelta seek_time) override; void ScrubTo(base::TimeDelta seek_time) override {} int toggle_suspend_resume_count() const { @@ -168,6 +168,9 @@ int next_track_count() const { return next_track_count_; } int seek_backward_count() const { return seek_backward_count_; } int seek_forward_count() const { return seek_forward_count_; } + int seek_to_count() const { return seek_to_count_; } + + base::Optional<base::TimeDelta> seek_to_time() { return seek_to_time_; } void SimulateMediaSessionInfoChanged(mojom::MediaSessionInfoPtr session_info); void SimulateMediaSessionActionsChanged( @@ -184,6 +187,9 @@ int next_track_count_ = 0; int seek_backward_count_ = 0; int seek_forward_count_ = 0; + int seek_to_count_ = 0; + + base::Optional<base::TimeDelta> seek_to_time_; mojo::RemoteSet<mojom::MediaControllerObserver> observers_;
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index bccedff..401cf53c 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -2476,6 +2476,24 @@ ] } ], + "GridLayoutForNtpShortcuts": [ + { + "platforms": [ + "chromeos", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "GridLayoutForNtpShortcuts" + ] + } + ] + } + ], "GwpAsanUnified": [ { "platforms": [
diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn index 17a0deff..0b0dccd 100644 --- a/third_party/android_deps/BUILD.gn +++ b/third_party/android_deps/BUILD.gn
@@ -413,8 +413,7 @@ ":google_play_services_cast_java", ] - # Removing all resources from cast framework as they are unused bloat. - strip_resources = true + # Cannot get rid of cast framework resources: crbug.com/985139. } # This is generated, do not edit. Update BuildConfigGenerator.groovy instead.
diff --git a/third_party/android_deps/additional_readme_paths.json b/third_party/android_deps/additional_readme_paths.json index 495db62..709b36c 100644 --- a/third_party/android_deps/additional_readme_paths.json +++ b/third_party/android_deps/additional_readme_paths.json
@@ -53,7 +53,6 @@ "libs/com_google_android_gms_play_services_tasks", "libs/com_google_android_gms_play_services_vision", "libs/com_google_android_gms_play_services_vision_common", - "libs/com_google_ar_core", "libs/com_google_code_findbugs_jsr305", "libs/com_google_dagger_dagger", "libs/com_google_dagger_dagger_compiler",
diff --git a/third_party/android_deps/libs/com_google_ar_core/LICENSE b/third_party/android_deps/libs/com_google_ar_core/LICENSE deleted file mode 100644 index 89d8dff8..0000000 --- a/third_party/android_deps/libs/com_google_ar_core/LICENSE +++ /dev/null
@@ -1,13096 +0,0 @@ -=============================================================================== -Section 1: ARCore SDK binary files - -The following files: -tools/arcoreimg/linux/arcoreimg -tools/arcoreimg/macos/arcoreimg -tools/arcoreimg/windows/arcoreimg.exe - -as well as the files ending in ".apk" attached to [GitHub -releases](https://github.com/google-ar/arcore-android-sdk/releases) - -are licensed as follows: - -Covered by the **Google APIs Terms of Service** at -[https://developers.google.com/terms/](https://developers.google.com/terms/) - -=============================================================================== -Section 2: ARCore SDK source files - -Except as indicated in sections 1 above and section 3 below, files in this SDK -are licensed as follows: - -Copyright (c) 2017, Google Inc. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -=============================================================================== -Section 3: ARCore SDK dependencies - -******************************************************************************* -Android Activity Support Library -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -Android Annotations Support Library -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -Android Architecture Components -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -Android Architecture Components Core Library -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -Android Architecture Components Lifecycle Library -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -Android Architecture Components Lifecycle Runtime Library -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -Android Compat Support Library -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -Android Compatibility Library v4 -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -Android Compatibility Library v7 -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -Android Core UI Support Library -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -Android Core Utils Support Library -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Android Design Support Library -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -Android Fragments Support Library -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -Android Graphics Support Library -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Android Media Compat Support Library -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Android Transition Support Library -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -AndroidX async layout inflater. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -AndroidX card view library. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -AndroidX document file library. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -AndroidX interpolator library. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -AndroidX legacy core UI libraries. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -AndroidX local broadcast manager library. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -AndroidX print library. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -AndroidX sliding pane layout library. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -AndroidX swipe refresh layout library. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -AndroidX transition library. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -AndroidX versioned parcelable library. -******************************************************************************* - - Copyright (c) 2005-2018, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -Animal Sniffer -******************************************************************************* -The MIT License - -Copyright (c) 2008 Kohsuke Kawaguchi and codehaus.org. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -******************************************************************************* -Checker Framework Annotations -******************************************************************************* -A few parts of the Checker Framework have more permissive licenses. - - * The annotations are licensed under the MIT License. (The text of this - license appears below.) More specifically, all the parts of the Checker - Framework that you might want to include with your own program use the - MIT License. This is the checker-qual.jar file and all the files that - appear in it: every file in a qual/ directory, plus NullnessUtils.java - and RegexUtil.java. In addition, the cleanroom implementations of - third-party annotations, which the Checker Framework recognizes as - aliases for its own annotations, are licensed under the MIT License. - -=========================================================================== - -MIT License: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -=========================================================================== - -******************************************************************************* -Compatibility Libraries for Android asynclayoutinflater. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Compatibility Libraries for Android collections. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Compatibility Libraries for Android coordinatorlayout. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Compatibility Libraries for Android cursoradapter. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Compatibility Libraries for Android customview. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Compatibility Libraries for Android drawerlayout. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Compatibility Libraries for Android interpolator. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Compatibility Libraries for Android loader. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Compatibility Libraries for Android localbroadcastmanager. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Compatibility Libraries for Android support-slices_core -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -Compatibility Libraries for Android viewpager. -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -******************************************************************************* -Error Prone -******************************************************************************* - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -Firebase Common -******************************************************************************* - - -ICU4C: - -COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) - -Copyright © 1991-2018 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. - ---------------------- - -Third-Party Software Licenses - -This section contains third-party software notices and/or additional -terms for licensed third-party software components included within ICU -libraries. - -1. ICU License - ICU 1.8.1 to ICU 57.1 - -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1995-2016 International Business Machines Corporation and others -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY -SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. - -All trademarks and registered trademarks mentioned herein are the -property of their respective owners. - -2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt) - - # The Google Chrome software developed by Google is licensed under - # the BSD license. Other software included in this distribution is - # provided under other licenses, as set forth below. - # - # The BSD License - # http://opensource.org/licenses/bsd-license.php - # Copyright (C) 2006-2008, Google Inc. - # - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are met: - # - # Redistributions of source code must retain the above copyright notice, - # this list of conditions and the following disclaimer. - # Redistributions in binary form must reproduce the above - # copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided with - # the distribution. - # Neither the name of Google Inc. nor the names of its - # contributors may be used to endorse or promote products derived from - # this software without specific prior written permission. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - # - # The word list in cjdict.txt are generated by combining three word lists - # listed below with further processing for compound word breaking. The - # frequency is generated with an iterative training against Google web - # corpora. - # - # * Libtabe (Chinese) - # - https://sourceforge.net/project/?group_id=1519 - # - Its license terms and conditions are shown below. - # - # * IPADIC (Japanese) - # - http://chasen.aist-nara.ac.jp/chasen/distribution.html - # - Its license terms and conditions are shown below. - # - # ---------COPYING.libtabe ---- BEGIN-------------------- - # - # /* - # * Copyright (c) 1999 TaBE Project. - # * Copyright (c) 1999 Pai-Hsiang Hsiao. - # * All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the TaBE Project nor the names of its - # * contributors may be used to endorse or promote products derived - # * from this software without specific prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # /* - # * Copyright (c) 1999 Computer Systems and Communication Lab, - # * Institute of Information Science, Academia - # * Sinica. All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the Computer Systems and Communication Lab - # * nor the names of its contributors may be used to endorse or - # * promote products derived from this software without specific - # * prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, - # University of Illinois - # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 - # - # ---------------COPYING.libtabe-----END-------------------------------- - # - # - # ---------------COPYING.ipadic-----BEGIN------------------------------- - # - # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science - # and Technology. All Rights Reserved. - # - # Use, reproduction, and distribution of this software is permitted. - # Any copy of this software, whether in its original form or modified, - # must include both the above copyright notice and the following - # paragraphs. - # - # Nara Institute of Science and Technology (NAIST), - # the copyright holders, disclaims all warranties with regard to this - # software, including all implied warranties of merchantability and - # fitness, in no event shall NAIST be liable for - # any special, indirect or consequential damages or any damages - # whatsoever resulting from loss of use, data or profits, whether in an - # action of contract, negligence or other tortuous action, arising out - # of or in connection with the use or performance of this software. - # - # A large portion of the dictionary entries - # originate from ICOT Free Software. The following conditions for ICOT - # Free Software applies to the current dictionary as well. - # - # Each User may also freely distribute the Program, whether in its - # original form or modified, to any third party or parties, PROVIDED - # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear - # on, or be attached to, the Program, which is distributed substantially - # in the same form as set out herein and that such intended - # distribution, if actually made, will neither violate or otherwise - # contravene any of the laws and regulations of the countries having - # jurisdiction over the User or the intended distribution itself. - # - # NO WARRANTY - # - # The program was produced on an experimental basis in the course of the - # research and development conducted during the project and is provided - # to users as so produced on an experimental basis. Accordingly, the - # program is provided without any warranty whatsoever, whether express, - # implied, statutory or otherwise. The term "warranty" used herein - # includes, but is not limited to, any warranty of the quality, - # performance, merchantability and fitness for a particular purpose of - # the program and the nonexistence of any infringement or violation of - # any right of any third party. - # - # Each user of the program will agree and understand, and be deemed to - # have agreed and understood, that there is no warranty whatsoever for - # the program and, accordingly, the entire risk arising from or - # otherwise connected with the program is assumed by the user. - # - # Therefore, neither ICOT, the copyright holder, or any other - # organization that participated in or was otherwise related to the - # development of the program and their respective officials, directors, - # officers and other employees shall be held liable for any and all - # damages, including, without limitation, general, special, incidental - # and consequential damages, arising out of or otherwise in connection - # with the use or inability to use the program or any product, material - # or result produced or otherwise obtained by using the program, - # regardless of whether they have been advised of, or otherwise had - # knowledge of, the possibility of such damages at any time during the - # project or thereafter. Each user will be deemed to have agreed to the - # foregoing by his or her commencement of use of the program. The term - # "use" as used herein includes, but is not limited to, the use, - # modification, copying and distribution of the program and the - # production of secondary products from the program. - # - # In the case where the program, whether in its original form or - # modified, was distributed or delivered to or received by a user from - # any person, organization or entity other than ICOT, unless it makes or - # grants independently of ICOT any specific warranty to the user in - # writing, such person, organization or entity, will also be exempted - # from and not be held liable to the user for any such damages as noted - # above as far as the program is concerned. - # - # ---------------COPYING.ipadic-----END---------------------------------- - -3. Lao Word Break Dictionary Data (laodict.txt) - - # Copyright (c) 2013 International Business Machines Corporation - # and others. All Rights Reserved. - # - # Project: http://code.google.com/p/lao-dictionary/ - # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt - # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt - # (copied below) - # - # This file is derived from the above dictionary, with slight - # modifications. - # ---------------------------------------------------------------------- - # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, - # are permitted provided that the following conditions are met: - # - # - # Redistributions of source code must retain the above copyright notice, this - # list of conditions and the following disclaimer. Redistributions in - # binary form must reproduce the above copyright notice, this list of - # conditions and the following disclaimer in the documentation and/or - # other materials provided with the distribution. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # OF THE POSSIBILITY OF SUCH DAMAGE. - # -------------------------------------------------------------------------- - -4. Burmese Word Break Dictionary Data (burmesedict.txt) - - # Copyright (c) 2014 International Business Machines Corporation - # and others. All Rights Reserved. - # - # This list is part of a project hosted at: - # github.com/kanyawtech/myanmar-karen-word-lists - # - # -------------------------------------------------------------------------- - # Copyright (c) 2013, LeRoy Benjamin Sharon - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: Redistributions of source code must retain the above - # copyright notice, this list of conditions and the following - # disclaimer. Redistributions in binary form must reproduce the - # above copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided - # with the distribution. - # - # Neither the name Myanmar Karen Word Lists, nor the names of its - # contributors may be used to endorse or promote products derived - # from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS - # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - # SUCH DAMAGE. - # -------------------------------------------------------------------------- - -5. Time Zone Database - - ICU uses the public domain data and code derived from Time Zone -Database for its time zone support. The ownership of the TZ database -is explained in BCP 175: Procedure for Maintaining the Time Zone -Database section 7. - - # 7. Database Ownership - # - # The TZ database itself is not an IETF Contribution or an IETF - # document. Rather it is a pre-existing and regularly updated work - # that is in the public domain, and is intended to remain in the - # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do - # not apply to the TZ Database or contributions that individuals make - # to it. Should any claims be made and substantiated against the TZ - # Database, the organization that is providing the IANA - # Considerations defined in this RFC, under the memorandum of - # understanding with the IETF, currently ICANN, may act in accordance - # with all competent court orders. No ownership claims will be made - # by ICANN or the IETF Trust on the database or the code. Any person - # making a contribution to the database or code waives all rights to - # future claims in that contribution or in the TZ Database. - -6. Google double-conversion - -Copyright 2006-2011, the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -JSR 305: - -Copyright (c) 2007-2009, JSR305 expert group -All rights reserved. - -http://www.opensource.org/licenses/bsd-license.php - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the JSR305 expert group nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - -PCRE: - -PCRE LICENCE ------------- - -PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - -Release 8 of PCRE is distributed under the terms of the "BSD" licence, as -specified below. The documentation for PCRE, supplied in the "doc" -directory, is distributed under the same terms as the software itself. The data -in the testdata directory is not copyrighted and is in the public domain. - -The basic library functions are written in C and are freestanding. Also -included in the distribution is a set of C++ wrapper functions, and a -just-in-time compiler that can be used to optimize pattern matching. These -are both optional features that can be omitted when the library is built. - - -THE BASIC LIBRARY FUNCTIONS ---------------------------- - -Written by: Philip Hazel -Email local part: ph10 -Email domain: cam.ac.uk - -University of Cambridge Computing Service, -Cambridge, England. - -Copyright (c) 1997-2017 University of Cambridge -All rights reserved. - - -PCRE JUST-IN-TIME COMPILATION SUPPORT -------------------------------------- - -Written by: Zoltan Herczeg -Email local part: hzmester -Emain domain: freemail.hu - -Copyright(c) 2010-2017 Zoltan Herczeg -All rights reserved. - - -STACK-LESS JUST-IN-TIME COMPILER --------------------------------- - -Written by: Zoltan Herczeg -Email local part: hzmester -Emain domain: freemail.hu - -Copyright(c) 2009-2017 Zoltan Herczeg -All rights reserved. - - -THE C++ WRAPPER FUNCTIONS -------------------------- - -Contributed by: Google Inc. - -Copyright (c) 2007-2012, Google Inc. -All rights reserved. - - -THE "BSD" LICENCE ------------------ - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the University of Cambridge nor the name of Google - Inc. nor the names of their contributors may be used to endorse or - promote products derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -End - - -Protobuf Nano: - -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Code generated by the Protocol Buffer compiler is owned by the owner -of the input file used when generating it. This code is not -standalone and requires a support library to be linked with it. This -support library is itself covered by the above license. - - -RE2: - -// Copyright (c) 2009 The RE2 Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -darts_clone: - -Copyright (c) 2008-2011, Susumu Yata -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -- Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -STL: - -SGI STL - -The STL portion of GNU libstdc++ that is used with gcc3 and gcc4 is licensed -under the GPL, with the following exception: - -# As a special exception, you may use this file as part of a free software -# library without restriction. Specifically, if other files instantiate -# templates or use macros or inline functions from this file, or you compile -# this file and link it with other files to produce an executable, this -# file does not by itself cause the resulting executable to be covered by -# the GNU General Public License. This exception does not however -# invalidate any other reasons why the executable file might be covered by -# the GNU General Public License. - - - -UTF: - -UTF-8 Library - -The authors of this software are Rob Pike and Ken Thompson. - Copyright (c) 1998-2002 by Lucent Technologies. -Permission to use, copy, modify, and distribute this software for any -purpose without fee is hereby granted, provided that this entire notice -is included in all copies of any software which is or includes a copy -or modification of this software and in all copies of the supporting -documentation for such software. -THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED -WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY -REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY -OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - - -flatbuffers: - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2014 Google Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -safeparcel: - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -zlib: - -(extracted from README, except for match.S) - -Copyright notice: - - (C) 1995-2013 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - -If you use the zlib library in a product, we would appreciate *not* receiving -lengthy legal documents to sign. The sources are provided for free but without -warranty of any kind. The library has been entirely written by Jean-loup -Gailly and Mark Adler; it does not include third-party code. - -If you redistribute modified sources, we would appreciate that you include in -the file ChangeLog history information documenting your changes. Please read -the FAQ for more information on the distribution of modified source versions. - -(extracted from match.S, for match.S only) - -Copyright (C) 1998, 2007 Brian Raiter <breadbox@muppetlabs.com> - -This software is provided 'as-is', without any express or implied -warranty. In no event will the author be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. - -******************************************************************************* -Glide -******************************************************************************* -Covers library/ - -Copyright 2014 Google, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are -permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of - conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list - of conditions and the following disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY GOOGLE, INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those of the -authors and should not be interpreted as representing official policies, either expressed -or implied, of Google, Inc. - --------------------------------------------------------------------------- -Covers third_party/gif_decoder - -Copyright (c) 2013 Xcellent Creations, Inc. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------- -Covers third_party/disklrucache - -Copyright 2012 Jake Wharton -Copyright 2011 The Android Open Source Project - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. --------------------------------------------------------------------------- -Covers third_party/gif_encoder/AnimatedGifEncoder.java and -third_party/gif_encoder/LZWEncoder.java: - -No copyright asserted on the source code of this class. May be used for any -purpose, however, refer to the Unisys LZW patent for restrictions on use of -the associated LZWEncoder class. Please forward any corrections to -kweiner@fmsware.com. - ------------------------------------------------------------------------------ -Covers third_party/gif_encoder/NeuQuant.java - -Copyright (c) 1994 Anthony Dekker - -NEUQUANT Neural-Net quantization algorithm by Anthony Dekker, 1994. See -"Kohonen neural networks for optimal colour quantization" in "Network: -Computation in Neural Systems" Vol. 5 (1994) pp 351-367. for a discussion of -the algorithm. - -Any party obtaining a copy of these files from the author, directly or -indirectly, is granted, free of charge, a full and unrestricted irrevocable, -world-wide, paid up, royalty-free, nonexclusive right and license to deal in -this software and documentation files (the "Software"), including without -limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons who -receive copies from any such party to do so, with the only requirement being -that this copyright notice remain intact. - -******************************************************************************* -Google Auto -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -Guava JDK5 -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -Guava JDK7 -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -******************************************************************************* -J2ObjC -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -JSR 250 -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -JSR 305 -******************************************************************************* -Copyright (c) 2007-2009, JSR305 expert group -All rights reserved. - -http://www.opensource.org/licenses/bsd-license.php - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the JSR305 expert group nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -******************************************************************************* -Material Components for Android -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -concurrent_futures -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -******************************************************************************* -firebase_database -******************************************************************************* - - -ICU4C: - -COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) - -Copyright © 1991-2018 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. - ---------------------- - -Third-Party Software Licenses - -This section contains third-party software notices and/or additional -terms for licensed third-party software components included within ICU -libraries. - -1. ICU License - ICU 1.8.1 to ICU 57.1 - -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1995-2016 International Business Machines Corporation and others -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY -SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. - -All trademarks and registered trademarks mentioned herein are the -property of their respective owners. - -2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt) - - # The Google Chrome software developed by Google is licensed under - # the BSD license. Other software included in this distribution is - # provided under other licenses, as set forth below. - # - # The BSD License - # http://opensource.org/licenses/bsd-license.php - # Copyright (C) 2006-2008, Google Inc. - # - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are met: - # - # Redistributions of source code must retain the above copyright notice, - # this list of conditions and the following disclaimer. - # Redistributions in binary form must reproduce the above - # copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided with - # the distribution. - # Neither the name of Google Inc. nor the names of its - # contributors may be used to endorse or promote products derived from - # this software without specific prior written permission. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - # - # The word list in cjdict.txt are generated by combining three word lists - # listed below with further processing for compound word breaking. The - # frequency is generated with an iterative training against Google web - # corpora. - # - # * Libtabe (Chinese) - # - https://sourceforge.net/project/?group_id=1519 - # - Its license terms and conditions are shown below. - # - # * IPADIC (Japanese) - # - http://chasen.aist-nara.ac.jp/chasen/distribution.html - # - Its license terms and conditions are shown below. - # - # ---------COPYING.libtabe ---- BEGIN-------------------- - # - # /* - # * Copyright (c) 1999 TaBE Project. - # * Copyright (c) 1999 Pai-Hsiang Hsiao. - # * All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the TaBE Project nor the names of its - # * contributors may be used to endorse or promote products derived - # * from this software without specific prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # /* - # * Copyright (c) 1999 Computer Systems and Communication Lab, - # * Institute of Information Science, Academia - # * Sinica. All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the Computer Systems and Communication Lab - # * nor the names of its contributors may be used to endorse or - # * promote products derived from this software without specific - # * prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, - # University of Illinois - # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 - # - # ---------------COPYING.libtabe-----END-------------------------------- - # - # - # ---------------COPYING.ipadic-----BEGIN------------------------------- - # - # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science - # and Technology. All Rights Reserved. - # - # Use, reproduction, and distribution of this software is permitted. - # Any copy of this software, whether in its original form or modified, - # must include both the above copyright notice and the following - # paragraphs. - # - # Nara Institute of Science and Technology (NAIST), - # the copyright holders, disclaims all warranties with regard to this - # software, including all implied warranties of merchantability and - # fitness, in no event shall NAIST be liable for - # any special, indirect or consequential damages or any damages - # whatsoever resulting from loss of use, data or profits, whether in an - # action of contract, negligence or other tortuous action, arising out - # of or in connection with the use or performance of this software. - # - # A large portion of the dictionary entries - # originate from ICOT Free Software. The following conditions for ICOT - # Free Software applies to the current dictionary as well. - # - # Each User may also freely distribute the Program, whether in its - # original form or modified, to any third party or parties, PROVIDED - # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear - # on, or be attached to, the Program, which is distributed substantially - # in the same form as set out herein and that such intended - # distribution, if actually made, will neither violate or otherwise - # contravene any of the laws and regulations of the countries having - # jurisdiction over the User or the intended distribution itself. - # - # NO WARRANTY - # - # The program was produced on an experimental basis in the course of the - # research and development conducted during the project and is provided - # to users as so produced on an experimental basis. Accordingly, the - # program is provided without any warranty whatsoever, whether express, - # implied, statutory or otherwise. The term "warranty" used herein - # includes, but is not limited to, any warranty of the quality, - # performance, merchantability and fitness for a particular purpose of - # the program and the nonexistence of any infringement or violation of - # any right of any third party. - # - # Each user of the program will agree and understand, and be deemed to - # have agreed and understood, that there is no warranty whatsoever for - # the program and, accordingly, the entire risk arising from or - # otherwise connected with the program is assumed by the user. - # - # Therefore, neither ICOT, the copyright holder, or any other - # organization that participated in or was otherwise related to the - # development of the program and their respective officials, directors, - # officers and other employees shall be held liable for any and all - # damages, including, without limitation, general, special, incidental - # and consequential damages, arising out of or otherwise in connection - # with the use or inability to use the program or any product, material - # or result produced or otherwise obtained by using the program, - # regardless of whether they have been advised of, or otherwise had - # knowledge of, the possibility of such damages at any time during the - # project or thereafter. Each user will be deemed to have agreed to the - # foregoing by his or her commencement of use of the program. The term - # "use" as used herein includes, but is not limited to, the use, - # modification, copying and distribution of the program and the - # production of secondary products from the program. - # - # In the case where the program, whether in its original form or - # modified, was distributed or delivered to or received by a user from - # any person, organization or entity other than ICOT, unless it makes or - # grants independently of ICOT any specific warranty to the user in - # writing, such person, organization or entity, will also be exempted - # from and not be held liable to the user for any such damages as noted - # above as far as the program is concerned. - # - # ---------------COPYING.ipadic-----END---------------------------------- - -3. Lao Word Break Dictionary Data (laodict.txt) - - # Copyright (c) 2013 International Business Machines Corporation - # and others. All Rights Reserved. - # - # Project: http://code.google.com/p/lao-dictionary/ - # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt - # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt - # (copied below) - # - # This file is derived from the above dictionary, with slight - # modifications. - # ---------------------------------------------------------------------- - # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, - # are permitted provided that the following conditions are met: - # - # - # Redistributions of source code must retain the above copyright notice, this - # list of conditions and the following disclaimer. Redistributions in - # binary form must reproduce the above copyright notice, this list of - # conditions and the following disclaimer in the documentation and/or - # other materials provided with the distribution. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # OF THE POSSIBILITY OF SUCH DAMAGE. - # -------------------------------------------------------------------------- - -4. Burmese Word Break Dictionary Data (burmesedict.txt) - - # Copyright (c) 2014 International Business Machines Corporation - # and others. All Rights Reserved. - # - # This list is part of a project hosted at: - # github.com/kanyawtech/myanmar-karen-word-lists - # - # -------------------------------------------------------------------------- - # Copyright (c) 2013, LeRoy Benjamin Sharon - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions - # are met: Redistributions of source code must retain the above - # copyright notice, this list of conditions and the following - # disclaimer. Redistributions in binary form must reproduce the - # above copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided - # with the distribution. - # - # Neither the name Myanmar Karen Word Lists, nor the names of its - # contributors may be used to endorse or promote products derived - # from this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS - # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - # SUCH DAMAGE. - # -------------------------------------------------------------------------- - -5. Time Zone Database - - ICU uses the public domain data and code derived from Time Zone -Database for its time zone support. The ownership of the TZ database -is explained in BCP 175: Procedure for Maintaining the Time Zone -Database section 7. - - # 7. Database Ownership - # - # The TZ database itself is not an IETF Contribution or an IETF - # document. Rather it is a pre-existing and regularly updated work - # that is in the public domain, and is intended to remain in the - # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do - # not apply to the TZ Database or contributions that individuals make - # to it. Should any claims be made and substantiated against the TZ - # Database, the organization that is providing the IANA - # Considerations defined in this RFC, under the memorandum of - # understanding with the IETF, currently ICANN, may act in accordance - # with all competent court orders. No ownership claims will be made - # by ICANN or the IETF Trust on the database or the code. Any person - # making a contribution to the database or code waives all rights to - # future claims in that contribution or in the TZ Database. - -6. Google double-conversion - -Copyright 2006-2011, the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -JSR 305: - -Copyright (c) 2007-2009, JSR305 expert group -All rights reserved. - -http://www.opensource.org/licenses/bsd-license.php - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the JSR305 expert group nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - -PCRE: - -PCRE LICENCE ------------- - -PCRE is a library of functions to support regular expressions whose syntax -and semantics are as close as possible to those of the Perl 5 language. - -Release 8 of PCRE is distributed under the terms of the "BSD" licence, as -specified below. The documentation for PCRE, supplied in the "doc" -directory, is distributed under the same terms as the software itself. The data -in the testdata directory is not copyrighted and is in the public domain. - -The basic library functions are written in C and are freestanding. Also -included in the distribution is a set of C++ wrapper functions, and a -just-in-time compiler that can be used to optimize pattern matching. These -are both optional features that can be omitted when the library is built. - - -THE BASIC LIBRARY FUNCTIONS ---------------------------- - -Written by: Philip Hazel -Email local part: ph10 -Email domain: cam.ac.uk - -University of Cambridge Computing Service, -Cambridge, England. - -Copyright (c) 1997-2017 University of Cambridge -All rights reserved. - - -PCRE JUST-IN-TIME COMPILATION SUPPORT -------------------------------------- - -Written by: Zoltan Herczeg -Email local part: hzmester -Emain domain: freemail.hu - -Copyright(c) 2010-2017 Zoltan Herczeg -All rights reserved. - - -STACK-LESS JUST-IN-TIME COMPILER --------------------------------- - -Written by: Zoltan Herczeg -Email local part: hzmester -Emain domain: freemail.hu - -Copyright(c) 2009-2017 Zoltan Herczeg -All rights reserved. - - -THE C++ WRAPPER FUNCTIONS -------------------------- - -Contributed by: Google Inc. - -Copyright (c) 2007-2012, Google Inc. -All rights reserved. - - -THE "BSD" LICENCE ------------------ - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the University of Cambridge nor the name of Google - Inc. nor the names of their contributors may be used to endorse or - promote products derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -End - - -Protobuf Nano: - -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Code generated by the Protocol Buffer compiler is owned by the owner -of the input file used when generating it. This code is not -standalone and requires a support library to be linked with it. This -support library is itself covered by the above license. - - -RE2: - -// Copyright (c) 2009 The RE2 Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -darts_clone: - -Copyright (c) 2008-2011, Susumu Yata -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -- Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -STL: - -SGI STL - -The STL portion of GNU libstdc++ that is used with gcc3 and gcc4 is licensed -under the GPL, with the following exception: - -# As a special exception, you may use this file as part of a free software -# library without restriction. Specifically, if other files instantiate -# templates or use macros or inline functions from this file, or you compile -# this file and link it with other files to produce an executable, this -# file does not by itself cause the resulting executable to be covered by -# the GNU General Public License. This exception does not however -# invalidate any other reasons why the executable file might be covered by -# the GNU General Public License. - - - -UTF: - -UTF-8 Library - -The authors of this software are Rob Pike and Ken Thompson. - Copyright (c) 1998-2002 by Lucent Technologies. -Permission to use, copy, modify, and distribute this software for any -purpose without fee is hereby granted, provided that this entire notice -is included in all copies of any software which is or includes a copy -or modification of this software and in all copies of the supporting -documentation for such software. -THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED -WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY -REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY -OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - - -flatbuffers: - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2014 Google Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -safeparcel: - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -zlib: - -(extracted from README, except for match.S) - -Copyright notice: - - (C) 1995-2013 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - -If you use the zlib library in a product, we would appreciate *not* receiving -lengthy legal documents to sign. The sources are provided for free but without -warranty of any kind. The library has been entirely written by Jean-loup -Gailly and Mark Adler; it does not include third-party code. - -If you redistribute modified sources, we would appreciate that you include in -the file ChangeLog history information documenting your changes. Please read -the FAQ for more information on the distribution of modified source versions. - -(extracted from match.S, for match.S only) - -Copyright (C) 1998, 2007 Brian Raiter <breadbox@muppetlabs.com> - -This software is provided 'as-is', without any express or implied -warranty. In no event will the author be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. - -******************************************************************************* -firebase_database_collection -******************************************************************************* - - -JSR 250: - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -absl: - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - -safeparcel: - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -JSR 305: - -Copyright (c) 2007-2009, JSR305 expert group -All rights reserved. - -http://www.opensource.org/licenses/bsd-license.php - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the JSR305 expert group nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - -Protobuf Nano: - -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Code generated by the Protocol Buffer compiler is owned by the owner -of the input file used when generating it. This code is not -standalone and requires a support library to be linked with it. This -support library is itself covered by the above license. - - -STL: - -SGI STL - -The STL portion of GNU libstdc++ that is used with gcc3 and gcc4 is licensed -under the GPL, with the following exception: - -# As a special exception, you may use this file as part of a free software -# library without restriction. Specifically, if other files instantiate -# templates or use macros or inline functions from this file, or you compile -# this file and link it with other files to produce an executable, this -# file does not by itself cause the resulting executable to be covered by -# the GNU General Public License. This exception does not however -# invalidate any other reasons why the executable file might be covered by -# the GNU General Public License. - - - -flatbuffers: - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2014 Google Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -glm -******************************************************************************* -The MIT License - -Copyright (c) 2005 - 2013 G-Truc Creation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -******************************************************************************* -javagl_obj -******************************************************************************* - -www.javagl.de - Obj - -Copyright (c) 2008-2015 Marco Hutter - http://www.javagl.de - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************* -safeparcel -******************************************************************************* - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -******************************************************************************* -savedstate -******************************************************************************* - - Copyright (c) 2005-2011, The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - -
diff --git a/third_party/android_deps/libs/com_google_ar_core/OWNERS b/third_party/android_deps/libs/com_google_ar_core/OWNERS deleted file mode 100644 index 7b571d97..0000000 --- a/third_party/android_deps/libs/com_google_ar_core/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -file://third_party/android_deps/OWNERS \ No newline at end of file
diff --git a/third_party/android_deps/libs/com_google_ar_core/README.chromium b/third_party/android_deps/libs/com_google_ar_core/README.chromium deleted file mode 100644 index 067103d..0000000 --- a/third_party/android_deps/libs/com_google_ar_core/README.chromium +++ /dev/null
@@ -1,13 +0,0 @@ -Name: -Short Name: core -URL: https://github.com/google-ar/arcore-android-sdk -Version: 1.8.0 -License: Apache 2.0 -License File: LICENSE -Security Critical: yes - -Description: - - -Local Modifications: -Updated some proguard flags. The same proguard flag changes have been submitted to AR core directly and should be in any version >=1.11.
diff --git a/third_party/android_deps/libs/com_google_ar_core/cipd.yaml b/third_party/android_deps/libs/com_google_ar_core/cipd.yaml deleted file mode 100644 index f7f0f446..0000000 --- a/third_party/android_deps/libs/com_google_ar_core/cipd.yaml +++ /dev/null
@@ -1,10 +0,0 @@ -# Copyright 2018 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# To create CIPD package run the following command. -# cipd create --pkg-def cipd.yaml -tag version:1.8.0-cr0 -package: chromium/third_party/android_deps/libs/com_google_ar_core -description: "" -data: -- file: core-1.8.0.aar
diff --git a/third_party/android_deps/libs/com_google_ar_core/com_google_ar_core.info b/third_party/android_deps/libs/com_google_ar_core/com_google_ar_core.info deleted file mode 100644 index b28fe54..0000000 --- a/third_party/android_deps/libs/com_google_ar_core/com_google_ar_core.info +++ /dev/null
@@ -1,14 +0,0 @@ -# Generated by //build/android/gyp/aar.py -# To regenerate, use "update_android_aar_prebuilts = true" and run "gn gen". - -aidl = [ ] -assets = [ ] -has_classes_jar = true -has_native_libraries = true -has_proguard_flags = true -has_r_text_file = true -is_manifest_empty = false -native_libraries = [ "jni/x86_64/libarcore_sdk_jni.so", "jni/x86_64/libarcore_sdk_c.so", "jni/armeabi-v7a/libarcore_sdk_jni.so", "jni/armeabi-v7a/libarcore_sdk_c.so", "jni/arm64-v8a/libarcore_sdk_jni.so", "jni/arm64-v8a/libarcore_sdk_c.so", "jni/x86/libarcore_sdk_jni.so", "jni/x86/libarcore_sdk_c.so" ] -resources = [ "res/values-zu/values.xml", "res/values-fi/values.xml", "res/values-b+sr+Latn/values.xml", "res/values-it/values.xml", "res/values-ml/values.xml", "res/values-is/values.xml", "res/values-my/values.xml", "res/values-az/values.xml", "res/values-zh-rTW/values.xml", "res/values-mn/values.xml", "res/values-es-rPR/values.xml", "res/values-gl/values.xml", "res/values-iw/values.xml", "res/values-ca/values.xml", "res/values-be/values.xml", "res/values-fr-rCA/values.xml", "res/values-tl/values.xml", "res/values-lt/values.xml", "res/values-es-rNI/values.xml", "res/values-fil/values.xml", "res/values-el/values.xml", "res/values-bs/values.xml", "res/values-gu/values.xml", "res/values-hr/values.xml", "res/values-pt-rBR/values.xml", "res/values-id/values.xml", "res/values-en-rIE/values.xml", "res/values-sk/values.xml", "res/values-pa/values.xml", "res/values-bn/values.xml", "res/values-tr/values.xml", "res/layout/__arcore_education.xml", "res/values-ja/values.xml", "res/values-es-rUY/values.xml", "res/values-fr-rCH/values.xml", "res/values-sw/values.xml", "res/values-vi/values.xml", "res/values-kk/values.xml", "res/values-he/values.xml", "res/values-ur/values.xml", "res/values-no/values.xml", "res/values-es-rSV/values.xml", "res/values-ko/values.xml", "res/values-de/values.xml", "res/values-zh-rHK/values.xml", "res/values-uk/values.xml", "res/values-es/values.xml", "res/values-ar-rSA/values.xml", "res/values-sq/values.xml", "res/values-es-rVE/values.xml", "res/values-kn/values.xml", "res/values-mk/values.xml", "res/values-en-rAU/values.xml", "res/values-ka/values.xml", "res/values-en-rXA/values.xml", "res/values-ro/values.xml", "res/values-in/values.xml", "res/values-ky/values.xml", "res/values-da/values.xml", "res/values-es-rBO/values.xml", "res/values-zh-rCN/values.xml", "res/values-th/values.xml", "res/values/values.xml", "res/values-fa/values.xml", "res/values-hy/values.xml", "res/values-es-rPY/values.xml", "res/values-es-rHN/values.xml", "res/values-b+es+419/values.xml", "res/values-zh/values.xml", "res/values-eu/values.xml", "res/values-af/values.xml", "res/values-es-rMX/values.xml", "res/values-hi/values.xml", "res/values-hu/values.xml", "res/values-es-rDO/values.xml", "res/values-ms/values.xml", "res/values-si/values.xml", "res/values-lo/values.xml", "res/values-km/values.xml", "res/values-en-rXC/values.xml", "res/values-es-rGT/values.xml", "res/values-en-rZA/values.xml", "res/values-mo/values.xml", "res/values-lv/values.xml", "res/values-sv/values.xml", "res/values-pl/values.xml", "res/values-gsw/values.xml", "res/values-es-rEC/values.xml", "res/values-es-rPE/values.xml", "res/values-uz/values.xml", "res/values-te/values.xml", "res/values-sr/values.xml", "res/values-ne/values.xml", "res/values-ar-rXB/values.xml", "res/values-ru/values.xml", "res/values-de-rAT/values.xml", "res/values-bg/values.xml", "res/values-sl/values.xml", "res/values-cs/values.xml", "res/values-nb/values.xml", "res/values-en-rSG/values.xml", "res/values-am/values.xml", "res/values-en-rCA/values.xml", "res/values-ta/values.xml", "res/values-nl/values.xml", "res/values-pt-rPT/values.xml", "res/raw/keep.xml", "res/values-es-rUS/values.xml", "res/values-es-rAR/values.xml", "res/values-fr/values.xml", "res/values-es-rCL/values.xml", "res/values-ar-rEG/values.xml", "res/values-pt/values.xml", "res/values-en-rGB/values.xml", "res/values-de-rCH/values.xml", "res/values-es-rCR/values.xml", "res/values-es-rCO/values.xml", "res/values-et/values.xml", "res/values-es-rPA/values.xml" ] -subjar_tuples = [ ] -subjars = [ ]
diff --git a/third_party/blink/public/common/frame/user_activation_update_type.h b/third_party/blink/public/common/frame/user_activation_update_type.h index d252380..127f0db 100644 --- a/third_party/blink/public/common/frame/user_activation_update_type.h +++ b/third_party/blink/public/common/frame/user_activation_update_type.h
@@ -11,6 +11,7 @@ // renderer processes. enum class UserActivationUpdateType { kNotifyActivation, + kNotifyActivationPendingBrowserVerification, kConsumeTransientActivation, kClearActivation, kMaxValue = kClearActivation
diff --git a/third_party/blink/public/mojom/web_feature/web_feature.mojom b/third_party/blink/public/mojom/web_feature/web_feature.mojom index 2a0e50a..4a9a8da 100644 --- a/third_party/blink/public/mojom/web_feature/web_feature.mojom +++ b/third_party/blink/public/mojom/web_feature/web_feature.mojom
@@ -2360,8 +2360,8 @@ kToggleEventHandlerDuringParsing = 2978, kFragmentDoubleHash = 2979, kV8RegExpMatchAllWithNonGlobalRegExp = 2980, - kCSSValueOverflowXOverlay = 2981, - kCSSValueOverflowYOverlay = 2982, + kOBSOLETE_CSSValueOverflowXOverlay = 2981, + kOBSOLETE_CSSValueOverflowYOverlay = 2982, kContentIndexAdd = 2983, kContentIndexDelete = 2984, kContentIndexGet = 2985, @@ -2374,6 +2374,7 @@ kV8SpeechRecognition_Grammars_AttributeSetter = 2992, kContactsManagerSelect = 2993, kV8MediaSession_SetPositionState_Method = 2994, + kCSSValueOverflowOverlay = 2995, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h index 61c01cb..5cfc6eb 100644 --- a/third_party/blink/public/platform/web_runtime_features.h +++ b/third_party/blink/public/platform/web_runtime_features.h
@@ -191,6 +191,7 @@ BLINK_PLATFORM_EXPORT static void EnableWebUsb(bool); BLINK_PLATFORM_EXPORT static void EnableWebVR(bool); BLINK_PLATFORM_EXPORT static void EnableWebXR(bool); + BLINK_PLATFORM_EXPORT static void EnableWebXRAnchors(bool); BLINK_PLATFORM_EXPORT static void EnableWebXRHitTest(bool); BLINK_PLATFORM_EXPORT static void EnableWebXRPlaneDetection(bool); BLINK_PLATFORM_EXPORT static void EnableXSLT(bool);
diff --git a/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.cc b/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.cc index 99b710d..38a03dd 100644 --- a/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.cc +++ b/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.cc
@@ -1916,12 +1916,9 @@ context.Count(WebFeature::kCSSValueDisplayContents); break; case CSSPropertyID::kOverflowX: - if (value_id == CSSValueID::kOverlay) - context.Count(WebFeature::kCSSValueOverflowXOverlay); - break; case CSSPropertyID::kOverflowY: if (value_id == CSSValueID::kOverlay) - context.Count(WebFeature::kCSSValueOverflowYOverlay); + context.Count(WebFeature::kCSSValueOverflowOverlay); break; default: break;
diff --git a/third_party/blink/renderer/core/css/parser/css_property_parser_test.cc b/third_party/blink/renderer/core/css/parser/css_property_parser_test.cc index 75911c2..f14ae59 100644 --- a/third_party/blink/renderer/core/css/parser/css_property_parser_test.cc +++ b/third_party/blink/renderer/core/css/parser/css_property_parser_test.cc
@@ -407,6 +407,96 @@ EXPECT_TRUE(document.IsUseCounted(feature)); } +TEST(CSSPropertyParserTest, TwoValueOverflowOverlayCount) { + auto dummy_page_holder = std::make_unique<DummyPageHolder>(IntSize(800, 600)); + Document& document = dummy_page_holder->GetDocument(); + Page::InsertOrdinaryPageForTesting(&dummy_page_holder->GetPage()); + WebFeature feature = WebFeature::kCSSValueOverflowOverlay; + WebFeature feature2 = WebFeature::kTwoValuedOverflow; + EXPECT_FALSE(document.IsUseCounted(feature)); + EXPECT_FALSE(document.IsUseCounted(feature2)); + document.documentElement()->SetInnerHTMLFromString( + "<div style=\"height: 10px; width: 10px; overflow: overlay overlay;\">" + "<div style=\"height: 50px; width: 50px;\"></div></div>"); + EXPECT_TRUE(document.IsUseCounted(feature)); + EXPECT_TRUE(document.IsUseCounted(feature2)); +} + +TEST(CSSPropertyParserTest, OneValueOverflowOverlayCount) { + auto dummy_page_holder = std::make_unique<DummyPageHolder>(IntSize(800, 600)); + Document& document = dummy_page_holder->GetDocument(); + Page::InsertOrdinaryPageForTesting(&dummy_page_holder->GetPage()); + WebFeature feature = WebFeature::kCSSValueOverflowOverlay; + WebFeature feature2 = WebFeature::kTwoValuedOverflow; + EXPECT_FALSE(document.IsUseCounted(feature)); + EXPECT_FALSE(document.IsUseCounted(feature2)); + document.documentElement()->SetInnerHTMLFromString( + "<div style=\"height: 10px; width: 10px; overflow: overlay;\">" + "<div style=\"height: 50px; width: 50px;\"></div></div>"); + EXPECT_TRUE(document.IsUseCounted(feature)); + EXPECT_FALSE(document.IsUseCounted(feature2)); +} + +TEST(CSSPropertyParserTest, OverflowXOverlayCount) { + auto dummy_page_holder = std::make_unique<DummyPageHolder>(IntSize(800, 600)); + Document& document = dummy_page_holder->GetDocument(); + Page::InsertOrdinaryPageForTesting(&dummy_page_holder->GetPage()); + WebFeature feature = WebFeature::kCSSValueOverflowOverlay; + WebFeature feature2 = WebFeature::kTwoValuedOverflow; + EXPECT_FALSE(document.IsUseCounted(feature)); + EXPECT_FALSE(document.IsUseCounted(feature2)); + document.documentElement()->SetInnerHTMLFromString( + "<div style=\"height: 10px; width: 10px; overflow-x: overlay;\">" + "<div style=\"height: 50px; width: 50px;\"></div></div>"); + EXPECT_TRUE(document.IsUseCounted(feature)); + EXPECT_FALSE(document.IsUseCounted(feature2)); +} + +TEST(CSSPropertyParserTest, OverflowYOverlayCount) { + auto dummy_page_holder = std::make_unique<DummyPageHolder>(IntSize(800, 600)); + Document& document = dummy_page_holder->GetDocument(); + Page::InsertOrdinaryPageForTesting(&dummy_page_holder->GetPage()); + WebFeature feature = WebFeature::kCSSValueOverflowOverlay; + WebFeature feature2 = WebFeature::kTwoValuedOverflow; + EXPECT_FALSE(document.IsUseCounted(feature)); + EXPECT_FALSE(document.IsUseCounted(feature2)); + document.documentElement()->SetInnerHTMLFromString( + "<div style=\"height: 10px; width: 10px; overflow-y: overlay;\">" + "<div style=\"height: 50px; width: 50px;\"></div></div>"); + EXPECT_TRUE(document.IsUseCounted(feature)); + EXPECT_FALSE(document.IsUseCounted(feature2)); +} + +TEST(CSSPropertyParserTest, OverflowFirstValueOverlayCount) { + auto dummy_page_holder = std::make_unique<DummyPageHolder>(IntSize(800, 600)); + Document& document = dummy_page_holder->GetDocument(); + Page::InsertOrdinaryPageForTesting(&dummy_page_holder->GetPage()); + WebFeature feature = WebFeature::kCSSValueOverflowOverlay; + WebFeature feature2 = WebFeature::kTwoValuedOverflow; + EXPECT_FALSE(document.IsUseCounted(feature)); + EXPECT_FALSE(document.IsUseCounted(feature2)); + document.documentElement()->SetInnerHTMLFromString( + "<div style=\"height: 10px; width: 10px; overflow: overlay scroll;\">" + "<div style=\"height: 50px; width: 50px;\"></div></div>"); + EXPECT_TRUE(document.IsUseCounted(feature)); + EXPECT_TRUE(document.IsUseCounted(feature2)); +} + +TEST(CSSPropertyParserTest, OverflowSecondValueOverlayCount) { + auto dummy_page_holder = std::make_unique<DummyPageHolder>(IntSize(800, 600)); + Document& document = dummy_page_holder->GetDocument(); + Page::InsertOrdinaryPageForTesting(&dummy_page_holder->GetPage()); + WebFeature feature = WebFeature::kCSSValueOverflowOverlay; + WebFeature feature2 = WebFeature::kTwoValuedOverflow; + EXPECT_FALSE(document.IsUseCounted(feature)); + EXPECT_FALSE(document.IsUseCounted(feature2)); + document.documentElement()->SetInnerHTMLFromString( + "<div style=\"height: 10px; width: 10px; overflow: scroll overlay;\">" + "<div style=\"height: 50px; width: 50px;\"></div></div>"); + EXPECT_TRUE(document.IsUseCounted(feature)); + EXPECT_TRUE(document.IsUseCounted(feature2)); +} + TEST(CSSPropertyParserTest, DropViewportDescriptor) { EXPECT_FALSE(IsValidPropertyValueForStyleRule(CSSPropertyID::kOrientation, "portrait"));
diff --git a/third_party/blink/renderer/core/css/resolver/style_resolver.cc b/third_party/blink/renderer/core/css/resolver/style_resolver.cc index fea9526..583152f 100644 --- a/third_party/blink/renderer/core/css/resolver/style_resolver.cc +++ b/third_party/blink/renderer/core/css/resolver/style_resolver.cc
@@ -38,6 +38,7 @@ #include "third_party/blink/renderer/core/animation/invalidatable_interpolation.h" #include "third_party/blink/renderer/core/animation/keyframe_effect.h" #include "third_party/blink/renderer/core/animation/transition_interpolation.h" +#include "third_party/blink/renderer/core/css/css_color_value.h" #include "third_party/blink/renderer/core/css/css_custom_ident_value.h" #include "third_party/blink/renderer/core/css/css_default_style_sheets.h" #include "third_party/blink/renderer/core/css/css_font_selector.h" @@ -53,6 +54,7 @@ #include "third_party/blink/renderer/core/css/css_selector_watch.h" #include "third_party/blink/renderer/core/css/css_style_declaration.h" #include "third_party/blink/renderer/core/css/css_style_rule.h" +#include "third_party/blink/renderer/core/css/css_unset_value.h" #include "third_party/blink/renderer/core/css/css_value_list.h" #include "third_party/blink/renderer/core/css/element_rule_collector.h" #include "third_party/blink/renderer/core/css/font_face.h" @@ -539,8 +541,7 @@ // If the system is in forced colors mode, match rules from the forced colors // style sheet. - if (blink::RuntimeEnabledFeatures::ForcedColorsEnabled() && - GetDocument().GetSettings()->GetForcedColors() != ForcedColors::kNone) + if (IsForcedColorsModeEnabled()) MatchRuleSet(collector, default_style_sheets.DefaultForcedColorStyle()); collector.FinishAddingUARules(); @@ -1557,7 +1558,8 @@ bool inherited_only, NeedsApplyPass& needs_apply_pass, ValidPropertyFilter valid_property_filter, - unsigned apply_mask) { + unsigned apply_mask, + ForcedColorFilter forced_colors) { unsigned property_count = properties->PropertyCount(); for (unsigned i = 0; i < property_count; ++i) { CSSPropertyValueSet::PropertyReference current = properties->PropertyAt(i); @@ -1586,6 +1588,9 @@ GetDocument())) continue; + if (!CSSPropertyPriorityData<priority>::PropertyHasPriority(property_id)) + continue; + if (inherited_only && !current.IsInherited()) { // If the property value is explicitly inherited, we need to apply further // non-inherited properties as they might override the value inherited @@ -1598,8 +1603,11 @@ continue; } - if (!CSSPropertyPriorityData<priority>::PropertyHasPriority(property_id)) + if (IsForcedColorsModeEnabled() && + forced_colors == ForcedColorFilter::kEnabled && + !current.Property().IsAffectedByForcedColors()) { continue; + } ApplyProperty<priority>(current, state, apply_mask); } @@ -1625,7 +1633,8 @@ const MatchedPropertiesRange& range, bool is_important, bool inherited_only, - NeedsApplyPass& needs_apply_pass) { + NeedsApplyPass& needs_apply_pass, + ForcedColorFilter forced_colors) { if (range.IsEmpty()) return; @@ -1640,7 +1649,7 @@ inherited_only, needs_apply_pass, static_cast<ValidPropertyFilter>( matched_properties.types_.valid_property_filter), - apply_mask); + apply_mask, forced_colors); } } @@ -1665,6 +1674,48 @@ was_viewport_resized_ = false; } +template <CSSPropertyPriority priority> +void StyleResolver::ApplyForcedColors(StyleResolverState& state, + const MatchResult& match_result, + bool apply_inherited_only, + NeedsApplyPass& needs_apply_pass) { + if (!IsForcedColorsModeEnabled()) + return; + if (state.Style()->ForcedColorAdjust() == EForcedColorAdjust::kNone) + return; + + const CSSValue* unset = cssvalue::CSSUnsetValue::Create(); + unsigned apply_mask = kApplyMaskRegular | kApplyMaskVisited; + + // This simulates 'revert !important' in the user origin. + // https://drafts.csswg.org/css-color-adjust-1/#forced-colors-properties + if (priority == kHighPropertyPriority) { + ApplyProperty(GetCSSPropertyColor(), state, *unset, apply_mask); + } else { + DCHECK(priority == kLowPropertyPriority); + ApplyProperty(GetCSSPropertyBackgroundColor(), state, *unset, apply_mask); + ApplyProperty(GetCSSPropertyBorderBottomColor(), state, *unset, apply_mask); + ApplyProperty(GetCSSPropertyBorderLeftColor(), state, *unset, apply_mask); + ApplyProperty(GetCSSPropertyBorderRightColor(), state, *unset, apply_mask); + ApplyProperty(GetCSSPropertyBorderTopColor(), state, *unset, apply_mask); + ApplyProperty(GetCSSPropertyBoxShadow(), state, *unset, apply_mask); + ApplyProperty(GetCSSPropertyOutlineColor(), state, *unset, apply_mask); + ApplyProperty(GetCSSPropertyTextShadow(), state, *unset, apply_mask); + ApplyProperty(GetCSSPropertyColumnRuleColor(), state, *unset, apply_mask); + ApplyProperty(GetCSSPropertyWebkitTapHighlightColor(), state, *unset, + apply_mask); + ApplyProperty(GetCSSPropertyOutlineColor(), state, *unset, apply_mask); + } + + auto force_colors = ForcedColorFilter::kEnabled; + ApplyMatchedProperties<priority, kCheckNeedsApplyPass>( + state, match_result.UaRules(), false, apply_inherited_only, + needs_apply_pass, force_colors); + ApplyMatchedProperties<priority, kCheckNeedsApplyPass>( + state, match_result.UaRules(), true, apply_inherited_only, + needs_apply_pass, force_colors); +} + StyleResolver::CacheSuccess StyleResolver::ApplyMatchedCache( StyleResolverState& state, const MatchResult& match_result) { @@ -1815,6 +1866,12 @@ state, match_result.UaRules(), true, apply_inherited_only, needs_apply_pass); + if (IsForcedColorsModeEnabled() && + state.Style()->ForcedColorAdjust() != EForcedColorAdjust::kNone) { + ApplyForcedColors<kHighPropertyPriority>( + state, match_result, apply_inherited_only, needs_apply_pass); + } + if (cache_success.cached_matched_properties && cache_success.cached_matched_properties->computed_style ->EffectiveZoom() != state.Style()->EffectiveZoom()) { @@ -1868,6 +1925,12 @@ state, match_result.UaRules(), true, apply_inherited_only, needs_apply_pass); + if (IsForcedColorsModeEnabled() && + state.Style()->ForcedColorAdjust() != EForcedColorAdjust::kNone) { + ApplyForcedColors<kLowPropertyPriority>( + state, match_result, apply_inherited_only, needs_apply_pass); + } + if (state.Style()->HasAppearance() && !apply_inherited_only) { // Check whether the final border and background differs from the cached UA // ones. When there is a partial match in the MatchedPropertiesCache, these @@ -2223,4 +2286,9 @@ visitor->Trace(tracker_); } +bool StyleResolver::IsForcedColorsModeEnabled() const { + return RuntimeEnabledFeatures::ForcedColorsEnabled() && + GetDocument().GetSettings()->GetForcedColors() != ForcedColors::kNone; +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/css/resolver/style_resolver.h b/third_party/blink/renderer/core/css/resolver/style_resolver.h index 31ff3a5..8809350e 100644 --- a/third_party/blink/renderer/core/css/resolver/style_resolver.h +++ b/third_party/blink/renderer/core/css/resolver/style_resolver.h
@@ -215,6 +215,8 @@ bool flags_[kPropertyPriorityCount * 2] = {0}; }; + enum class ForcedColorFilter { kEnabled, kDisabled }; + enum ShouldUpdateNeedsApplyPass { kCheckNeedsApplyPass = false, kUpdateNeedsApplyPass = true, @@ -240,6 +242,11 @@ bool& apply_inherited_only, NeedsApplyPass&); void ApplyMatchedProperties(StyleResolverState&, const MatchResult&); + template <CSSPropertyPriority priority> + void ApplyForcedColors(StyleResolverState& state, + const MatchResult& match_result, + bool apply_inherited_only, + NeedsApplyPass& needs_apply_pass); void CascadeAndApplyMatchedProperties(StyleResolverState&, const MatchResult&); @@ -263,19 +270,23 @@ void ApplyCallbackSelectors(StyleResolverState&); template <CSSPropertyPriority priority, ShouldUpdateNeedsApplyPass> - void ApplyMatchedProperties(StyleResolverState&, - const MatchedPropertiesRange&, - bool important, - bool inherited_only, - NeedsApplyPass&); + void ApplyMatchedProperties( + StyleResolverState&, + const MatchedPropertiesRange&, + bool important, + bool inherited_only, + NeedsApplyPass&, + ForcedColorFilter forced_colors = ForcedColorFilter::kDisabled); template <CSSPropertyPriority priority, ShouldUpdateNeedsApplyPass> - void ApplyProperties(StyleResolverState&, - const CSSPropertyValueSet* properties, - bool is_important, - bool inherited_only, - NeedsApplyPass&, - ValidPropertyFilter, - unsigned apply_mask); + void ApplyProperties( + StyleResolverState&, + const CSSPropertyValueSet* properties, + bool is_important, + bool inherited_only, + NeedsApplyPass&, + ValidPropertyFilter, + unsigned apply_mask, + ForcedColorFilter forced_colors = ForcedColorFilter::kDisabled); template <CSSPropertyPriority priority> void ApplyAnimatedStandardProperties(StyleResolverState&, const ActiveInterpolationsMap&); @@ -294,6 +305,8 @@ Document& GetDocument() const { return *document_; } bool WasViewportResized() const { return was_viewport_resized_; } + bool IsForcedColorsModeEnabled() const; + MatchedPropertiesCache matched_properties_cache_; Member<Document> document_; SelectorFilter selector_filter_;
diff --git a/third_party/blink/renderer/core/css/style_engine_test.cc b/third_party/blink/renderer/core/css/style_engine_test.cc index e8f2022c..f9fad92 100644 --- a/third_party/blink/renderer/core/css/style_engine_test.cc +++ b/third_party/blink/renderer/core/css/style_engine_test.cc
@@ -1564,6 +1564,9 @@ ScopedForcedColorsForTest scoped_feature(true); GetDocument().body()->SetInnerHTMLFromString(R"HTML( <style> + body { + forced-color-adjust: none; + } @media (forced-colors: none) { body { color: red } } @@ -1590,6 +1593,9 @@ ScopedForcedColorsForTest scoped_feature(true); GetDocument().body()->SetInnerHTMLFromString(R"HTML( <style> + body { + forced-color-adjust: none; + } @media (forced-colors: none) and (prefers-color-scheme: light) { body { color: red } }
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc index 8d2808e1..4651aed 100644 --- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc +++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
@@ -1058,10 +1058,15 @@ return web_frame_->Client()->OverrideFlashEmbedWithHTML(WebURL(url)); } -void LocalFrameClientImpl::NotifyUserActivation() { +void LocalFrameClientImpl::NotifyUserActivation( + bool need_browser_verification) { DCHECK(web_frame_->Client()); - web_frame_->Client()->UpdateUserActivationState( - UserActivationUpdateType::kNotifyActivation); + UserActivationUpdateType update_type = + need_browser_verification + ? UserActivationUpdateType:: + kNotifyActivationPendingBrowserVerification + : UserActivationUpdateType::kNotifyActivation; + web_frame_->Client()->UpdateUserActivationState(update_type); if (WebAutofillClient* autofill_client = web_frame_->AutofillClient()) autofill_client->UserGestureObserved(); }
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.h b/third_party/blink/renderer/core/exported/local_frame_client_impl.h index c0d76a1..af6a61a 100644 --- a/third_party/blink/renderer/core/exported/local_frame_client_impl.h +++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
@@ -244,7 +244,7 @@ KURL OverrideFlashEmbedWithHTML(const KURL&) override; - void NotifyUserActivation() override; + void NotifyUserActivation(bool need_browser_verification) override; void ConsumeUserActivation() override; void SetHasReceivedUserGestureBeforeNavigation(bool value) override;
diff --git a/third_party/blink/renderer/core/exported/web_remote_frame_impl.cc b/third_party/blink/renderer/core/exported/web_remote_frame_impl.cc index d973b15..66680b7 100644 --- a/third_party/blink/renderer/core/exported/web_remote_frame_impl.cc +++ b/third_party/blink/renderer/core/exported/web_remote_frame_impl.cc
@@ -413,6 +413,9 @@ case UserActivationUpdateType::kClearActivation: GetFrame()->ClearUserActivationInLocalTree(); break; + case UserActivationUpdateType::kNotifyActivationPendingBrowserVerification: + NOTREACHED() << "Unexpected UserActivationUpdateType from browser"; + break; } }
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc index bd7a647..f4e7059 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -1540,9 +1540,10 @@ // static std::unique_ptr<UserGestureIndicator> LocalFrame::NotifyUserActivation( LocalFrame* frame, - UserGestureToken::Status status) { + UserGestureToken::Status status, + bool need_browser_verification) { if (frame) - frame->NotifyUserActivation(); + frame->NotifyUserActivation(need_browser_verification); return std::make_unique<UserGestureIndicator>(status); } @@ -1552,7 +1553,7 @@ UserGestureToken* token) { DCHECK(!RuntimeEnabledFeatures::UserActivationV2Enabled()); if (frame) - frame->NotifyUserActivation(); + frame->NotifyUserActivation(false); return std::make_unique<UserGestureIndicator>(token); } @@ -1580,8 +1581,8 @@ : UserGestureIndicator::ConsumeUserGesture(); } -void LocalFrame::NotifyUserActivation() { - Client()->NotifyUserActivation(); +void LocalFrame::NotifyUserActivation(bool need_browser_verification) { + Client()->NotifyUserActivation(need_browser_verification); NotifyUserActivationInLocalTree(); }
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h index 03936d4..63ef804 100644 --- a/third_party/blink/renderer/core/frame/local_frame.h +++ b/third_party/blink/renderer/core/frame/local_frame.h
@@ -204,7 +204,8 @@ // that contains a |UserGestureToken| with the given status. static std::unique_ptr<UserGestureIndicator> NotifyUserActivation( LocalFrame*, - UserGestureToken::Status = UserGestureToken::kPossiblyExistingGesture); + UserGestureToken::Status = UserGestureToken::kPossiblyExistingGesture, + bool need_browser_verification = false); // Similar to above, but used only in old UAv1-specific code. static std::unique_ptr<UserGestureIndicator> NotifyUserActivation( @@ -488,7 +489,7 @@ void UpdateActiveSchedulerTrackedFeatures(uint64_t features_mask) override; // Activates the user activation states of this frame and all its ancestors. - void NotifyUserActivation(); + void NotifyUserActivation(bool need_browser_verification); // Returns the transient user activation state of this frame bool HasTransientUserActivation();
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h index 8b10a11..73d9fdd 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client.h +++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -438,7 +438,7 @@ // Notify the embedder that the associated frame has user activation so that // the replicated states in the browser and other renderers can be updated. - virtual void NotifyUserActivation() {} + virtual void NotifyUserActivation(bool need_browser_verification) {} // Tell the embedder that the associated frame has consumed user activation so // that the replicated states in the browser and other renderers can be
diff --git a/third_party/blink/renderer/core/input/event_handler.cc b/third_party/blink/renderer/core/input/event_handler.cc index 084e1de2..ecdf4eb 100644 --- a/third_party/blink/renderer/core/input/event_handler.cc +++ b/third_party/blink/renderer/core/input/event_handler.cc
@@ -716,7 +716,8 @@ return WebInputEventResult::kHandledSuppressed; std::unique_ptr<UserGestureIndicator> gesture_indicator = - LocalFrame::NotifyUserActivation(frame_); + LocalFrame::NotifyUserActivation( + frame_, UserGestureToken::kPossiblyExistingGesture, true); frame_->LocalFrameRoot() .GetEventHandler() .last_mouse_down_user_gesture_token_ =
diff --git a/third_party/blink/renderer/core/layout/layout_object.cc b/third_party/blink/renderer/core/layout/layout_object.cc index a5b4f272..2a3ff0c3 100644 --- a/third_party/blink/renderer/core/layout/layout_object.cc +++ b/third_party/blink/renderer/core/layout/layout_object.cc
@@ -1247,6 +1247,11 @@ // https://www.w3.org/TR/filter-effects-1/#FilterProperty if (style->HasFilter() && !this->IsDocumentElement()) return true; + // Backdrop-filter creates a containing block for fixed and absolute + // positioned elements: + // https://drafts.fxtf.org/filter-effects-2/#backdrop-filter-operation + if (style->HasBackdropFilter() && !this->IsDocumentElement()) + return true; // The LayoutView is always a container of fixed positioned descendants. In // addition, SVG foreignObjects become such containers, so that descendants // of a foreignObject cannot escape it. Similarly, text controls let authors
diff --git a/third_party/blink/renderer/core/paint/paint_layer.cc b/third_party/blink/renderer/core/paint/paint_layer.cc index 40e7b02..7df0ad0 100644 --- a/third_party/blink/renderer/core/paint/paint_layer.cc +++ b/third_party/blink/renderer/core/paint/paint_layer.cc
@@ -949,8 +949,11 @@ PaintLayer* PaintLayer::CompositingContainer() const { if (IsReplacedNormalFlowStacking()) return Parent(); - if (!GetLayoutObject().StyleRef().IsStacked()) - return IsSelfPaintingLayer() ? Parent() : ContainingLayer(); + if (!GetLayoutObject().StyleRef().IsStacked()) { + if (IsSelfPaintingLayer() || GetLayoutObject().IsColumnSpanAll()) + return Parent(); + return ContainingLayer(); + } return AncestorStackingContext(); }
diff --git a/third_party/blink/renderer/core/paint/paint_layer_test.cc b/third_party/blink/renderer/core/paint/paint_layer_test.cc index 0125cfa2..7c29a13 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_test.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_test.cc
@@ -1088,6 +1088,21 @@ } } +TEST_P(PaintLayerTest, CompositingContainerColumnSpanAll) { + SetBodyInnerHTML(R"HTML( + <div> + <div id='compositedContainer' style='columns: 1'> + <div id='columnSpan' style='-webkit-column-span: all; overflow: hidden'> + </div> + </div> + </div> + )HTML"); + + PaintLayer* target = GetPaintLayerByElementId("columnSpan"); + EXPECT_EQ(target->Parent(), target->CompositingContainer()); + EXPECT_EQ(target->Parent()->Parent(), target->ContainingLayer()); +} + TEST_P(PaintLayerTest, CompositingContainerStackedFloatUnderStackingCompositedInline) { SetBodyInnerHTML(R"HTML(
diff --git a/third_party/blink/renderer/core/style/computed_style.h b/third_party/blink/renderer/core/style/computed_style.h index 89ece0a9..a0dad13 100644 --- a/third_party/blink/renderer/core/style/computed_style.h +++ b/third_party/blink/renderer/core/style/computed_style.h
@@ -2319,7 +2319,10 @@ return HasTransformRelatedProperty() || // Filter establishes containing block for non-document elements: // https://drafts.fxtf.org/filter-effects-1/#FilterProperty - (!is_document_element && HasFilter()); + // Backdrop-filter creates a containing block for fixed and absolute + // positioned elements: + // https://drafts.fxtf.org/filter-effects-2/#backdrop-filter-operation + (!is_document_element && (HasFilter() || HasBackdropFilter())); } // Whitespace utility functions.
diff --git a/third_party/blink/renderer/modules/BUILD.gn b/third_party/blink/renderer/modules/BUILD.gn index e640d07..4d99de5b 100644 --- a/third_party/blink/renderer/modules/BUILD.gn +++ b/third_party/blink/renderer/modules/BUILD.gn
@@ -339,6 +339,7 @@ "mediarecorder/audio_track_recorder_unittest.cc", "mediarecorder/media_recorder_handler_unittest.cc", "mediarecorder/video_track_recorder_unittest.cc", + "mediasession/media_session_test.cc", "mediastream/media_constraints_test.cc", "mediastream/media_devices_test.cc", "mediastream/media_stream_audio_processor_test.cc", @@ -354,6 +355,7 @@ "mediastream/media_stream_video_track_test.cc", "mediastream/mock_mojo_media_stream_dispatcher_host.cc", "mediastream/mock_mojo_media_stream_dispatcher_host.h", + "mediastream/processed_local_audio_source_test.cc", "mediastream/user_media_client_impl_test.cc", "mediastream/video_track_adapter_unittest.cc", "mediastream/webaudio_media_stream_audio_sink_test.cc",
diff --git a/third_party/blink/renderer/modules/cookie_store/cookie_change_event.cc b/third_party/blink/renderer/modules/cookie_store/cookie_change_event.cc index ada3c8c..f1bc76e 100644 --- a/third_party/blink/renderer/modules/cookie_store/cookie_change_event.cc +++ b/third_party/blink/renderer/modules/cookie_store/cookie_change_event.cc
@@ -96,13 +96,13 @@ HeapVector<Member<CookieListItem>>& changed, HeapVector<Member<CookieListItem>>& deleted) { switch (change_cause) { - case ::network::mojom::CookieChangeCause::INSERTED: - case ::network::mojom::CookieChangeCause::EXPLICIT: { + case ::network::mojom::CookieChangeCause::INSERTED: { CookieListItem* cookie = ToCookieListItem(backend_cookie, false /* is_deleted */); changed.push_back(cookie); break; } + case ::network::mojom::CookieChangeCause::EXPLICIT: case ::network::mojom::CookieChangeCause::UNKNOWN_DELETION: case ::network::mojom::CookieChangeCause::EXPIRED: case ::network::mojom::CookieChangeCause::EVICTED:
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.cc b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.cc index ba463ee2..c9e9f152 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.cc +++ b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.cc
@@ -19,6 +19,7 @@ #include "third_party/blink/public/web/modules/mediastream/media_stream_constraints_util.h" #include "third_party/blink/public/web/modules/mediastream/media_stream_video_source.h" #include "third_party/blink/public/web/modules/mediastream/media_stream_video_track.h" +#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h" #include "third_party/blink/renderer/platform/wtf/functional.h" #include "third_party/blink/renderer/platform/wtf/text/base64.h" @@ -134,6 +135,7 @@ }; CanvasCaptureHandler::CanvasCaptureHandler( + LocalFrame* frame, const blink::WebSize& size, double frame_rate, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, @@ -142,7 +144,7 @@ std::unique_ptr<media::VideoCapturerSource> video_source( new VideoCapturerSource(weak_ptr_factory_.GetWeakPtr(), size, frame_rate)); - AddVideoCapturerSourceToVideoTrack(std::move(video_source), track); + AddVideoCapturerSourceToVideoTrack(frame, std::move(video_source), track); } CanvasCaptureHandler::~CanvasCaptureHandler() { @@ -154,6 +156,7 @@ // static std::unique_ptr<CanvasCaptureHandler> CanvasCaptureHandler::CreateCanvasCaptureHandler( + LocalFrame* frame, const blink::WebSize& size, double frame_rate, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, @@ -163,7 +166,7 @@ UpdateWebRTCMethodCount(blink::WebRTCAPIName::kCanvasCaptureStream); return std::unique_ptr<CanvasCaptureHandler>(new CanvasCaptureHandler( - size, frame_rate, std::move(io_task_runner), track)); + frame, size, frame_rate, std::move(io_task_runner), track)); } void CanvasCaptureHandler::SendNewFrame( @@ -476,6 +479,7 @@ } void CanvasCaptureHandler::AddVideoCapturerSourceToVideoTrack( + LocalFrame* frame, std::unique_ptr<media::VideoCapturerSource> source, blink::WebMediaStreamTrack* web_track) { uint8_t track_id_bytes[64]; @@ -484,7 +488,7 @@ media::VideoCaptureFormats preferred_formats = source->GetPreferredFormats(); blink::MediaStreamVideoSource* media_stream_source = new blink::MediaStreamVideoCapturerSource( - blink::WebPlatformMediaStreamSource::SourceStoppedCallback(), + frame, blink::WebPlatformMediaStreamSource::SourceStoppedCallback(), std::move(source)); blink::WebMediaStreamSource webkit_source; webkit_source.Initialize(track_id, blink::WebMediaStreamSource::kTypeVideo,
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.h b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.h index 85c6a3bb..907dd5d 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.h +++ b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.h
@@ -26,6 +26,7 @@ namespace blink { +class LocalFrame; class WebGraphicsContext3DProvider; // CanvasCaptureHandler acts as the link between Blink side HTMLCanvasElement @@ -43,6 +44,7 @@ // Creates a CanvasCaptureHandler instance and updates UMA histogram. static std::unique_ptr<CanvasCaptureHandler> CreateCanvasCaptureHandler( + LocalFrame* frame, const blink::WebSize& size, double frame_rate, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, @@ -67,6 +69,7 @@ // is then plugged into a MediaStreamTrack passed as |track|, and it is owned // by the Blink side MediaStreamSource. CanvasCaptureHandler( + LocalFrame* frame, const blink::WebSize& size, double frame_rate, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, @@ -102,6 +105,7 @@ const gfx::ColorSpace& color_space); void AddVideoCapturerSourceToVideoTrack( + LocalFrame* frame, std::unique_ptr<media::VideoCapturerSource> source, blink::WebMediaStreamTrack* web_track);
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc index 54965f43..5e2cac3 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc +++ b/third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler_unittest.cc
@@ -52,6 +52,7 @@ void SetUp() override { canvas_capture_handler_ = CanvasCaptureHandler::CreateCanvasCaptureHandler( + /*LocalFrame =*/nullptr, blink::WebSize(kTestCanvasCaptureWidth, kTestCanvasCaptureHeight), kTestCanvasCaptureFramesPerSecond, blink::scheduler::GetSingleThreadTaskRunnerForTesting(), &track_);
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/html_canvas_element_capture.cc b/third_party/blink/renderer/modules/mediacapturefromelement/html_canvas_element_capture.cc index 52037d30..6a148cb 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/html_canvas_element_capture.cc +++ b/third_party/blink/renderer/modules/mediacapturefromelement/html_canvas_element_capture.cc
@@ -8,6 +8,7 @@ #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/web_media_stream.h" #include "third_party/blink/public/platform/web_media_stream_track.h" +#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/html/canvas/html_canvas_element.h" #include "third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_handler.h" #include "third_party/blink/renderer/modules/mediacapturefromelement/canvas_capture_media_stream_track.h" @@ -53,15 +54,17 @@ return nullptr; } + LocalFrame* frame = ToLocalFrameIfNotDetached(script_state->GetContext()); WebMediaStreamTrack track; const WebSize size(element.width(), element.height()); std::unique_ptr<CanvasCaptureHandler> handler; if (given_frame_rate) { handler = CanvasCaptureHandler::CreateCanvasCaptureHandler( - size, frame_rate, Platform::Current()->GetIOTaskRunner(), &track); + frame, size, frame_rate, Platform::Current()->GetIOTaskRunner(), + &track); } else { handler = CanvasCaptureHandler::CreateCanvasCaptureHandler( - size, kDefaultFrameRate, Platform::Current()->GetIOTaskRunner(), + frame, size, kDefaultFrameRate, Platform::Current()->GetIOTaskRunner(), &track); }
diff --git a/third_party/blink/renderer/modules/mediacapturefromelement/html_media_element_capture.cc b/third_party/blink/renderer/modules/mediacapturefromelement/html_media_element_capture.cc index 31c50ef..80b1a3c6f 100644 --- a/third_party/blink/renderer/modules/mediacapturefromelement/html_media_element_capture.cc +++ b/third_party/blink/renderer/modules/mediacapturefromelement/html_media_element_capture.cc
@@ -37,6 +37,7 @@ // |is_readonly| should be true if the format of the data cannot be changed by // MediaTrackConstraints. bool AddVideoTrackToMediaStream( + LocalFrame* frame, std::unique_ptr<media::VideoCapturerSource> video_source, bool is_remote, WebMediaStream* web_media_stream) { @@ -50,7 +51,7 @@ video_source->GetPreferredFormats(); MediaStreamVideoSource* const media_stream_source = new MediaStreamVideoCapturerSource( - WebPlatformMediaStreamSource::SourceStoppedCallback(), + frame, WebPlatformMediaStreamSource::SourceStoppedCallback(), std::move(video_source)); const WebString track_id(WTF::CreateCanonicalUUIDString()); WebMediaStreamSource web_media_stream_source; @@ -72,12 +73,14 @@ // Fills in the WebMediaStream to capture from the WebMediaPlayer identified // by the second parameter. void CreateHTMLVideoElementCapturer( + LocalFrame* frame, WebMediaStream* web_media_stream, WebMediaPlayer* web_media_player, scoped_refptr<base::SingleThreadTaskRunner> task_runner) { DCHECK(web_media_stream); DCHECK(web_media_player); AddVideoTrackToMediaStream( + frame, HtmlVideoElementCapturerSource::CreateFromWebMediaPlayerImpl( web_media_player, Platform::Current()->GetIOTaskRunner(), std::move(task_runner)), @@ -88,6 +91,7 @@ // Fills in the WebMediaStream to capture from the WebMediaPlayer identified // by the second parameter. void CreateHTMLAudioElementCapturer( + LocalFrame*, WebMediaStream* web_media_stream, WebMediaPlayer* web_media_player, scoped_refptr<base::SingleThreadTaskRunner> task_runner) { @@ -195,13 +199,15 @@ if (media_element_->HasVideo()) { CreateHTMLVideoElementCapturer( - &web_stream, media_element_->GetWebMediaPlayer(), + To<Document>(context)->GetFrame(), &web_stream, + media_element_->GetWebMediaPlayer(), media_element_->GetExecutionContext()->GetTaskRunner( TaskType::kInternalMediaRealTime)); } if (media_element_->HasAudio()) { CreateHTMLAudioElementCapturer( - &web_stream, media_element_->GetWebMediaPlayer(), + To<Document>(context)->GetFrame(), &web_stream, + media_element_->GetWebMediaPlayer(), media_element_->GetExecutionContext()->GetTaskRunner( TaskType::kInternalMediaRealTime)); } @@ -289,13 +295,16 @@ return MediaStream::Create(context, descriptor); } + LocalFrame* frame = ToLocalFrameIfNotDetached(script_state->GetContext()); if (element.HasVideo()) { - CreateHTMLVideoElementCapturer(&web_stream, element.GetWebMediaPlayer(), + CreateHTMLVideoElementCapturer(frame, &web_stream, + element.GetWebMediaPlayer(), element.GetExecutionContext()->GetTaskRunner( TaskType::kInternalMediaRealTime)); } if (element.HasAudio()) { - CreateHTMLAudioElementCapturer(&web_stream, element.GetWebMediaPlayer(), + CreateHTMLAudioElementCapturer(frame, &web_stream, + element.GetWebMediaPlayer(), element.GetExecutionContext()->GetTaskRunner( TaskType::kInternalMediaRealTime)); }
diff --git a/third_party/blink/renderer/modules/mediasession/media_session.cc b/third_party/blink/renderer/modules/mediasession/media_session.cc index 912186d5..74ca899 100644 --- a/third_party/blink/renderer/modules/mediasession/media_session.cc +++ b/third_party/blink/renderer/modules/mediasession/media_session.cc
@@ -135,6 +135,9 @@ void MediaSession::setPlaybackState(const String& playback_state) { playback_state_ = StringToMediaSessionPlaybackState(playback_state); + + RecalculatePositionState(false /* notify */); + mojom::blink::MediaSessionService* service = GetService(); if (service) service->SetPlaybackState(playback_state_); @@ -211,8 +214,12 @@ // If the dictionary is empty / null then we should reset the position state. if (!position_state->hasDuration() && !position_state->hasPlaybackRate() && !position_state->hasPosition()) { + position_state_ = nullptr; + declared_playback_rate_ = 0.0; + if (auto* service = GetService()) service->SetPositionState(nullptr); + return; } @@ -252,13 +259,13 @@ return; } - auto* service = GetService(); - if (!service) - return; - - service->SetPositionState( + position_state_ = mojo::ConvertTo<media_session::mojom::blink::MediaPositionPtr>( - position_state)); + position_state); + + declared_playback_rate_ = position_state_->playback_rate; + + RecalculatePositionState(true /* notify */); } void MediaSession::NotifyActionChange(const String& action, @@ -280,6 +287,25 @@ } } +void MediaSession::RecalculatePositionState(bool notify) { + if (!position_state_) + return; + + double new_playback_rate = + playback_state_ == mojom::blink::MediaSessionPlaybackState::PAUSED + ? 0.0 + : declared_playback_rate_; + + notify = notify || new_playback_rate != position_state_->playback_rate; + position_state_->playback_rate = new_playback_rate; + + if (!notify) + return; + + if (auto* service = GetService()) + service->SetPositionState(position_state_.Clone()); +} + mojom::blink::MediaSessionService* MediaSession::GetService() { if (service_) return service_.get();
diff --git a/third_party/blink/renderer/modules/mediasession/media_session.h b/third_party/blink/renderer/modules/mediasession/media_session.h index 01727a7..3f0ed43 100644 --- a/third_party/blink/renderer/modules/mediasession/media_session.h +++ b/third_party/blink/renderer/modules/mediasession/media_session.h
@@ -64,6 +64,8 @@ void NotifyActionChange(const String& action, ActionChangeType); + void RecalculatePositionState(bool notify); + // blink::mojom::blink::MediaSessionClient implementation. void DidReceiveAction(media_session::mojom::blink::MediaSessionAction, mojom::blink::MediaSessionActionDetailsPtr) override; @@ -72,6 +74,8 @@ mojom::blink::MediaSessionService* GetService(); mojom::blink::MediaSessionPlaybackState playback_state_; + media_session::mojom::blink::MediaPositionPtr position_state_; + double declared_playback_rate_ = 0.0; Member<MediaMetadata> metadata_; HeapHashMap<String, Member<V8MediaSessionActionHandler>> action_handlers_; mojom::blink::MediaSessionServicePtr service_;
diff --git a/third_party/blink/renderer/modules/mediasession/media_session_test.cc b/third_party/blink/renderer/modules/mediasession/media_session_test.cc new file mode 100644 index 0000000..0405b3f --- /dev/null +++ b/third_party/blink/renderer/modules/mediasession/media_session_test.cc
@@ -0,0 +1,295 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/modules/mediasession/media_session.h" + +#include "base/macros.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "third_party/blink/renderer/core/testing/page_test_base.h" +#include "third_party/blink/renderer/modules/mediasession/media_position_state.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" + +namespace blink { + +using testing::_; + +namespace { + +class MockMediaSessionService : public mojom::blink::MediaSessionService { + public: + MockMediaSessionService() = default; + + mojom::blink::MediaSessionServicePtr CreateInterfacePtrAndBind() { + mojom::blink::MediaSessionServicePtr service; + binding_.Bind(mojo::MakeRequest(&service)); + return service; + } + + void SetClient(mojom::blink::MediaSessionClientPtr client) override {} + void SetPlaybackState( + mojom::blink::MediaSessionPlaybackState state) override {} + MOCK_METHOD1(SetPositionState, + void(media_session::mojom::blink::MediaPositionPtr)); + void SetMetadata(mojom::blink::SpecMediaMetadataPtr metadata) override {} + void EnableAction( + media_session::mojom::blink::MediaSessionAction action) override {} + void DisableAction( + media_session::mojom::blink::MediaSessionAction action) override {} + + private: + mojo::Binding<mojom::blink::MediaSessionService> binding_{this}; +}; + +} // namespace + +class MediaSessionTest : public PageTestBase { + public: + MediaSessionTest() = default; + + void SetUp() override { + PageTestBase::SetUp(); + + mock_service_ = std::make_unique<MockMediaSessionService>(); + + media_session_ = MakeGarbageCollected<MediaSession>(&GetDocument()); + media_session_->service_ = mock_service_->CreateInterfacePtrAndBind(); + } + + void SetPositionState(double duration, + double position, + double playback_rate) { + auto* position_state = MediaPositionState::Create(); + position_state->setDuration(duration); + position_state->setPosition(position); + position_state->setPlaybackRate(playback_rate); + + NonThrowableExceptionState exception_state; + media_session_->setPositionState(position_state, exception_state); + } + + void ClearPositionState() { + NonThrowableExceptionState exception_state; + media_session_->setPositionState(MediaPositionState::Create(), + exception_state); + } + + void SetPlaybackState(const String& state) { + media_session_->setPlaybackState(state); + } + + MockMediaSessionService& service() { return *mock_service_.get(); } + + private: + std::unique_ptr<MockMediaSessionService> mock_service_; + + Persistent<MediaSession> media_session_; + + DISALLOW_COPY_AND_ASSIGN(MediaSessionTest); +}; + +TEST_F(MediaSessionTest, PlaybackPositionState_None) { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(1.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPlaybackState("none"); + SetPositionState(10, 5, 1.0); + loop.Run(); +} + +TEST_F(MediaSessionTest, PlaybackPositionState_Paused) { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(0.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPlaybackState("paused"); + SetPositionState(10, 5, 1.0); + loop.Run(); +} + +TEST_F(MediaSessionTest, PlaybackPositionState_Playing) { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(1.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPlaybackState("playing"); + SetPositionState(10, 5, 1.0); + loop.Run(); +} + +TEST_F(MediaSessionTest, PlaybackPositionState_Paused_Clear) { + { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(0.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPlaybackState("paused"); + SetPositionState(10, 5, 1.0); + loop.Run(); + } + + { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_FALSE(position_state); + loop.Quit(); + })); + + ClearPositionState(); + loop.Run(); + } +} + +TEST_F(MediaSessionTest, PositionPlaybackState_None) { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(1.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPositionState(10, 5, 1.0); + SetPlaybackState("none"); + loop.Run(); +} + +TEST_F(MediaSessionTest, PositionPlaybackState_Paused_None) { + { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(1.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPositionState(10, 5, 1.0); + loop.Run(); + } + + { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(0.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPlaybackState("paused"); + loop.Run(); + } + + { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(1.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPlaybackState("none"); + loop.Run(); + } +} + +TEST_F(MediaSessionTest, PositionPlaybackState_Paused_Playing) { + { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(1.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPositionState(10, 5, 1.0); + loop.Run(); + } + + { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(0.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPlaybackState("paused"); + loop.Run(); + } + + { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(1.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPlaybackState("playing"); + loop.Run(); + } +} + +TEST_F(MediaSessionTest, PositionPlaybackState_Playing) { + base::RunLoop loop; + EXPECT_CALL(service(), SetPositionState(_)) + .WillOnce(testing::Invoke([&](auto position_state) { + EXPECT_EQ(base::TimeDelta::FromSeconds(10), position_state->duration); + EXPECT_EQ(base::TimeDelta::FromSeconds(5), position_state->position); + EXPECT_EQ(1.0, position_state->playback_rate); + + loop.Quit(); + })); + + SetPositionState(10, 5, 1.0); + SetPlaybackState("playing"); + loop.Run(); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/OWNERS b/third_party/blink/renderer/modules/mediastream/OWNERS index 77d16fa..074319d 100644 --- a/third_party/blink/renderer/modules/mediastream/OWNERS +++ b/third_party/blink/renderer/modules/mediastream/OWNERS
@@ -2,5 +2,7 @@ hbos@chromium.org tommi@chromium.org +per-file media_stream_audio_processor*=aluebs@chromium.org + # TEAM: webrtc-dev@chromium.org # COMPONENT: Blink>GetUserMedia
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.cc b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.cc index b99dd9b..fac8815e 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.cc
@@ -18,25 +18,11 @@ namespace blink { -namespace { - -LocalFrame* GetFrameForCurrentContext() { - v8::Local<v8::Context> context = - v8::Isolate::GetCurrent()->GetCurrentContext(); - if (context.IsEmpty()) - return nullptr; - - return ToLocalFrameIfNotDetached(context); -} - -} // namespace - MediaStreamVideoCapturerSource::MediaStreamVideoCapturerSource( + LocalFrame* frame, const SourceStoppedCallback& stop_callback, std::unique_ptr<media::VideoCapturerSource> source) - // TODO(crbug.com/704136): Replace the use of this function by - // passing the LocalFrame instance explicitly. - : frame_(GetFrameForCurrentContext()), source_(std::move(source)) { + : frame_(frame), source_(std::move(source)) { media::VideoCaptureFormats preferred_formats = source_->GetPreferredFormats(); if (!preferred_formats.empty()) capture_params_.requested_format = preferred_formats.front();
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h index 30b52aae6..7d555cc2 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h
@@ -37,6 +37,7 @@ base::RepeatingCallback<std::unique_ptr<media::VideoCapturerSource>( const base::UnguessableToken& session_id)>; MediaStreamVideoCapturerSource( + LocalFrame* frame, const SourceStoppedCallback& stop_callback, std::unique_ptr<media::VideoCapturerSource> source); MediaStreamVideoCapturerSource(
diff --git a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc index b900db8..49a8fa4 100644 --- a/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc +++ b/third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source_test.cc
@@ -108,6 +108,7 @@ delegate_ = delegate.get(); EXPECT_CALL(*delegate_, GetPreferredFormats()); source_ = new MediaStreamVideoCapturerSource( + /*LocalFrame =*/nullptr, WTF::BindRepeating(&MediaStreamVideoCapturerSourceTest::OnSourceStopped, WTF::Unretained(this)), std::move(delegate));
diff --git a/content/renderer/media/stream/processed_local_audio_source_unittest.cc b/third_party/blink/renderer/modules/mediastream/processed_local_audio_source_test.cc similarity index 77% rename from content/renderer/media/stream/processed_local_audio_source_unittest.cc rename to third_party/blink/renderer/modules/mediastream/processed_local_audio_source_test.cc index f7e5b63f..3a6d0a9e 100644 --- a/content/renderer/media/stream/processed_local_audio_source_unittest.cc +++ b/third_party/blink/renderer/modules/mediastream/processed_local_audio_source_test.cc
@@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/logging.h" -#include "base/test/scoped_task_environment.h" #include "build/build_config.h" #include "media/base/audio_bus.h" #include "media/base/audio_parameters.h" @@ -16,19 +15,19 @@ #include "third_party/blink/public/platform/modules/mediastream/media_stream_audio_processor_options.h" #include "third_party/blink/public/platform/modules/mediastream/media_stream_audio_track.h" #include "third_party/blink/public/platform/modules/mediastream/web_media_stream_audio_sink.h" -#include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h" #include "third_party/blink/public/platform/web_media_constraints.h" #include "third_party/blink/public/web/modules/mediastream/processed_local_audio_source.h" #include "third_party/blink/public/web/modules/webrtc/webrtc_audio_device_impl.h" #include "third_party/blink/public/web/web_heap.h" +#include "third_party/blink/renderer/platform/testing/testing_platform_support.h" using ::testing::_; using ::testing::AtLeast; using ::testing::Invoke; using ::testing::WithArg; -namespace content { +namespace blink { namespace { @@ -69,21 +68,18 @@ MockAudioCapturerSource::MockAudioCapturerSource() {} MockAudioCapturerSource::~MockAudioCapturerSource() {} -// Test blink::Platform implementation that overrides the known methods needed +// Test Platform implementation that overrides the known methods needed // by the tests, including creation of WebRtcAudioDevice and // AudioCapturerSource instances. -// -// TODO(crbug.com/704136): When this test moves to blink/renderer/ it should -// inherit from TestingPlatformSupport and use ScopedTestingPlatformSupport. -class WebRtcAudioDeviceTestingPlatformSupport : public blink::Platform { +class WebRtcAudioDeviceTestingPlatformSupport : public TestingPlatformSupport { public: WebRtcAudioDeviceTestingPlatformSupport() = default; - blink::WebRtcAudioDeviceImpl* GetWebRtcAudioDevice() override { + WebRtcAudioDeviceImpl* GetWebRtcAudioDevice() override { return audio_device_.get(); } scoped_refptr<media::AudioCapturerSource> NewAudioCapturerSource( - blink::WebLocalFrame* web_frame, + WebLocalFrame* web_frame, const media::AudioSourceParameters& params) override { // The |web_frame| is irrelevant here, so we use MSG_ROUTING_NONE directly. EXPECT_EQ(nullptr, web_frame); @@ -101,7 +97,7 @@ base::MakeRefCounted<MockAudioCapturerSource>(); }; -class MockMediaStreamAudioSink : public blink::WebMediaStreamAudioSink { +class MockMediaStreamAudioSink : public WebMediaStreamAudioSink { public: MockMediaStreamAudioSink() {} ~MockMediaStreamAudioSink() override {} @@ -134,15 +130,9 @@ ~ProcessedLocalAudioSourceTest() override {} void SetUp() override { - platform_original_ = blink::Platform::Current(); - webrtc_audio_device_platform_support_.reset( - new WebRtcAudioDeviceTestingPlatformSupport()); - blink::Platform::SetCurrentPlatformForTesting( - webrtc_audio_device_platform_support_.get()); - blink_audio_source_.Initialize(blink::WebString::FromUTF8("audio_label"), - blink::WebMediaStreamSource::kTypeAudio, - blink::WebString::FromUTF8("audio_track"), + WebMediaStreamSource::kTypeAudio, + WebString::FromUTF8("audio_track"), false /* remote */); blink_audio_track_.Initialize(blink_audio_source_.Id(), blink_audio_source_); @@ -151,21 +141,20 @@ void TearDown() override { blink_audio_track_.Reset(); blink_audio_source_.Reset(); - blink::WebHeap::CollectAllGarbageForTesting(); - blink::Platform::SetCurrentPlatformForTesting(platform_original_); + WebHeap::CollectAllGarbageForTesting(); } void CreateProcessedLocalAudioSource( - const blink::AudioProcessingProperties& properties) { + const AudioProcessingProperties& properties) { std::unique_ptr<blink::ProcessedLocalAudioSource> source = std::make_unique<blink::ProcessedLocalAudioSource>( nullptr /* consumer_web_frame is N/A for non-browser tests */, - blink::MediaStreamDevice( - blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE, - "mock_audio_device_id", "Mock audio device", kSampleRate, - kChannelLayout, kRequestedBufferSize), + MediaStreamDevice(mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE, + "mock_audio_device_id", "Mock audio device", + kSampleRate, kChannelLayout, + kRequestedBufferSize), false /* disable_local_echo */, properties, base::DoNothing(), - blink::scheduler::GetSingleThreadTaskRunnerForTesting()); + scheduler::GetSingleThreadTaskRunnerForTesting()); source->SetAllowInvalidRenderFrameIdForTesting(true); blink_audio_source_.SetPlatformSource( std::move(source)); // Takes ownership. @@ -185,29 +174,24 @@ media::AudioCapturerSource::CaptureCallback* capture_source_callback() const { return static_cast<media::AudioCapturerSource::CaptureCallback*>( - blink::ProcessedLocalAudioSource::From(audio_source())); + ProcessedLocalAudioSource::From(audio_source())); } - blink::MediaStreamAudioSource* audio_source() const { - return blink::MediaStreamAudioSource::From(blink_audio_source_); + MediaStreamAudioSource* audio_source() const { + return MediaStreamAudioSource::From(blink_audio_source_); } - const blink::WebMediaStreamTrack& blink_audio_track() { - return blink_audio_track_; - } + const WebMediaStreamTrack& blink_audio_track() { return blink_audio_track_; } MockAudioCapturerSource* mock_audio_capturer_source() { return webrtc_audio_device_platform_support_->mock_audio_capturer_source(); } private: - base::test::ScopedTaskEnvironment - task_environment_; // Needed for MSAudioProcessor. - std::unique_ptr<WebRtcAudioDeviceTestingPlatformSupport> + ScopedTestingPlatformSupport<WebRtcAudioDeviceTestingPlatformSupport> webrtc_audio_device_platform_support_; - blink::Platform* platform_original_ = nullptr; - blink::WebMediaStreamSource blink_audio_source_; - blink::WebMediaStreamTrack blink_audio_track_; + WebMediaStreamSource blink_audio_source_; + WebMediaStreamTrack blink_audio_track_; }; // Tests a basic end-to-end start-up, track+sink connections, audio flow, and @@ -220,7 +204,7 @@ // Turn off the default constraints so the sink will get audio in chunks of // the native buffer size. - blink::AudioProcessingProperties properties; + AudioProcessingProperties properties; properties.DisableDefaultProperties(); CreateProcessedLocalAudioSource(properties); @@ -242,7 +226,7 @@ new MockMediaStreamAudioSink()); EXPECT_CALL(*sink, FormatIsSet(_)) .WillOnce(Invoke(this, &ThisTest::CheckOutputFormatMatches)); - blink::MediaStreamAudioTrack::From(blink_audio_track())->AddSink(sink.get()); + MediaStreamAudioTrack::From(blink_audio_track())->AddSink(sink.get()); // Feed audio data into the ProcessedLocalAudioSource and expect it to reach // the sink. @@ -261,8 +245,7 @@ // Expect the ProcessedLocalAudioSource to auto-stop the MockCapturerSource // when the track is stopped. EXPECT_CALL(*mock_audio_capturer_source(), Stop()); - blink::MediaStreamAudioTrack::From(blink_audio_track())->Stop(); + MediaStreamAudioTrack::From(blink_audio_track())->Stop(); } - -} // namespace content +} // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/user_media_processor.cc b/third_party/blink/renderer/modules/mediastream/user_media_processor.cc index d38d1026..0b309d2 100644 --- a/third_party/blink/renderer/modules/mediastream/user_media_processor.cc +++ b/third_party/blink/renderer/modules/mediastream/user_media_processor.cc
@@ -9,7 +9,6 @@ #include <algorithm> #include <utility> -#include "base/bind.h" #include "base/location.h" #include "base/logging.h" #include "base/single_thread_task_runner.h" @@ -43,10 +42,28 @@ #include "third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.h" #include "third_party/blink/renderer/modules/mediastream/media_stream_video_capturer_source.h" #include "third_party/blink/renderer/modules/mediastream/user_media_client_impl.h" +#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" #include "third_party/blink/renderer/platform/video_capture/local_video_capturer_source.h" +#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" #include "third_party/blink/renderer/platform/wtf/wtf_size_t.h" #include "ui/gfx/geometry/size.h" +namespace WTF { + +template <> +struct CrossThreadCopier<blink::WebMediaStream> + : public CrossThreadCopierPassThrough<blink::WebMediaStream> { + STATIC_ONLY(CrossThreadCopier); +}; + +template <> +struct CrossThreadCopier<blink::WebUserMediaRequest> + : public CrossThreadCopierPassThrough<blink::WebUserMediaRequest> { + STATIC_ONLY(CrossThreadCopier); +}; + +} // namespace WTF + namespace blink { using blink::mojom::MediaStreamRequestResult; @@ -374,7 +391,7 @@ Vector<MediaStreamDevice> video_devices_; }; -// TODO(guidou): Initialize request_result_name_ as a null blink::WebString. +// TODO(guidou): Initialize request_result_name_ as a null WTF::String. // https://crbug.com/764293 UserMediaProcessor::RequestInfo::RequestInfo( std::unique_ptr<UserMediaRequestInfo> request) @@ -419,7 +436,8 @@ native_source, video_capture_settings_.track_adapter_settings(), video_capture_settings_.noise_reduction(), is_video_content_capture_, video_capture_settings_.min_frame_rate(), - base::Bind(&UserMediaProcessor::RequestInfo::OnTrackStarted, AsWeakPtr()), + WTF::BindRepeating(&UserMediaProcessor::RequestInfo::OnTrackStarted, + AsWeakPtr()), true); } @@ -522,16 +540,16 @@ } if (blink::IsDeviceMediaType(audio_controls.stream_type)) { - GetMediaDevicesDispatcher()->GetAudioInputCapabilities(base::BindOnce( + GetMediaDevicesDispatcher()->GetAudioInputCapabilities(WTF::Bind( &UserMediaProcessor::SelectAudioDeviceSettings, weak_factory_.GetWeakPtr(), current_request_info_->web_request())); } else { if (!blink::IsAudioInputMediaType(audio_controls.stream_type)) { - blink::WebString failed_constraint_name = - blink::WebString::FromASCII(current_request_info_->web_request() - .AudioConstraints() - .Basic() - .media_stream_source.GetName()); + String failed_constraint_name = + String(current_request_info_->web_request() + .AudioConstraints() + .Basic() + .media_stream_source.GetName()); MediaStreamRequestResult result = MediaStreamRequestResult::CONSTRAINT_NOT_SATISFIED; GetUserMediaRequestFailed(result, failed_constraint_name); @@ -592,8 +610,7 @@ web_request.ShouldDisableHardwareNoiseSuppression(), true /* is_reconfiguration_allowed */); if (!settings.HasValue()) { - blink::WebString failed_constraint_name = - blink::WebString::FromASCII(settings.failed_constraint_name()); + String failed_constraint_name = String(settings.failed_constraint_name()); MediaStreamRequestResult result = failed_constraint_name.IsEmpty() ? MediaStreamRequestResult::NO_HARDWARE @@ -669,16 +686,16 @@ InitializeVideoTrackControls(current_request_info_->web_request(), &video_controls); if (blink::IsDeviceMediaType(video_controls.stream_type)) { - GetMediaDevicesDispatcher()->GetVideoInputCapabilities(base::BindOnce( + GetMediaDevicesDispatcher()->GetVideoInputCapabilities(WTF::Bind( &UserMediaProcessor::SelectVideoDeviceSettings, weak_factory_.GetWeakPtr(), current_request_info_->web_request())); } else { if (!blink::IsVideoInputMediaType(video_controls.stream_type)) { - blink::WebString failed_constraint_name = - blink::WebString::FromASCII(current_request_info_->web_request() - .VideoConstraints() - .Basic() - .media_stream_source.GetName()); + String failed_constraint_name = + String(current_request_info_->web_request() + .VideoConstraints() + .Basic() + .media_stream_source.GetName()); MediaStreamRequestResult result = MediaStreamRequestResult::CONSTRAINT_NOT_SATISFIED; GetUserMediaRequestFailed(result, failed_constraint_name); @@ -715,8 +732,7 @@ blink::MediaStreamVideoSource::kDefaultHeight, blink::MediaStreamVideoSource::kDefaultFrameRate); if (!settings.HasValue()) { - blink::WebString failed_constraint_name = - blink::WebString::FromASCII(settings.failed_constraint_name()); + String failed_constraint_name = String(settings.failed_constraint_name()); MediaStreamRequestResult result = failed_constraint_name.IsEmpty() ? MediaStreamRequestResult::NO_HARDWARE @@ -741,8 +757,7 @@ current_request_info_->stream_controls()->video.stream_type, screen_size.width(), screen_size.height()); if (!settings.HasValue()) { - blink::WebString failed_constraint_name = - blink::WebString::FromASCII(settings.failed_constraint_name()); + String failed_constraint_name = String(settings.failed_constraint_name()); DCHECK(!failed_constraint_name.IsEmpty()); GetUserMediaRequestFailed( MediaStreamRequestResult::CONSTRAINT_NOT_SATISFIED, @@ -780,9 +795,9 @@ current_request_info_->is_processing_user_gesture(), blink::mojom::blink::StreamSelectionInfo::New( strategy, requested_audio_capture_session_id), - base::BindOnce(&UserMediaProcessor::OnStreamGenerated, - weak_factory_.GetWeakPtr(), - current_request_info_->request_id())); + WTF::Bind(&UserMediaProcessor::OnStreamGenerated, + weak_factory_.GetWeakPtr(), + current_request_info_->request_id())); } void UserMediaProcessor::OnStreamGenerated( @@ -842,10 +857,10 @@ String video_device_id(video_device.id.data()); GetMediaDevicesDispatcher()->GetAllVideoInputDeviceFormats( video_device_id, - base::BindOnce(&UserMediaProcessor::GotAllVideoInputFormatsForDevice, - weak_factory_.GetWeakPtr(), - current_request_info_->web_request(), label, - video_device_id)); + WTF::Bind(&UserMediaProcessor::GotAllVideoInputFormatsForDevice, + weak_factory_.GetWeakPtr(), + current_request_info_->web_request(), label, + video_device_id)); } } @@ -904,16 +919,17 @@ blink::WebPlatformMediaStreamSource* source, MediaStreamRequestResult result, const blink::WebString& result_name) { - task_runner->PostTask( - FROM_HERE, - base::BindOnce(&UserMediaProcessor::OnAudioSourceStarted, - std::move(weak_ptr), source, result, result_name)); + PostCrossThreadTask( + *task_runner.get(), FROM_HERE, + CrossThreadBindOnce(&UserMediaProcessor::OnAudioSourceStarted, + std::move(weak_ptr), CrossThreadUnretained(source), + result, String(result_name))); } void UserMediaProcessor::OnAudioSourceStarted( blink::WebPlatformMediaStreamSource* source, MediaStreamRequestResult result, - const blink::WebString& result_name) { + const String& result_name) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); for (auto it = pending_local_sources_.begin(); @@ -1016,13 +1032,13 @@ blink::WebMediaStreamSource source = FindOrInitializeSourceObject(device); if (!source.GetPlatformSource()) { source.SetPlatformSource(CreateVideoSource( - device, base::Bind(&UserMediaProcessor::OnLocalSourceStopped, - weak_factory_.GetWeakPtr()))); + device, WTF::BindRepeating(&UserMediaProcessor::OnLocalSourceStopped, + weak_factory_.GetWeakPtr()))); String device_id(device.id.data()); source.SetCapabilities(ComputeCapabilitiesForVideoSource( - blink::WebString::FromUTF8(device.id), // TODO(crbug.com/704136): Change ComputeCapabilitiesForVideoSource to // operate over WTF::Vector and WTF::String. + blink::WebString::FromUTF8(device.id), ToStdVector(*current_request_info_->GetNativeVideoFormats(device_id)), device.video_facing, current_request_info_->is_video_device_capture(), device.group_id)); @@ -1057,13 +1073,13 @@ pending_local_sources_.push_back(source); blink::WebPlatformMediaStreamSource::ConstraintsRepeatingCallback - source_ready = base::BindRepeating( + source_ready = ConvertToBaseCallback(CrossThreadBindRepeating( &UserMediaProcessor::OnAudioSourceStartedOnAudioThread, task_runner_, - weak_factory_.GetWeakPtr()); + weak_factory_.GetWeakPtr())); std::unique_ptr<blink::MediaStreamAudioSource> audio_source = CreateAudioSource(device, std::move(source_ready)); - audio_source->SetStopCallback(base::Bind( + audio_source->SetStopCallback(BindRepeating( &UserMediaProcessor::OnLocalSourceStopped, weak_factory_.GetWeakPtr())); #if DCHECK_IS_ON() @@ -1176,7 +1192,7 @@ return std::make_unique<blink::MediaStreamVideoCapturerSource>( frame_, stop_callback, device, current_request_info_->video_capture_settings().capture_params(), - base::BindRepeating( + WTF::BindRepeating( &blink::LocalVideoCapturerSource::Create, frame_->GetTaskRunner(blink::TaskType::kInternalMedia))); } @@ -1197,14 +1213,14 @@ current_request_info_->video_devices().size()); CreateVideoTracks(current_request_info_->video_devices(), &video_tracks); - blink::WebString blink_id = blink::WebString(label); + String blink_id = label; current_request_info_->web_stream()->Initialize(blink_id, audio_tracks, video_tracks); // Wait for the tracks to be started successfully or to fail. current_request_info_->CallbackOnTracksStarted( - base::BindOnce(&UserMediaProcessor::OnCreateNativeTracksCompleted, - weak_factory_.GetWeakPtr(), label)); + WTF::Bind(&UserMediaProcessor::OnCreateNativeTracksCompleted, + weak_factory_.GetWeakPtr(), label)); } void UserMediaProcessor::CreateVideoTracks( @@ -1289,6 +1305,7 @@ void UserMediaProcessor::GetUserMediaRequestSucceeded( const blink::WebMediaStream& stream, blink::WebUserMediaRequest web_request) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(IsCurrentRequestInfo(web_request)); blink::WebRtcLogMessage( base::StringPrintf("UMCI::GetUserMediaRequestSucceeded. request_id=%d", @@ -1300,13 +1317,14 @@ // Therefore, post a task to complete the request with a clean stack. task_runner_->PostTask( FROM_HERE, - base::BindOnce(&UserMediaProcessor::DelayedGetUserMediaRequestSucceeded, - weak_factory_.GetWeakPtr(), stream, web_request)); + WTF::Bind(&UserMediaProcessor::DelayedGetUserMediaRequestSucceeded, + weak_factory_.GetWeakPtr(), stream, web_request)); } void UserMediaProcessor::DelayedGetUserMediaRequestSucceeded( const blink::WebMediaStream& stream, blink::WebUserMediaRequest web_request) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DVLOG(1) << "UserMediaProcessor::DelayedGetUserMediaRequestSucceeded"; blink::LogUserMediaRequestResult(MediaStreamRequestResult::OK); DeleteWebRequest(web_request); @@ -1317,6 +1335,7 @@ MediaStreamRequestResult result, const String& constraint_name) { DCHECK(current_request_info_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); blink::WebRtcLogMessage( base::StringPrintf("UMCI::GetUserMediaRequestFailed. request_id=%d", current_request_info_->request_id())); @@ -1327,16 +1346,16 @@ // Therefore, post a task to complete the request with a clean stack. task_runner_->PostTask( FROM_HERE, - base::BindOnce(&UserMediaProcessor::DelayedGetUserMediaRequestFailed, - weak_factory_.GetWeakPtr(), - current_request_info_->web_request(), result, - constraint_name)); + WTF::Bind(&UserMediaProcessor::DelayedGetUserMediaRequestFailed, + weak_factory_.GetWeakPtr(), + current_request_info_->web_request(), result, constraint_name)); } void UserMediaProcessor::DelayedGetUserMediaRequestFailed( blink::WebUserMediaRequest web_request, MediaStreamRequestResult result, - const blink::WebString& constraint_name) { + const String& constraint_name) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); blink::LogUserMediaRequestResult(result); DeleteWebRequest(web_request); switch (result) {
diff --git a/third_party/blink/renderer/modules/mediastream/user_media_processor.h b/third_party/blink/renderer/modules/mediastream/user_media_processor.h index 89a05d6..99c18ca 100644 --- a/third_party/blink/renderer/modules/mediastream/user_media_processor.h +++ b/third_party/blink/renderer/modules/mediastream/user_media_processor.h
@@ -172,7 +172,7 @@ void DelayedGetUserMediaRequestFailed( blink::WebUserMediaRequest web_request, blink::mojom::blink::MediaStreamRequestResult result, - const blink::WebString& constraint_name); + const String& constraint_name); // Called when |source| has been stopped from JavaScript. void OnLocalSourceStopped(const blink::WebMediaStreamSource& source); @@ -218,7 +218,7 @@ void OnAudioSourceStarted( blink::WebPlatformMediaStreamSource* source, blink::mojom::blink::MediaStreamRequestResult result, - const blink::WebString& result_name); + const String& result_name); void NotifyCurrentRequestInfoOfAudioSourceStarted( blink::WebPlatformMediaStreamSource* source,
diff --git a/third_party/blink/renderer/modules/scheduler/task.cc b/third_party/blink/renderer/modules/scheduler/task.cc index 400f574..de6cb82 100644 --- a/third_party/blink/renderer/modules/scheduler/task.cc +++ b/third_party/blink/renderer/modules/scheduler/task.cc
@@ -9,7 +9,9 @@ #include "base/logging.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/bindings/core/v8/v8_function.h" +#include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/modules/scheduler/task_queue.h" +#include "third_party/blink/renderer/platform/bindings/script_state.h" #include "third_party/blink/renderer/platform/wtf/std_lib_extras.h" namespace blink { @@ -28,6 +30,9 @@ void Task::Trace(Visitor* visitor) { visitor->Trace(task_queue_); visitor->Trace(callback_); + visitor->Trace(result_value_); + visitor->Trace(result_promise_); + visitor->Trace(exception_); ScriptWrappable::Trace(visitor); } @@ -40,11 +45,22 @@ return TaskStatusToString(status_); } -void Task::cancel() { +void Task::cancel(ScriptState* script_state) { if (!IsPending()) return; CancelPendingTask(); SetTaskStatus(Status::kCanceled); + ResolveOrRejectPromiseIfNeeded(script_state); +} + +ScriptPromise Task::result(ScriptState* script_state) { + if (!result_promise_) { + result_promise_ = MakeGarbageCollected<TaskResultPromise>( + ExecutionContext::From(script_state), this, + TaskResultPromise::kFinished); + ResolveOrRejectPromiseIfNeeded(script_state); + } + return result_promise_->Promise(script_state->World()); } void Task::SetTaskHandle(TaskHandle&& task_handle) { @@ -64,9 +80,66 @@ void Task::Invoke() { DCHECK(IsPending()); + DCHECK(callback_); + + ScriptState* script_state = + callback_->CallbackRelevantScriptStateOrReportError("Task", "Invoke"); + if (!script_state || !script_state->ContextIsValid()) + return; + SetTaskStatus(Status::kRunning); - callback_->InvokeAndReportException(nullptr, arguments_); + InvokeInternal(script_state); SetTaskStatus(Status::kCompleted); + + ResolveOrRejectPromiseIfNeeded(script_state); + callback_.Release(); +} + +void Task::InvokeInternal(ScriptState* script_state) { + ScriptState::Scope scope(script_state); + v8::TryCatch try_catch(script_state->GetIsolate()); + try_catch.SetVerbose(true); + + ScriptValue result; + if (!callback_->Invoke(nullptr, arguments_).To(&result)) { + if (try_catch.HasCaught()) { + exception_.Set(script_state->GetIsolate(), try_catch.Exception()); + } + return; + } + result_value_.Set(script_state->GetIsolate(), result.V8Value()); +} + +void Task::ResolveOrRejectPromiseIfNeeded(ScriptState* script_state) { + // Lazily resolove or reject the Promise - we don't do anything unless the + // result property has been accessed. + if (!result_promise_) + return; + + if (!script_state->ContextIsValid()) + return; + ScriptState::Scope scope(script_state); + + if (!exception_.IsEmpty()) { + result_promise_->Reject(ScriptValue::From( + script_state, exception_.NewLocal(script_state->GetIsolate()))); + return; + } + + // TODO(shaseley): Once we have continuation built, consider resolving this + // promise async with continuation timing. + if (status_ == Status::kCompleted) { + result_promise_->Resolve(ScriptValue::From( + script_state, result_value_.NewLocal(script_state->GetIsolate()))); + return; + } + + if (status_ == Status::kCanceled) { + result_promise_->Reject(ScriptValue::From( + script_state, + MakeGarbageCollected<DOMException>(DOMExceptionCode::kAbortError))); + return; + } } void Task::SetTaskStatus(Status status) { @@ -122,7 +195,7 @@ return false; } } - // Canceled and Finished are both end states. + // Canceled and Completed are both end states. case Status::kCanceled: case Status::kCompleted: return false;
diff --git a/third_party/blink/renderer/modules/scheduler/task.h b/third_party/blink/renderer/modules/scheduler/task.h index 713723e..1a1d7c0 100644 --- a/third_party/blink/renderer/modules/scheduler/task.h +++ b/third_party/blink/renderer/modules/scheduler/task.h
@@ -5,14 +5,18 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_SCHEDULER_TASK_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_SCHEDULER_TASK_H_ +#include "third_party/blink/renderer/bindings/core/v8/script_promise.h" +#include "third_party/blink/renderer/bindings/core/v8/script_promise_property.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" +#include "third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h" #include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h" #include "third_party/blink/renderer/platform/wtf/text/atomic_string.h" namespace blink { +class ScriptState; class ScriptValue; class TaskQueue; class V8Function; @@ -26,7 +30,8 @@ // Task IDL Interface. AtomicString priority() const; AtomicString status() const; - void cancel(); + void cancel(ScriptState*); + ScriptPromise result(ScriptState*); // Set the TaskHandle associated with this task, which is used for // cancellation. @@ -56,6 +61,8 @@ }; void SetTaskStatus(Status); + void InvokeInternal(ScriptState*); + void ResolveOrRejectPromiseIfNeeded(ScriptState*); static bool IsValidStatusChange(Status from, Status to); static AtomicString TaskStatusToString(Status); @@ -65,6 +72,13 @@ Member<TaskQueue> task_queue_; Member<V8Function> callback_; Vector<ScriptValue> arguments_; + + using TaskResultPromise = + ScriptPromiseProperty<Member<Task>, ScriptValue, ScriptValue>; + Member<TaskResultPromise> result_promise_; + + TraceWrapperV8Reference<v8::Value> result_value_; + TraceWrapperV8Reference<v8::Value> exception_; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/scheduler/task.idl b/third_party/blink/renderer/modules/scheduler/task.idl index 62d2a1f..87baeb41 100644 --- a/third_party/blink/renderer/modules/scheduler/task.idl +++ b/third_party/blink/renderer/modules/scheduler/task.idl
@@ -9,5 +9,6 @@ [RuntimeEnabled=WebScheduler] interface Task { readonly attribute TaskStatus status; readonly attribute TaskQueuePriority priority; - void cancel(); + [CallWith=ScriptState] readonly attribute Promise<any> result; + [CallWith=ScriptState] void cancel(); };
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer_source_node.cc b/third_party/blink/renderer/modules/webaudio/audio_buffer_source_node.cc index 2a615a8..8a43780 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_buffer_source_node.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_buffer_source_node.cc
@@ -624,6 +624,18 @@ void AudioBufferSourceHandler::HandleStoppableSourceNode() { DCHECK(Context()->IsAudioThread()); + // If the source node has been scheduled to stop, we can stop the node once + // the current time reaches that value. Usually, + // AudioScheduledSourceHandler::UpdateSchedulingInfo handles stopped nodes, + // but we can get here if the node is stopped and then disconnected. Then + // UpdateSchedulingInfo never gets a chance to finish the node. + + if (end_time_ != AudioScheduledSourceHandler::kUnknownTime && + Context()->currentTime() > end_time_) { + Finish(); + return; + } + // If the source node is not looping, and we have a buffer, we can determine // when the source would stop playing. This is intended to handle the // (uncommon) scenario where start() has been called but is never connected to
diff --git a/third_party/blink/renderer/modules/webaudio/audio_node.cc b/third_party/blink/renderer/modules/webaudio/audio_node.cc index c04d9c5d..4845a10 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_node.cc +++ b/third_party/blink/renderer/modules/webaudio/audio_node.cc
@@ -445,6 +445,14 @@ // so assert that this needs graph ownership too. deferred_task_handler_->AssertGraphOwner(); +#if DEBUG_AUDIONODE_REFERENCES > 1 + fprintf(stderr, + "[%16p]: %16p: %2d: DisableOutputsIfNecessary is_disabled %d count %d" + " tail %d\n", + Context(), this, GetNodeType(), is_disabled_, connection_ref_count_, + RequiresTailProcessing()); +#endif + // Disable outputs if appropriate. We do this if the number of connections is // 0 or 1. The case of 0 is from deref() where there are no connections left. // The case of 1 is from AudioNodeInput::disable() where we want to disable
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index 80c07cf..f985824f 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1912,9 +1912,6 @@ # Required by some image decoder tests. "image-decoders/testing/", "//third_party/blink/web_tests/images/resources/", - - # Required by some mediastream tests. - "//media/test/data/", ] }
diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc index 4b1f7464b..f79e45f 100644 --- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc +++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
@@ -470,6 +470,10 @@ RuntimeEnabledFeatures::SetWebXREnabled(enable); } +void WebRuntimeFeatures::EnableWebXRAnchors(bool enable) { + RuntimeEnabledFeatures::SetWebXRAnchorsEnabled(enable); +} + void WebRuntimeFeatures::EnableWebXRHitTest(bool enable) { RuntimeEnabledFeatures::SetWebXRHitTestEnabled(enable); }
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 9d57a160..5002d9a 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1766,6 +1766,10 @@ status: "experimental", }, { + name: "WebXRAnchors", + // depends_on: ["WebXR"], // TODO(https://crbug.com/954679): uncomment once bug is fixed + }, + { name: "WebXRHitTest", // depends_on: ["WebXR"], // TODO(https://crbug.com/954679): uncomment once bug is fixed status: "experimental"
diff --git a/third_party/blink/web_tests/FlagExpectations/disable-blink-features=LayoutNG b/third_party/blink/web_tests/FlagExpectations/disable-blink-features=LayoutNG index 54fe2a6..600b724 100644 --- a/third_party/blink/web_tests/FlagExpectations/disable-blink-features=LayoutNG +++ b/third_party/blink/web_tests/FlagExpectations/disable-blink-features=LayoutNG
@@ -300,3 +300,8 @@ crbug.com/591099 virtual/disable-blink-gen-property-trees/paint/invalidation/scroll/sticky/invalidate-after-composited-scroll-with-sticky.html [ Failure ] crbug.com/591099 external/wpt/css/css-flexbox/percentage-heights-006.html [ Failure ] + +# These would need a rebaseline back from LayoutNGBlockFlow to LayoutBlockFlow +crbug.com/591099 compositing/overflow/scroll-parent-absolute-with-backdrop-filter.html [ Failure ] +crbug.com/591099 virtual/disable-blink-gen-property-trees/compositing/overflow/scroll-parent-absolute-with-backdrop-filter.html [ Failure ] +crbug.com/591099 virtual/prefer_compositing_to_lcd_text/compositing/overflow/scroll-parent-absolute-with-backdrop-filter.html [ Failure ] \ No newline at end of file
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 3c212ef..508b379 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -3331,6 +3331,12 @@ crbug.com/991295 external/wpt/web-animations/timing-model/timelines/document-timelines.html [ Pass Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 [ Win7 ] external/wpt/referrer-policy/origin-when-cross-origin/meta-referrer/same-origin/http-http/img-tag/keep-origin-redirect/same-origin-insecure.http.html [ Timeout ] +crbug.com/626703 [ Win7 ] external/wpt/referrer-policy/unset-referrer-policy/http-rp/same-origin/http-http/img-tag/swap-origin-redirect/insecure-protocol.http.html [ Timeout ] +crbug.com/626703 [ Win7 ] external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/img-tag/no-redirect/generic.http.html [ Timeout ] +crbug.com/626703 [ Win7 ] external/wpt/referrer-policy/unsafe-url/attr-referrer/cross-origin/http-http/img-tag/swap-origin-redirect/generic.http.html [ Timeout ] +crbug.com/626703 [ Win7 ] virtual/blink-cors/external/wpt/referrer-policy/unsafe-url/http-rp/cross-origin/http-http/img-tag/keep-origin-redirect/generic.http.html [ Timeout ] +crbug.com/626703 [ Win7 ] external/wpt/referrer-policy/origin-when-cross-origin/attr-referrer/same-origin/http-http/img-tag/no-redirect/same-origin-insecure.http.html [ Timeout ] crbug.com/626703 [ Linux ] external/wpt/css/css-text-decor/text-decoration-shorthands-002.html [ Failure ] crbug.com/626703 [ Mac ] external/wpt/css/css-text-decor/text-decoration-shorthands-002.html [ Failure ] crbug.com/626703 [ Win ] external/wpt/css/css-text-decor/text-decoration-shorthands-002.html [ Failure ]
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 2a262f9..db4a255 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -1061,6 +1061,11 @@ "args": ["--enable-blink-features=ForcedColors"] }, { + "prefix": "forced-colors", + "base": "fast/css/forced-colors-mode", + "args": ["--force-high-contrast", "--enable-blink-features=ForcedColors"] + }, + { "prefix": "force-defer-script", "base": "defer-script", "args": ["--enable-blink-features=ForceDeferScriptIntervention"]
diff --git a/third_party/blink/web_tests/WPTOverrideExpectations b/third_party/blink/web_tests/WPTOverrideExpectations index 97bdfbe..ecc0e68 100644 --- a/third_party/blink/web_tests/WPTOverrideExpectations +++ b/third_party/blink/web_tests/WPTOverrideExpectations
@@ -600,7 +600,7 @@ crbug.com/lpz external/wpt/css/cssom-view/cssom-getBoxQuads-001.html [ Failure ] crbug.com/lpz external/wpt/css/cssom-view/elementFromPosition.html [ Failure ] crbug.com/lpz external/wpt/css/cssom-view/interfaces.html [ Failure ] -crbug.com/lpz external/wpt/css/cssom-view/scroll-behavior-smooth.html [ Failure ] +crbug.com/lpz external/wpt/css/cssom-view/scroll-behavior-smooth.html [ Failure Timeout ] crbug.com/lpz external/wpt/css/cssom-view/scrollIntoView-horizontal-tb-writing-mode-and-rtl-direction.html [ Failure ] crbug.com/lpz external/wpt/css/cssom-view/scrollIntoView-sideways-lr-writing-mode.html [ Failure ] crbug.com/lpz external/wpt/css/cssom-view/scrollIntoView-sideways-rl-writing-mode.html [ Failure ]
diff --git a/third_party/blink/web_tests/compositing/overflow/scroll-parent-absolute-with-backdrop-filter-expected.txt b/third_party/blink/web_tests/compositing/overflow/scroll-parent-absolute-with-backdrop-filter-expected.txt index 8471887..3118bf4 100644 --- a/third_party/blink/web_tests/compositing/overflow/scroll-parent-absolute-with-backdrop-filter-expected.txt +++ b/third_party/blink/web_tests/compositing/overflow/scroll-parent-absolute-with-backdrop-filter-expected.txt
@@ -18,7 +18,7 @@ "backgroundColor": "#FFFFFF" }, { - "name": "LayoutBlockFlow DIV id='top'", + "name": "LayoutNGBlockFlow DIV id='top'", "position": [8, 8], "bounds": [500, 500] }, @@ -34,28 +34,22 @@ "bounds": [485, 5000] }, { - "name": "LayoutBlockFlow (positioned) DIV id='middle'", + "name": "Squashing Containment Layer", "position": [8, 8], - "bounds": [400, 400], - "contentsOpaque": true, - "backgroundColor": "#008000", - "hasClipParent": true + "drawsContent": false }, { - "name": "LayoutBlockFlow (relative positioned) DIV id='child'", + "name": "LayoutNGBlockFlow (relative positioned) DIV id='child'", "position": [8, 8], "bounds": [300, 300], "contentsOpaque": true, "backfaceVisibility": "hidden", - "backgroundColor": "#FFFF00", - "hasClipParent": true + "backgroundColor": "#FFFF00" }, { - "name": "LayoutBlockFlow (relative positioned) DIV id='tall'", + "name": "Squashing Layer (first squashed layer: LayoutNGBlockFlow (relative positioned) DIV id='tall')", "position": [8, 8], - "bounds": [20, 5000], - "contentsOpaque": true, - "backgroundColor": "#FA8072" + "bounds": [20, 5000] }, { "name": "Overflow Controls Host Layer",
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json index 199d6921..0ef218a 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_6.json
@@ -321868,7 +321868,7 @@ "testharness" ], "animation-worklet/idlharness.any-expected.txt": [ - "2aa4f5b7f0e8849abd7a704982c3e4ea6ac8a5cb", + "f21be8b3774defb29745b68ef3890856a0cf277e", "support" ], "animation-worklet/idlharness.any.js": [ @@ -321876,7 +321876,7 @@ "testharness" ], "animation-worklet/idlharness.any.worker-expected.txt": [ - "a4793b0d2fdb50a005ec781b201f86ed70e2e187", + "910bda1d8173359a021ea0fbec68d59cb0324162", "support" ], "animation-worklet/inactive-timeline.https.html": [ @@ -414296,7 +414296,7 @@ "testharness" ], "dom/interfaces_exclude=Node-expected.txt": [ - "e5d121860dcb77cc0fc0f8cb9c18ffbc5edc8986", + "245b81e582834f14017a77012e65015e3b98c131", "support" ], "dom/lists/DOMTokenList-Iterable.html": [ @@ -444480,7 +444480,7 @@ "support" ], "interfaces/animation-worklet.idl": [ - "615a21c76fd1f59910ba5867d4de097e6ecd917e", + "02deca73a3a3378c9906776d547a37b7c31e0fb5", "support" ], "interfaces/appmanifest.idl": [ @@ -444604,7 +444604,7 @@ "support" ], "interfaces/dom.idl": [ - "1788faae5207bb7a21b23771bf2b0e978ea49a69", + "9da68c4b7f82c5fc1cea6076884cfd00c4e36e6c", "support" ], "interfaces/element-timing.idl": [ @@ -444944,7 +444944,7 @@ "support" ], "interfaces/web-nfc.idl": [ - "d5fe1c085a2e3a127211c48cca97feb2410349a9", + "769eb7dd2f514d8c3e26b355b851588740ee63ee", "support" ], "interfaces/web-share.idl": [
diff --git a/third_party/blink/web_tests/external/wpt/animation-worklet/idlharness.any-expected.txt b/third_party/blink/web_tests/external/wpt/animation-worklet/idlharness.any-expected.txt index 2aa4f5b7..f21be8b 100644 --- a/third_party/blink/web_tests/external/wpt/animation-worklet/idlharness.any-expected.txt +++ b/third_party/blink/web_tests/external/wpt/animation-worklet/idlharness.any-expected.txt
@@ -2,9 +2,8 @@ PASS idl_test setup PASS Partial namespace CSS: original namespace defined PASS Partial namespace CSS: valid exposure set -PASS Partial interface AnimationEffect: original interface defined -FAIL Partial interface AnimationEffect: valid exposure set Partial AnimationEffect interface is exposed to 'AnimationWorklet', the original interface is not. PASS AnimationWorkletGlobalScope interface: existence and properties of interface object +PASS WorkletAnimationEffect interface: existence and properties of interface object FAIL WorkletAnimation interface: existence and properties of interface object assert_equals: prototype of WorkletAnimation is not Animation expected function "function Animation() { [native code] }" but got function "function () { [native code] }" FAIL WorkletAnimation interface object length assert_equals: wrong value for WorkletAnimation.length expected 1 but got 2 PASS WorkletAnimation interface object name @@ -17,7 +16,6 @@ FAIL WorkletAnimation interface: new WorkletAnimation("name") must inherit property "animatorName" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Failed to construct 'WorkletAnimation': 2 arguments required, but only 1 present." PASS WorkletGroupEffect interface: existence and properties of interface object PASS WorkletGlobalScope interface: existence and properties of interface object -PASS AnimationEffect interface: member localTime PASS CSS namespace: operation escape(CSSOMString) FAIL CSS namespace: attribute animationWorklet assert_own_property: CSS does not have property "animationWorklet" expected property "animationWorklet" missing Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/animation-worklet/idlharness.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/animation-worklet/idlharness.any.worker-expected.txt index a4793b0d..910bda1 100644 --- a/third_party/blink/web_tests/external/wpt/animation-worklet/idlharness.any.worker-expected.txt +++ b/third_party/blink/web_tests/external/wpt/animation-worklet/idlharness.any.worker-expected.txt
@@ -2,9 +2,8 @@ PASS idl_test setup PASS Partial namespace CSS: original namespace defined PASS Partial namespace CSS: valid exposure set -PASS Partial interface AnimationEffect: original interface defined -FAIL Partial interface AnimationEffect: valid exposure set Partial AnimationEffect interface is exposed to 'AnimationWorklet', the original interface is not. PASS AnimationWorkletGlobalScope interface: existence and properties of interface object +PASS WorkletAnimationEffect interface: existence and properties of interface object PASS WorkletAnimation interface: existence and properties of interface object FAIL WorkletAnimation must be primary interface of new WorkletAnimation("name") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WorkletAnimation is not defined" FAIL Stringification of new WorkletAnimation("name") assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: WorkletAnimation is not defined" @@ -13,7 +12,6 @@ PASS WorkletGlobalScope interface: existence and properties of interface object PASS Worklet interface: existence and properties of interface object PASS Animation interface: existence and properties of interface object -PASS AnimationEffect interface: existence and properties of interface object FAIL CSS namespace: operation escape(CSSOMString) Cannot read property 'hasOwnProperty' of undefined FAIL CSS namespace: attribute animationWorklet Cannot read property 'hasOwnProperty' of undefined Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/backdrop-filter-containing-block-ref.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/backdrop-filter-containing-block-ref.html new file mode 100644 index 0000000..f429dd9a --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/backdrop-filter-containing-block-ref.html
@@ -0,0 +1,37 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>backdrop-filter: Forms a containing block for fixed/absolute</title> +<link rel="author" title="Mason Freed" href="mailto:masonfreed@chromium.org"> + + + +<p>Expected: one green square and one red square, both 200px by 200px.</p> +<div class="container"> + <div class="fixed-child"></div> + <div class="absolute-child"></div> +</div> + +<style> +.container { + width: 200px; + will-change: transform; +} + +.fixed-child { + position: fixed; + top: 0; + background-color: green; + width: 200px; + height: 200px; +} + +.absolute-child { + position: absolute; + top: 0; + left: 210px; + background-color: red; + width: 200px; + height: 200px; +} +</style> +
diff --git a/third_party/blink/web_tests/external/wpt/css/filter-effects/backdrop-filter-containing-block.html b/third_party/blink/web_tests/external/wpt/css/filter-effects/backdrop-filter-containing-block.html new file mode 100644 index 0000000..7300d7d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/filter-effects/backdrop-filter-containing-block.html
@@ -0,0 +1,37 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>backdrop-filter: Forms a containing block for fixed/absolute</title> +<link rel="author" title="Mason Freed" href="mailto:masonfreed@chromium.org"> +<link rel="help" href="https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty"> +<link rel="match" href="backdrop-filter-containing-block-ref.html"> + +<p>Expected: one green square and one red square, both 200px by 200px.</p> +<div class="container"> + <div class="fixed-child"></div> + <div class="absolute-child"></div> +</div> + +<style> +.container { + width: 200px; + backdrop-filter: invert(1); +} + +.fixed-child { + position: fixed; + top: 0; + background-color: green; + width: 100%; + height: 200px; +} + +.absolute-child { + position: absolute; + top: 0; + left: 210px; + background-color: red; + width: 100%; + height: 200px; +} +</style> +
diff --git a/third_party/blink/web_tests/external/wpt/dom/interfaces_exclude=Node-expected.txt b/third_party/blink/web_tests/external/wpt/dom/interfaces_exclude=Node-expected.txt index e5d1218..245b81e 100644 --- a/third_party/blink/web_tests/external/wpt/dom/interfaces_exclude=Node-expected.txt +++ b/third_party/blink/web_tests/external/wpt/dom/interfaces_exclude=Node-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 1104 tests; 1080 PASS, 24 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 1104 tests; 1079 PASS, 25 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Test driver PASS Partial interface Window: original interface defined PASS Event interface: existence and properties of interface object @@ -535,7 +535,7 @@ PASS Element interface: operation setAttributeNode(Attr) PASS Element interface: operation setAttributeNodeNS(Attr) PASS Element interface: operation removeAttributeNode(Attr) -PASS Element interface: operation attachShadow(ShadowRootInit) +FAIL Element interface: operation attachShadow(ShadowRootInit) assert_equals: property has wrong .length expected 0 but got 1 PASS Element interface: attribute shadowRoot PASS Element interface: operation closest(DOMString) PASS Element interface: operation matches(DOMString)
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/animation-worklet.idl b/third_party/blink/web_tests/external/wpt/interfaces/animation-worklet.idl index 615a21c..02deca73 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/animation-worklet.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/animation-worklet.idl
@@ -15,6 +15,13 @@ callback AnimatorInstanceConstructor = any (any options, optional any state); +[ Exposed=AnimationWorklet ] +interface WorkletAnimationEffect { + EffectTiming getTiming(); + ComputedEffectTiming getComputedTiming(); + attribute double? localTime; +}; + [Exposed=Window, Constructor (DOMString animatorName, optional (AnimationEffect or sequence<AnimationEffect>)? effects = null, @@ -26,11 +33,5 @@ [Exposed=AnimationWorklet] interface WorkletGroupEffect { - sequence<AnimationEffect> getChildren(); -}; - -[Exposed=AnimationWorklet] -partial interface AnimationEffect { - // Intended for use inside Animation Worklet scope to drive the effect. - attribute double localTime; + sequence<WorkletAnimationEffect> getChildren(); };
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/dom.idl b/third_party/blink/web_tests/external/wpt/interfaces/dom.idl index 1788faae..9da68c4 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/dom.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/dom.idl
@@ -3,7 +3,7 @@ // (https://github.com/tidoust/reffy-reports) // Source: DOM Standard (https://dom.spec.whatwg.org/) -[Constructor(DOMString type, optional EventInit eventInitDict), +[Constructor(DOMString type, optional EventInit eventInitDict = {}), Exposed=(Window,Worker,AudioWorklet)] interface Event { readonly attribute DOMString type; @@ -45,7 +45,7 @@ [Replaceable] readonly attribute any event; // historical }; -[Constructor(DOMString type, optional CustomEventInit eventInitDict), +[Constructor(DOMString type, optional CustomEventInit eventInitDict = {}), Exposed=(Window,Worker)] interface CustomEvent : Event { readonly attribute any detail; @@ -60,8 +60,8 @@ [Constructor, Exposed=(Window,Worker,AudioWorklet)] interface EventTarget { - void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options); - void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options); + void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options = {}); + void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options = {}); boolean dispatchEvent(Event event); }; @@ -158,7 +158,7 @@ [Constructor(MutationCallback callback), Exposed=Window] interface MutationObserver { - void observe(Node target, optional MutationObserverInit options); + void observe(Node target, optional MutationObserverInit options = {}); void disconnect(); sequence<MutationRecord> takeRecords(); }; @@ -209,7 +209,7 @@ readonly attribute boolean isConnected; readonly attribute Document? ownerDocument; - Node getRootNode(optional GetRootNodeOptions options); + Node getRootNode(optional GetRootNodeOptions options = {}); readonly attribute Node? parentNode; readonly attribute Element? parentElement; boolean hasChildNodes(); @@ -269,8 +269,8 @@ HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); - [CEReactions, NewObject] Element createElement(DOMString localName, optional (DOMString or ElementCreationOptions) options); - [CEReactions, NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional (DOMString or ElementCreationOptions) options); + [CEReactions, NewObject] Element createElement(DOMString localName, optional (DOMString or ElementCreationOptions) options = {}); + [CEReactions, NewObject] Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional (DOMString or ElementCreationOptions) options = {}); [NewObject] DocumentFragment createDocumentFragment(); [NewObject] Text createTextNode(DOMString data); [NewObject] CDATASection createCDATASection(DOMString data); @@ -359,7 +359,7 @@ [CEReactions] Attr? setAttributeNodeNS(Attr attr); [CEReactions] Attr removeAttributeNode(Attr attr); - ShadowRoot attachShadow(ShadowRootInit init); + ShadowRoot attachShadow(optional ShadowRootInit init = {}); readonly attribute ShadowRoot? shadowRoot; Element? closest(DOMString selectors);
diff --git a/third_party/blink/web_tests/external/wpt/interfaces/web-nfc.idl b/third_party/blink/web_tests/external/wpt/interfaces/web-nfc.idl index d5fe1c0..769eb7d 100644 --- a/third_party/blink/web_tests/external/wpt/interfaces/web-nfc.idl +++ b/third_party/blink/web_tests/external/wpt/interfaces/web-nfc.idl
@@ -14,7 +14,7 @@ sequence<NDEFRecordInit> records; }; -typedef (DOMString or unrestricted double or ArrayBuffer or object) NDEFRecordData; +typedef any NDEFRecordData; [Constructor(NDEFRecordInit recordInit), Exposed=Window] interface NDEFRecord {
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-01-expected.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-01-expected.html new file mode 100644 index 0000000..d04c1bc0 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-01-expected.html
@@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<head> +<style type="text/css"> + table { + border-collapse: collapse; + } + + td, th { + border: 1px solid; + border-bottom-color: black; + border-left-color: purple; + border-right-color: orange; + border-top-color: green; + padding: 8px; + text-align: left; + } + + tr:nth-child(even) { + background-color: blue; + color: red; + } +</style> +</head> +<body> + <table> + <tr> + <th>Column1</th> + <th>Column2</th> + <th>Column3</th> + </tr> + <tr> + <td>Entry1</td> + <td>Entry1</td> + <td>Entry1</td> + </tr> + <tr> + <td>Entry2</td> + <td>Entry2</td> + <td>Entry2</td> + </tr> + </table> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-01.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-01.html new file mode 100644 index 0000000..c53078a --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-01.html
@@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html> +<title>Test forced colors mode on table styles</title> +<link rel=match href=forced-colors-mode-01-expected.html> +<style type="text/css"> + table { + border-collapse: collapse; + } + + td, th { + border: 1px solid; + border-bottom-color: black; + border-left-color: purple; + border-right-color: orange; + border-top-color: green; + padding: 8px; + text-align: left; + } + + tr:nth-child(even) { + background-color: blue; + color: red; + } +</style> + +<body> + <table> + <tr> + <th>Column1</th> + <th>Column2</th> + <th>Column3</th> + </tr> + <tr> + <td>Entry1</td> + <td>Entry1</td> + <td>Entry1</td> + </tr> + <tr> + <td>Entry2</td> + <td>Entry2</td> + <td>Entry2</td> + </tr> + </table> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-02-expected.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-02-expected.html new file mode 100644 index 0000000..8705bd2 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-02-expected.html
@@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html> +<head> +<style type="text/css"> + body { + background-color: lightblue; + } + #a { + background-color: lightgreen; + border: 25px solid green; + box-shadow: 2px 2px purple; + color: orange; + forced-color-adjust: auto; + margin: 25px; + padding: 25px; + text-shadow: 1px 1px gray; + width: 300px; + } + #b { + background-color: lightgreen; + border: 25px solid green; + box-shadow: 2px 2px purple; + color: orange; + forced-color-adjust: none; + margin: 25px; + padding: 25px; + text-shadow: 1px 1px gray; + width: 300px; + } +</style> +</head> +<body> + <div id="a"> + The colors and shadows of this text and text box should be overridden when in + forced colors mode (forced-color-adjust is set to auto.) + </div> + <div id="b"> + The colors and shadows of this text and text box should NOT be overridden when in + forced colors mode (forced-color-adjust is set to none.) + </div> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-02.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-02.html new file mode 100644 index 0000000..e7cfcd5c --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-02.html
@@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<head> +<title>Forced colors mode - style overrides for text.</title> +<link rel=match href=forced-colors-mode-02-expected.html> +<style type="text/css"> + body { + background-color: lightblue; + } + #a { + background-color: lightgreen; + border: 25px solid green; + box-shadow: 2px 2px purple; + color: orange; + forced-color-adjust: auto; + margin: 25px; + padding: 25px; + text-shadow: 1px 1px gray; + width: 300px; + } + #b { + background-color: lightgreen; + border: 25px solid green; + box-shadow: 2px 2px purple; + color: orange; + forced-color-adjust: none; + margin: 25px; + padding: 25px; + text-shadow: 1px 1px gray; + width: 300px; + } +</style> +</head> +<body> + <div id="a"> + The colors and shadows of this text and text box should be overridden when in + forced colors mode (forced-color-adjust is set to auto.) + </div> + <div id="b"> + The colors and shadows of this text and text box should NOT be overridden when in + forced colors mode (forced-color-adjust is set to none.) + </div> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-03-expected.txt b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-03-expected.txt new file mode 100644 index 0000000..5c7aaedd --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-03-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Checks that default highlighted text style does not get overridden in forced colors mode. assert_equals: expected "rgb(0, 0, 0)" but got "rgb(255, 165, 0)" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-03.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-03.html new file mode 100644 index 0000000..3eab7297 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-03.html
@@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<head> +<title>Forced colors mode - highlighted text.</title> +<style type="text/css"> + #a { + color: orange; + forced-color-adjust: auto; + } + #b { + color: orange; + forced-color-adjust: none; + } +</style> +</head> +<body> + <mark id="a"> + This text should be black in forced colors mode because forced-color-adjust + is auto. The backgroud color should be yellow because the default + highlighted colors should not be overridden in forced colors mode. + </mark> + <mark id="b"> + This text should be orange in forced colors mode because + forced-color-adjust is none. The backgroud color should be yellow because + the default highlighted colors should not be overridden in forced colors + mode. + </mark> +</body> + +<script src="../../../resources/testharness.js"></script> +<script src="../../../resources/testharnessreport.js"></script> +<script> + test(function(){ + assert_equals(getComputedStyle(a).color, "rgb(0, 0, 0)"); + + assert_equals(getComputedStyle(b).color, "rgb(255, 165, 0)"); + + assert_equals(getComputedStyle(a).backgroundColor, "rgb(255, 255, 0)"); + + assert_equals(getComputedStyle(b).backgroundColor, "rgb(255, 255, 0)"); + + }, "Checks that default highlighted text style does not get overridden in forced colors mode."); +</script> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-04-expected.txt b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-04-expected.txt new file mode 100644 index 0000000..5f26c685 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-04-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Checks hyperlinks are overridden in forced colors mode. assert_equals: expected "rgba(0, 0, 0, 0.18)" but got "rgb(0, 0, 255)" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-04.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-04.html new file mode 100644 index 0000000..368bead --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-04.html
@@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> +<head> +<title>Forced colors mode - webkit-tap-highlight-color.</title> +<style type="text/css"> + a { + -webkit-tap-highlight-color: rgb(0, 0, 255); + } +</style> +</head> +<body> + <p> + <a href="https://www.wikipedia.org" id="link"> + This link color should be overridden when forced colors mode is enabled. + </a> + </p> +</body> + +<script src="../../../resources/testharness.js"></script> +<script src="../../../resources/testharnessreport.js"></script> +<script> + test(function(){ + assert_equals(getComputedStyle(link).webkitTapHighlightColor, "rgba(0, 0, 0, 0.18)"); + }, "Checks hyperlinks are overridden in forced colors mode."); +</script> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-05-expected.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-05-expected.html new file mode 100644 index 0000000..18fbc57 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-05-expected.html
@@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html> +<head> +<style type="text/css"> + a { + color: rgb(255, 0, 0); + } +</style> +</head> +<body> + <p> + <a href="https://www.wikipedia.org" id="link"> + This link color should be overridden when forced colors mode is enabled. + </a> + </p> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-05.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-05.html new file mode 100644 index 0000000..93fff5d --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-05.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<title>Forced colors mode - link color.</title> +<link rel=match href=forced-colors-mode-05-expected.html> +<style type="text/css"> + a { + color: rgb(255, 0, 0); + } +</style> +</head> +<body> + <p> + <a href="https://www.wikipedia.org" id="link"> + This link color should be overridden when forced colors mode is enabled. + </a> + </p> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-06-expected.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-06-expected.html new file mode 100644 index 0000000..ee78fcb --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-06-expected.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> +<head> +<body> + <iframe src="forced-colors-mode-02-expected.html" width="500" height="500"></iframe> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-06.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-06.html new file mode 100644 index 0000000..7a2dd29e --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-06.html
@@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> +<head> +<title>Forced colors mode - iframe. + Test that styles are overridden inside iframes in forced colors mode. +</title> +<link rel=match href=forced-colors-mode-06-expected.html> +<body> + <iframe src="forced-colors-mode-02.html" width="500" height="500"></iframe> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-07-expected.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-07-expected.html new file mode 100644 index 0000000..15623ae8 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-07-expected.html
@@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html> +<head> +<style> + p { + color: transparent; + } +</style> +<body> + <div style="background-color: rgb(0, 0, 255);"> + <p> + The text color should be overridden, and the background color of the + div element should also be overridden in forced colors mode. + </p> + </div> + <div style="background-color: transparent;"> + <p> + The text color should be overridden, but the background color of the + div element should remain transparent in forced colors mode. + </p> + </div> + <div style="background-color: rgba(0, 0, 0, 0);"> + <p> + The text color should be overridden, but the background color of the + div element should remain transparent in forced colors mode. + </p> + </div> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-07.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-07.html new file mode 100644 index 0000000..b111479 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-07.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> +<head> +<title>Forced colors mode - transparent colors.</title> +<link rel=match href=forced-colors-mode-07-expected.html> +<style> + p { + color: transparent; + } +</style> +<body> + <div style="background-color: rgb(0, 0, 255);"> + <p> + The text color should be overridden, and the background color of the + div element should also be overridden in forced colors mode. + </p> + </div> + <div style="background-color: transparent;"> + <p> + The text color should be overridden, but the background color of the + div element should remain transparent in forced colors mode. + </p> + </div> + <div style="background-color: rgba(0, 0, 0, 0);"> + <p> + The text color should be overridden, but the background color of the + div element should remain transparent in forced colors mode. + </p> + </div> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-08-expected.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-08-expected.html new file mode 100644 index 0000000..c9e55d4 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-08-expected.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> +<head> +<style> + h1 { + outline-color: rgb(0, 0, 255); + outline-style: solid; + -webkit-column-count: 3; + -webkit-column-gap: 40px; + -webkit-column-rule-color: rgb(0, 0, 255); + -webkit-column-rule-style: solid; + } +</style> +</head> +<body> + <h1> + The outline-color and column-rule-color should be blue when forced colors + mode is off and WindowText in forced colors mode. + </h1> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-08.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-08.html new file mode 100644 index 0000000..133f09ab --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-08.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<title>Forced colors mode - outline and column color.</title> +<link rel=match href=forced-colors-mode-08-expected.html> +<style> + h1 { + outline-color: rgb(0, 0, 255); + outline-style: solid; + -webkit-column-count: 3; + -webkit-column-gap: 40px; + -webkit-column-rule-color: rgb(0, 0, 255); + -webkit-column-rule-style: solid; + } +</style> +</head> +<body> + <h1> + The outline-color and column-rule-color should be blue when forced colors + mode is off and WindowText in forced colors mode. + </h1> +</body> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-09-expected.txt b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-09-expected.txt new file mode 100644 index 0000000..c13cecb --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-09-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Checks that styles defined inside/outside forced-colors are overridden in forced colors mode. assert_not_equals: got disallowed value "rgb(0, 0, 255)" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-09.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-09.html new file mode 100644 index 0000000..29b1a88 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-09.html
@@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> +<title> + Forced colors mode - forced-colors media query. + Tests that styles defined inside or outside a forced-colors media query are + overridden in forced colors mode. +</title> +<style type="text/css"> + @media (forced-colors) { + p { + color: rgb(0, 0, 255); + } + } + p { + color: rgb(0, 0, 255); + } +</style> +</head> +<body> + <p id="p"> + This text should NOT be blue forced colors mode. + </p> +</body> + +<script src="../../../resources/testharness.js"></script> +<script src="../../../resources/testharnessreport.js"></script> +<script> + test(function() { + assert_not_equals(getComputedStyle(p).color, "rgb(0, 0, 255)"); + }, "Checks that styles defined inside/outside forced-colors are overridden in forced colors mode."); + </script> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-10-expected.txt b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-10-expected.txt new file mode 100644 index 0000000..dfa26792a --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-10-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Checks that styles defined inside/outside forced-colors are preserved in forced colors mode if forced-color-ajust is none. assert_equals: expected "rgb(0, 0, 255)" but got "rgb(0, 128, 0)" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-10.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-10.html new file mode 100644 index 0000000..3d5dca9d --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-10.html
@@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html> +<head> +<title> + Forced colors mode - forced-colors media query. + Tests that styles defined inside/outside forced-color media query + are preserved in forced colors mode if forced-color-adjust is none + and that the ordering of styles is preserved. +</title> +<style type="text/css"> + p { + background-color: rgb(0, 128, 0); + color: rgb(0, 0, 255); + forced-color-adjust: none; + } + @media (forced-colors) { + p { + background-color: rgb(0, 0, 255); + color: rgb(0, 128, 0); + } + } +</style> +</head> +<body> + <p id="p"> + This text should be green in forced colors mode. + </p> +</body> + +<script src="../../../resources/testharness.js"></script> +<script src="../../../resources/testharnessreport.js"></script> +<script> + test(function() { + assert_equals(getComputedStyle(p).backgroundColor, "rgb(0, 0, 255)"); + assert_equals(getComputedStyle(p).color, "rgb(0, 128, 0)"); + }, "Checks that styles defined inside/outside forced-colors are preserved in forced colors mode if forced-color-ajust is none."); + </script> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-11-expected.txt b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-11-expected.txt new file mode 100644 index 0000000..06c5ac4 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-11-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Checks that styles defined in forced-colors are preserved in forced colors mode. assert_equals: expected "rgb(0, 0, 255)" but got "rgba(0, 0, 0, 0)" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-11.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-11.html new file mode 100644 index 0000000..f38baf1 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-11.html
@@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html> +<head> +<title> + Forced colors mode - forced-colors media query. + Tests that styles defined inside forced-color media query + are preserved in forced colors mode if forced-color-adjust + is none. +</title> +<style type="text/css"> + @media (forced-colors: none) { + p { + background-color: rgb(255, 0, 0); + color: rgb(255, 255, 255); + } + } + @media (forced-colors: active) { + p { + background-color: rgb(0, 0, 255); + color: rgb(0, 128, 0); + forced-color-adjust: none; + } + } +</style> +</head> +<body> + <p id="p"> + This text should be green in forced colors mode. + </p> +</body> + +<script src="../../../resources/testharness.js"></script> +<script src="../../../resources/testharnessreport.js"></script> +<script> + test(function() { + assert_equals(getComputedStyle(p).backgroundColor, "rgb(0, 0, 255)"); + assert_equals(getComputedStyle(p).color, "rgb(0, 128, 0)"); + }, "Checks that styles defined in forced-colors are preserved in forced colors mode."); + </script> +</html>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-12-expected.txt b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-12-expected.txt new file mode 100644 index 0000000..5945bee0 --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-12-expected.txt
@@ -0,0 +1,4 @@ +FAIL - "color" property for "box" element at 0s expected: rgb(0, 0, 0) but saw: rgb(255, 0, 0) +FAIL - "color" property for "box" element at 0.5s expected: rgb(0, 0, 0) but saw: rgb(128, 64, 0) +FAIL - "color" property for "box" element at 1s expected: rgb(0, 0, 0) but saw: rgb(255, 0, 0) +
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-12.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-12.html new file mode 100644 index 0000000..16956ca --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-12.html
@@ -0,0 +1,39 @@ +<!DOCTYPE html> +<head> + <title> + Forced colors mode - animations. + Tests that animation colors are overridden in forced colors mode. + </title> + <style type="text/css"> + #forcedtextcolor { + color: WindowText; + forced-color-adjust: none; + } + #box { + animation-duration: 1s; + animation-iteration-count: infinite; + animation-timing-function: linear; + animation-name: anim; + } + @keyframes anim { + from { color: red; } + to { color: green; } + } + </style> +</head> +<body> + <div id="box"></div> + <p id="forcedtextcolor"></p> +</body> + +<script src="../../../animations/resources/animation-test-helpers.js"></script> +<script type="text/javascript" charset="utf-8"> + var textcolor = getComputedStyle(forcedtextcolor).color; + const expectedValues = [ + // [time, element-id, property, expected-value, tolerance] + [0.0, "box", "color", textcolor, 1], + [0.5, "box", "color", textcolor, 1], + [1.0, "box", "color", textcolor, 1], + ]; + runAnimationTest(expectedValues); +</script>
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-13-expected.txt b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-13-expected.txt new file mode 100644 index 0000000..f6555ac --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-13-expected.txt
@@ -0,0 +1,2 @@ +PASS - "color" property for "target" element at 0.5s saw something close to: 128,0,0 +
diff --git a/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-13.html b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-13.html new file mode 100644 index 0000000..a18ef2f --- /dev/null +++ b/third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-13.html
@@ -0,0 +1,33 @@ +<!doctype html> +<title> + Forced colors mode - transitions. + Tests that color transitions work in forced colors mode. + The only way to get transitions to work in forced colors mode is if + forced-color-adjust is none. Otherwise, the color will always be + overridden upon transition, and no transition will actually happen. +</title> +<style> + #target { + color: black; + font-size: 50px; + forced-color-adjust: none; + transition: all 1s linear; + } + + #target.final { color: red; } +</style> +<script src="../../../animations/resources/animation-test-helpers.js" type="text/javascript"></script> +<script> + const expectedValues = [ + // [time, element-id, property, expected-value, tolerance] + [0.5, 'target', 'color', [128, 0, 0], 64] + ]; + + function setupTest() + { + document.getElementById('target').className = 'final'; + } + + runTransitionTest(expectedValues, setupTest); +</script> +<span id="target">filler text</span>
diff --git a/third_party/blink/web_tests/http/tests/devtools/a11y-axe-core/security/security-overview-a11y-test.js b/third_party/blink/web_tests/http/tests/devtools/a11y-axe-core/security/security-overview-a11y-test.js index fe8d2628..837d902f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/a11y-axe-core/security/security-overview-a11y-test.js +++ b/third_party/blink/web_tests/http/tests/devtools/a11y-axe-core/security/security-overview-a11y-test.js
@@ -7,17 +7,7 @@ await TestRunner.loadModule('axe_core_test_runner'); await TestRunner.showPanel('security'); - // Using an insecure request since the insecure overview page encompasses the most elements. - /** @type {!Protocol.Security.InsecureContentStatus} */ - const insecureContentStatus = { - ranMixedContent: false, - displayedMixedContent: false, - ranContentWithCertErrors: false, - displayedContentWithCertErrors: true, - ranInsecureContentStyle: Protocol.Security.SecurityState.Insecure, - displayedInsecureContentStyle: Protocol.Security.SecurityState.Neutral - }; - const pageSecurityState = new Security.PageSecurityState(Protocol.Security.SecurityState.Secure, [], insecureContentStatus, null); + const pageSecurityState = new Security.PageSecurityState(Protocol.Security.SecurityState.Secure, /* explanations= */ [], null); TestRunner.mainTarget.model(Security.SecurityModel).dispatchEventToListeners( Security.SecurityModel.Events.SecurityStateChanged, pageSecurityState);
diff --git a/third_party/blink/web_tests/platform/mac/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-04-expected.txt b/third_party/blink/web_tests/platform/mac/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-04-expected.txt new file mode 100644 index 0000000..29a12151 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-04-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Checks hyperlinks are overridden in forced colors mode. assert_equals: expected "rgba(0, 0, 0, 0.18)" but got "rgba(0, 0, 0, 0.4)" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/virtual/focusless-spat-nav/fast/spatial-navigation/focusless/snav-focusless-fullscreen-video.html b/third_party/blink/web_tests/virtual/focusless-spat-nav/fast/spatial-navigation/focusless/snav-focusless-fullscreen-video.html index 783a3a6..9b031ba 100644 --- a/third_party/blink/web_tests/virtual/focusless-spat-nav/fast/spatial-navigation/focusless/snav-focusless-fullscreen-video.html +++ b/third_party/blink/web_tests/virtual/focusless-spat-nav/fast/spatial-navigation/focusless/snav-focusless-fullscreen-video.html
@@ -29,9 +29,11 @@ await fullscreened; // snav state racily may have changed once or twice when fullscreen state - // changes. Waiting until a rAF after fullscreen changes should give snav - // state time to update properly. - await snav.rAF(); + // changes, so if it hasn't updated in response to video controls getting + // focused yet, wait for the next update. + if (!mockSnavService.hasDefaultVideoControls) { + await snavCallback(); + } assert_equals(window.internals.interestedElement, video, @@ -41,7 +43,7 @@ "Video element should be focused."); assert_true(mockSnavService.canExitFocus, - "Should be able to exit focus."); + "Should be able to exit focus."); assert_true(mockSnavService.canSelectElement, "Should be able to select element."); assert_false(mockSnavService.isFormFocused,
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/README.txt b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/README.txt new file mode 100644 index 0000000..de185c88 --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/README.txt
@@ -0,0 +1 @@ +This directory is for testing Forced Colors mode implementation.
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-01-expected.html b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-01-expected.html new file mode 100644 index 0000000..6abf97ef --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-01-expected.html
@@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html> +<head> +<style type="text/css"> + table { + border-collapse: collapse; + } + + td, th { + border: 1px solid; + border-bottom-color: WindowText; + border-left-color: WindowText; + border-right-color: WindowText; + border-top-color: WindowText; + forced-color-adjust: none; + padding: 8px; + text-align: left; + } + + tr:nth-child(even) { + background-color: transparent; + color: WindowText; + forced-color-adjust: none; + } +</style> +</head> +<body> + <table> + <tr> + <th>Column1</th> + <th>Column2</th> + <th>Column3</th> + </tr> + <tr> + <td>Entry1</td> + <td>Entry1</td> + <td>Entry1</td> + </tr> + <tr> + <td>Entry2</td> + <td>Entry2</td> + <td>Entry2</td> + </tr> + </table> +</body> +</html>
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-02-expected.html b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-02-expected.html new file mode 100644 index 0000000..4ad07fa --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-02-expected.html
@@ -0,0 +1,42 @@ +<!DOCTYPE html> +<html> +<head> +<style type="text/css"> + body { + background-color: lightblue; + } + #a { + background-color: transparent; + border: 25px solid WindowText; + box-shadow: 2px 2px transparent; + color: WindowText; + forced-color-adjust: none; + margin: 25px; + padding: 25px; + text-shadow: 1px 1px transparent; + width: 300px; + } + #b { + background-color: lightgreen; + border: 25px solid green; + box-shadow: 2px 2px purple; + color: orange; + forced-color-adjust: none; + margin: 25px; + padding: 25px; + text-shadow: 1px 1px gray; + width: 300px; + } +</style> +</head> +<body> + <div id="a"> + The colors and shadows of this text and text box should be overridden when in + forced colors mode (forced-color-adjust is set to auto.) + </div> + <div id="b"> + The colors and shadows of this text and text box should NOT be overridden when in + forced colors mode (forced-color-adjust is set to none.) + </div> +</body> +</html>
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-03-expected.txt b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-03-expected.txt new file mode 100644 index 0000000..b497ff01 --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-03-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +PASS Checks that default highlighted text style does not get overridden in forced colors mode. +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-04-expected.txt b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-04-expected.txt new file mode 100644 index 0000000..26a63cd --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-04-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +PASS Checks hyperlinks are overridden in forced colors mode. +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-05-expected.html b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-05-expected.html new file mode 100644 index 0000000..083a735a --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-05-expected.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html> +<head> +<style type="text/css"> + a { + color: LinkText; + forced-color-adjust: none; + } +</style> +</head> +<body> + <p> + <a href="https://www.wikipedia.org" id="link"> + This link color should be overridden when forced colors mode is enabled. + </a> + </p> +</body> +</html>
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-06-expected.html b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-06-expected.html new file mode 100644 index 0000000..ee78fcb --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-06-expected.html
@@ -0,0 +1,7 @@ +<!DOCTYPE html> +<html> +<head> +<body> + <iframe src="forced-colors-mode-02-expected.html" width="500" height="500"></iframe> +</body> +</html>
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-07-expected.html b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-07-expected.html new file mode 100644 index 0000000..a8257c5d --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-07-expected.html
@@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> +<head> +<style> + p { + color: WindowText; + forced-color-adjust: none; + } + div { + forced-color-adjust: none; + } +</style> +<body> + <div style="background-color: transparent;"> + <p> + The text color should be overridden, and the background color of the + div element should also be overridden in forced colors mode. + </p> + </div> + <div style="background-color: transparent;"> + <p> + The text color should be overridden, but the background color of the + div element should remain transparent in forced colors mode. + </p> + </div> + <div style="background-color: rgba(0, 0, 0, 0);"> + <p> + The text color should be overridden, but the background color of the + div element should remain transparent in forced colors mode. + </p> + </div> +</body> +</html>
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-08-expected.html b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-08-expected.html new file mode 100644 index 0000000..b409f80 --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-08-expected.html
@@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<style> + h1 { + forced-color-adjust: none; + outline-color: WindowText; + outline-style: solid; + -webkit-column-count: 3; + -webkit-column-gap: 40px; + -webkit-column-rule-color: WindowText; + -webkit-column-rule-style: solid; + } +</style> +</head> +<body> + <h1> + The outline-color and column-rule-color should be blue when forced colors + mode is off and WindowText in forced colors mode. + </h1> +</body> +</html>
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-09-expected.txt b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-09-expected.txt new file mode 100644 index 0000000..22ecd5d --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-09-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +PASS Checks that styles defined inside/outside forced-colors are overridden in forced colors mode. +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-10-expected.txt b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-10-expected.txt new file mode 100644 index 0000000..cd96b903 --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-10-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +PASS Checks that styles defined inside/outside forced-colors are preserved in forced colors mode if forced-color-ajust is none. +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-11-expected.txt b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-11-expected.txt new file mode 100644 index 0000000..c1a32f8 --- /dev/null +++ b/third_party/blink/web_tests/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-11-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +PASS Checks that styles defined in forced-colors are preserved in forced colors mode. +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/virtual/threaded/external/wpt/animation-worklet/idlharness.any-expected.txt b/third_party/blink/web_tests/virtual/threaded/external/wpt/animation-worklet/idlharness.any-expected.txt deleted file mode 100644 index 2aa4f5b7..0000000 --- a/third_party/blink/web_tests/virtual/threaded/external/wpt/animation-worklet/idlharness.any-expected.txt +++ /dev/null
@@ -1,24 +0,0 @@ -This is a testharness.js-based test. -PASS idl_test setup -PASS Partial namespace CSS: original namespace defined -PASS Partial namespace CSS: valid exposure set -PASS Partial interface AnimationEffect: original interface defined -FAIL Partial interface AnimationEffect: valid exposure set Partial AnimationEffect interface is exposed to 'AnimationWorklet', the original interface is not. -PASS AnimationWorkletGlobalScope interface: existence and properties of interface object -FAIL WorkletAnimation interface: existence and properties of interface object assert_equals: prototype of WorkletAnimation is not Animation expected function "function Animation() { [native code] }" but got function "function () { [native code] }" -FAIL WorkletAnimation interface object length assert_equals: wrong value for WorkletAnimation.length expected 1 but got 2 -PASS WorkletAnimation interface object name -FAIL WorkletAnimation interface: existence and properties of interface prototype object assert_equals: prototype of WorkletAnimation.prototype is not Animation.prototype expected object "[object Animation]" but got object "[object Object]" -PASS WorkletAnimation interface: existence and properties of interface prototype object's "constructor" property -PASS WorkletAnimation interface: existence and properties of interface prototype object's @@unscopables property -PASS WorkletAnimation interface: attribute animatorName -FAIL WorkletAnimation must be primary interface of new WorkletAnimation("name") assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Failed to construct 'WorkletAnimation': 2 arguments required, but only 1 present." -FAIL Stringification of new WorkletAnimation("name") assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Failed to construct 'WorkletAnimation': 2 arguments required, but only 1 present." -FAIL WorkletAnimation interface: new WorkletAnimation("name") must inherit property "animatorName" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Failed to construct 'WorkletAnimation': 2 arguments required, but only 1 present." -PASS WorkletGroupEffect interface: existence and properties of interface object -PASS WorkletGlobalScope interface: existence and properties of interface object -PASS AnimationEffect interface: member localTime -PASS CSS namespace: operation escape(CSSOMString) -FAIL CSS namespace: attribute animationWorklet assert_own_property: CSS does not have property "animationWorklet" expected property "animationWorklet" missing -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt index 4be7677..06ba2ea2 100644 --- a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt +++ b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
@@ -7797,6 +7797,7 @@ interface Task attribute @@toStringTag getter priority + getter result getter status method cancel method constructor
diff --git a/third_party/blink/web_tests/wpt_internal/scheduler/task_result.html b/third_party/blink/web_tests/wpt_internal/scheduler/task_result.html new file mode 100644 index 0000000..c8e1b03 --- /dev/null +++ b/third_party/blink/web_tests/wpt_internal/scheduler/task_result.html
@@ -0,0 +1,50 @@ +<!doctype html> +<title>Scheduling API: Basic Task.result Functionality</title> +<link rel="author" title="Scott Haseley" href="mailto:shaseley@chromium.org"> +<link rel="help" href="https://github.com/WICG/main-thread-scheduling"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<script> +'use strict'; + +async_test(t => { + // Access task.result before the task runs. + (function() { + let task = scheduler.postTask(() => 1234); + task.result.then(t.step_func((res) => { + assert_equals(task.status, 'completed'); + assert_equals(res, 1234); + })); + })(); + + // Canceling a task should cause task.result to be rejected. + (function() { + let task = scheduler.postTask(() => 5678); + task.cancel(); + task.result.then(t.step_func((res) => { + assert_true(false, 'task.result should not be fulfilled when the task is canceled'); + })) + .catch(t.step_func((e) => { + assert_equals(e.name, 'AbortError'); + })); + })(); + + // Access task.result after the task runs. + (function() { + let task = scheduler.postTask(t.step_func(() => { + // This task will run after |task| finishes. + scheduler.postTask(t.step_func(() => { + assert_equals(task.status, 'completed'); + task.result.then(t.step_func((res) => { + assert_equals(res, 'foo'); + t.done(); + })); + })); + return 'foo'; + })); + })(); + +}, 'Test scheduler.result is resolved properly'); + +</script>
diff --git a/third_party/opus/README.chromium b/third_party/opus/README.chromium index d02e51c..254e09a1 100644 --- a/third_party/opus/README.chromium +++ b/third_party/opus/README.chromium
@@ -22,3 +22,5 @@ reverted when updating to v1.3 * Apply https://github.com/xiph/opus/commit/4f4b11c2398e96134dc62ee794bfe33ecd6e9bd2 * Apply https://git.xiph.org/?p=opus.git;a=commit;h=812ae3fb5c589aaafe761b8ebf86bcbbb8f0ed76 +* Fix NEON optimizations overrun buffer due to improper termination condition + (https://chromium-review.googlesource.com/c/chromium/src/+/1746617)
diff --git a/third_party/opus/src/silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c b/third_party/opus/src/silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c index 00a70cb..79f4c94 100644 --- a/third_party/opus/src/silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c +++ b/third_party/opus/src/silk/fixed/arm/warped_autocorrelation_FIX_neon_intr.c
@@ -172,7 +172,7 @@ state_QS_s32x4[ 0 ][ 1 ] = calc_state( state_QS_s32x4[ 0 ][ 1 ], state_QS_s32x4[ 2 ][ 1 ], state_QS_s32x4[ 1 ][ 1 ], warping_Q16_s32x4 ); state_QS_s32x4[ 1 ][ 0 ] = state_QS_s32x4[ 2 ][ 0 ]; state_QS_s32x4[ 1 ][ 1 ] = state_QS_s32x4[ 2 ][ 1 ]; - } while( ++n < ( length + order ) ); + } while( ++n < ( length + order - 3 ) ); in = state; o -= 8; } while( o > 4 );
diff --git a/third_party/zlib/google/BUILD.gn b/third_party/zlib/google/BUILD.gn index efdcfe5..0dee214 100644 --- a/third_party/zlib/google/BUILD.gn +++ b/third_party/zlib/google/BUILD.gn
@@ -26,6 +26,8 @@ sources = [ "compression_utils.cc", "compression_utils.h", + "compression_utils_portable.cc", + "compression_utils_portable.h", ] deps = [ "//base",
diff --git a/third_party/zlib/google/compression_utils.cc b/third_party/zlib/google/compression_utils.cc index a375054..6af42f34 100644 --- a/third_party/zlib/google/compression_utils.cc +++ b/third_party/zlib/google/compression_utils.cc
@@ -4,147 +4,13 @@ #include "third_party/zlib/google/compression_utils.h" -#include <stddef.h> -#include <stdint.h> -#include <stdlib.h> -#include <string.h> - #include "base/bit_cast.h" #include "base/logging.h" #include "base/process/memory.h" #include "base/strings/string_piece.h" #include "base/sys_byteorder.h" -#if defined(USE_SYSTEM_ZLIB) -#include <zlib.h> -#else -#include "third_party/zlib/zlib.h" -#endif - -namespace { - -// The difference in bytes between a zlib header and a gzip header. -const size_t kGzipZlibHeaderDifferenceBytes = 16; - -// Pass an integer greater than the following get a gzip header instead of a -// zlib header when calling deflateInit2() and inflateInit2(). -const int kWindowBitsToGetGzipHeader = 16; - -// This describes the amount of memory zlib uses to compress data. It can go -// from 1 to 9, with 8 being the default. For details, see: -// http://www.zlib.net/manual.html (search for memLevel). -const int kZlibMemoryLevel = 8; - -// This code is taken almost verbatim from third_party/zlib/compress.c. The only -// difference is deflateInit2() is called which sets the window bits to be > 16. -// That causes a gzip header to be emitted rather than a zlib header. -int GzipCompressHelper(Bytef* dest, - uLongf* dest_length, - const Bytef* source, - uLong source_length, - void* (*malloc_fn)(size_t), - void (*free_fn)(void*)) { - z_stream stream; - - stream.next_in = bit_cast<Bytef*>(source); - stream.avail_in = static_cast<uInt>(source_length); - stream.next_out = dest; - stream.avail_out = static_cast<uInt>(*dest_length); - if (static_cast<uLong>(stream.avail_out) != *dest_length) - return Z_BUF_ERROR; - - // Cannot convert capturing lambdas to function pointers directly, hence the - // structure. - struct MallocFreeFunctions { - void* (*malloc_fn)(size_t); - void (*free_fn)(void*); - } malloc_free = {malloc_fn, free_fn}; - - if (malloc_fn) { - DCHECK(free_fn); - auto zalloc = [](void* opaque, uInt items, uInt size) { - return reinterpret_cast<MallocFreeFunctions*>(opaque)->malloc_fn(items * - size); - }; - auto zfree = [](void* opaque, void* address) { - return reinterpret_cast<MallocFreeFunctions*>(opaque)->free_fn(address); - }; - - stream.zalloc = static_cast<alloc_func>(zalloc); - stream.zfree = static_cast<free_func>(zfree); - stream.opaque = static_cast<voidpf>(&malloc_free); - } else { - stream.zalloc = static_cast<alloc_func>(0); - stream.zfree = static_cast<free_func>(0); - stream.opaque = static_cast<voidpf>(0); - } - - gz_header gzip_header; - memset(&gzip_header, 0, sizeof(gzip_header)); - int err = deflateInit2(&stream, - Z_DEFAULT_COMPRESSION, - Z_DEFLATED, - MAX_WBITS + kWindowBitsToGetGzipHeader, - kZlibMemoryLevel, - Z_DEFAULT_STRATEGY); - if (err != Z_OK) - return err; - - err = deflateSetHeader(&stream, &gzip_header); - if (err != Z_OK) - return err; - - err = deflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - deflateEnd(&stream); - return err == Z_OK ? Z_BUF_ERROR : err; - } - *dest_length = stream.total_out; - - err = deflateEnd(&stream); - return err; -} - -// This code is taken almost verbatim from third_party/zlib/uncompr.c. The only -// difference is inflateInit2() is called which sets the window bits to be > 16. -// That causes a gzip header to be parsed rather than a zlib header. -int GzipUncompressHelper(Bytef* dest, - uLongf* dest_length, - const Bytef* source, - uLong source_length) { - z_stream stream; - - stream.next_in = bit_cast<Bytef*>(source); - stream.avail_in = static_cast<uInt>(source_length); - if (static_cast<uLong>(stream.avail_in) != source_length) - return Z_BUF_ERROR; - - stream.next_out = dest; - stream.avail_out = static_cast<uInt>(*dest_length); - if (static_cast<uLong>(stream.avail_out) != *dest_length) - return Z_BUF_ERROR; - - stream.zalloc = static_cast<alloc_func>(0); - stream.zfree = static_cast<free_func>(0); - - int err = inflateInit2(&stream, MAX_WBITS + kWindowBitsToGetGzipHeader); - if (err != Z_OK) - return err; - - err = inflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - inflateEnd(&stream); - if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) - return Z_DATA_ERROR; - return err; - } - *dest_length = stream.total_out; - - err = inflateEnd(&stream); - return err; -} - -} // namespace +#include "third_party/zlib/google/compression_utils_portable.h" namespace compression { @@ -158,10 +24,10 @@ // uLongf can be larger than size_t. uLongf compressed_size_long = static_cast<uLongf>(output_buffer_size); - if (GzipCompressHelper(bit_cast<Bytef*>(output_buffer), &compressed_size_long, - bit_cast<const Bytef*>(input.data()), - static_cast<uLongf>(input.size()), malloc_fn, - free_fn) != Z_OK) { + if (zlib_internal::GzipCompressHelper( + bit_cast<Bytef*>(output_buffer), &compressed_size_long, + bit_cast<const Bytef*>(input.data()), + static_cast<uLongf>(input.size()), malloc_fn, free_fn) != Z_OK) { return false; } // No overflow, as compressed_size_long <= output.size() which is a size_t. @@ -176,16 +42,17 @@ const uLongf input_size = static_cast<uLongf>(input.size()); uLongf compressed_data_size = - kGzipZlibHeaderDifferenceBytes + compressBound(input_size); + zlib_internal::GZipExpectedCompressedSize(input_size); + Bytef* compressed_data; if (!base::UncheckedMalloc(compressed_data_size, reinterpret_cast<void**>(&compressed_data))) { return false; } - if (GzipCompressHelper(compressed_data, &compressed_data_size, - bit_cast<const Bytef*>(input.data()), input_size, - nullptr, nullptr) != Z_OK) { + if (zlib_internal::GzipCompressHelper(compressed_data, &compressed_data_size, + bit_cast<const Bytef*>(input.data()), + input_size, nullptr, nullptr) != Z_OK) { free(compressed_data); return false; } @@ -210,10 +77,10 @@ return false; uncompressed_output.resize(uncompressed_size); - if (GzipUncompressHelper(bit_cast<Bytef*>(uncompressed_output.data()), - &uncompressed_size, - bit_cast<const Bytef*>(input.data()), - static_cast<uLongf>(input.length())) == Z_OK) { + if (zlib_internal::GzipUncompressHelper( + bit_cast<Bytef*>(uncompressed_output.data()), &uncompressed_size, + bit_cast<const Bytef*>(input.data()), + static_cast<uLongf>(input.length())) == Z_OK) { output->swap(uncompressed_output); return true; } @@ -224,10 +91,10 @@ uLongf uncompressed_size = GetUncompressedSize(input); if (uncompressed_size > output.size()) return false; - return GzipUncompressHelper(bit_cast<Bytef*>(output.data()), - &uncompressed_size, - bit_cast<const Bytef*>(input.data()), - static_cast<uLongf>(input.length())) == Z_OK; + return zlib_internal::GzipUncompressHelper( + bit_cast<Bytef*>(output.data()), &uncompressed_size, + bit_cast<const Bytef*>(input.data()), + static_cast<uLongf>(input.length())) == Z_OK; } bool GzipUncompress(base::StringPiece input, std::string* output) { @@ -235,10 +102,10 @@ DCHECK_NE(input.data(), output->data()); uLongf uncompressed_size = GetUncompressedSize(input); output->resize(uncompressed_size); - return GzipUncompressHelper(bit_cast<Bytef*>(output->data()), - &uncompressed_size, - bit_cast<const Bytef*>(input.data()), - static_cast<uLongf>(input.length())) == Z_OK; + return zlib_internal::GzipUncompressHelper( + bit_cast<Bytef*>(output->data()), &uncompressed_size, + bit_cast<const Bytef*>(input.data()), + static_cast<uLongf>(input.length())) == Z_OK; } uint32_t GetUncompressedSize(base::StringPiece compressed_data) {
diff --git a/third_party/zlib/google/compression_utils_portable.cc b/third_party/zlib/google/compression_utils_portable.cc new file mode 100644 index 0000000..686b657 --- /dev/null +++ b/third_party/zlib/google/compression_utils_portable.cc
@@ -0,0 +1,146 @@ +/* compression_utils_portable.cc + * + * Copyright 2019 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the Chromium source repository LICENSE file. + */ + +#include "third_party/zlib/google/compression_utils_portable.h" + +#include <stddef.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + +namespace zlib_internal { + +// The difference in bytes between a zlib header and a gzip header. +const size_t kGzipZlibHeaderDifferenceBytes = 16; + +// Pass an integer greater than the following get a gzip header instead of a +// zlib header when calling deflateInit2() and inflateInit2(). +const int kWindowBitsToGetGzipHeader = 16; + +// This describes the amount of memory zlib uses to compress data. It can go +// from 1 to 9, with 8 being the default. For details, see: +// http://www.zlib.net/manual.html (search for memLevel). +const int kZlibMemoryLevel = 8; + +// The expected compressed size is based on the input size factored by +// internal Zlib constants (e.g. window size, etc) plus the wrapper +// header size. +uLongf GZipExpectedCompressedSize(uLongf input_size) { + return kGzipZlibHeaderDifferenceBytes + compressBound(input_size); +} + +// This code is taken almost verbatim from third_party/zlib/compress.c. The only +// difference is deflateInit2() is called which sets the window bits to be > 16. +// That causes a gzip header to be emitted rather than a zlib header. +int GzipCompressHelper(Bytef* dest, + uLongf* dest_length, + const Bytef* source, + uLong source_length, + void* (*malloc_fn)(size_t), + void (*free_fn)(void*)) { + z_stream stream; + + // FIXME(cavalcantii): z_const is not defined as 'const'. + stream.next_in = static_cast<z_const Bytef*>(const_cast<Bytef*>(source)); + stream.avail_in = static_cast<uInt>(source_length); + stream.next_out = dest; + stream.avail_out = static_cast<uInt>(*dest_length); + if (static_cast<uLong>(stream.avail_out) != *dest_length) + return Z_BUF_ERROR; + + // Cannot convert capturing lambdas to function pointers directly, hence the + // structure. + struct MallocFreeFunctions { + void* (*malloc_fn)(size_t); + void (*free_fn)(void*); + } malloc_free = {malloc_fn, free_fn}; + + if (malloc_fn) { + if (!free_fn) + return Z_BUF_ERROR; + + auto zalloc = [](void* opaque, uInt items, uInt size) { + return reinterpret_cast<MallocFreeFunctions*>(opaque)->malloc_fn(items * + size); + }; + auto zfree = [](void* opaque, void* address) { + return reinterpret_cast<MallocFreeFunctions*>(opaque)->free_fn(address); + }; + + stream.zalloc = static_cast<alloc_func>(zalloc); + stream.zfree = static_cast<free_func>(zfree); + stream.opaque = static_cast<voidpf>(&malloc_free); + } else { + stream.zalloc = static_cast<alloc_func>(0); + stream.zfree = static_cast<free_func>(0); + stream.opaque = static_cast<voidpf>(0); + } + + gz_header gzip_header; + memset(&gzip_header, 0, sizeof(gzip_header)); + int err = deflateInit2(&stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, + MAX_WBITS + kWindowBitsToGetGzipHeader, + kZlibMemoryLevel, Z_DEFAULT_STRATEGY); + if (err != Z_OK) + return err; + + err = deflateSetHeader(&stream, &gzip_header); + if (err != Z_OK) + return err; + + err = deflate(&stream, Z_FINISH); + if (err != Z_STREAM_END) { + deflateEnd(&stream); + return err == Z_OK ? Z_BUF_ERROR : err; + } + *dest_length = stream.total_out; + + err = deflateEnd(&stream); + return err; +} + +// This code is taken almost verbatim from third_party/zlib/uncompr.c. The only +// difference is inflateInit2() is called which sets the window bits to be > 16. +// That causes a gzip header to be parsed rather than a zlib header. +int GzipUncompressHelper(Bytef* dest, + uLongf* dest_length, + const Bytef* source, + uLong source_length) { + z_stream stream; + + // FIXME(cavalcantii): z_const is not defined as 'const'. + stream.next_in = static_cast<z_const Bytef*>(const_cast<Bytef*>(source)); + stream.avail_in = static_cast<uInt>(source_length); + if (static_cast<uLong>(stream.avail_in) != source_length) + return Z_BUF_ERROR; + + stream.next_out = dest; + stream.avail_out = static_cast<uInt>(*dest_length); + if (static_cast<uLong>(stream.avail_out) != *dest_length) + return Z_BUF_ERROR; + + stream.zalloc = static_cast<alloc_func>(0); + stream.zfree = static_cast<free_func>(0); + + int err = inflateInit2(&stream, MAX_WBITS + kWindowBitsToGetGzipHeader); + if (err != Z_OK) + return err; + + err = inflate(&stream, Z_FINISH); + if (err != Z_STREAM_END) { + inflateEnd(&stream); + if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) + return Z_DATA_ERROR; + return err; + } + *dest_length = stream.total_out; + + err = inflateEnd(&stream); + return err; +} + +} // namespace zlib_internal
diff --git a/third_party/zlib/google/compression_utils_portable.h b/third_party/zlib/google/compression_utils_portable.h new file mode 100644 index 0000000..5c07521 --- /dev/null +++ b/third_party/zlib/google/compression_utils_portable.h
@@ -0,0 +1,33 @@ +/* compression_utils_portable.h + * + * Copyright 2019 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the Chromium source repository LICENSE file. + */ +#ifndef THIRD_PARTY_ZLIB_GOOGLE_COMPRESSION_UTILS_PORTABLE_H_ +#define THIRD_PARTY_ZLIB_GOOGLE_COMPRESSION_UTILS_PORTABLE_H_ + +#if defined(USE_SYSTEM_ZLIB) +#include <zlib.h> +#else +#include "third_party/zlib/zlib.h" +#endif + +namespace zlib_internal { + +uLongf GZipExpectedCompressedSize(uLongf input_size); + +int GzipCompressHelper(Bytef* dest, + uLongf* dest_length, + const Bytef* source, + uLong source_length, + void* (*malloc_fn)(size_t), + void (*free_fn)(void*)); + +int GzipUncompressHelper(Bytef* dest, + uLongf* dest_length, + const Bytef* source, + uLong source_length); +} // namespace zlib_internal + +#endif // THIRD_PARTY_ZLIB_GOOGLE_COMPRESSION_UTILS_PORTABLE_H_
diff --git a/tools/android/roll/android_deps/buildSrc/src/main/groovy/BuildConfigGenerator.groovy b/tools/android/roll/android_deps/buildSrc/src/main/groovy/BuildConfigGenerator.groovy index 0f3fe2b..a98ddf6 100644 --- a/tools/android/roll/android_deps/buildSrc/src/main/groovy/BuildConfigGenerator.groovy +++ b/tools/android/roll/android_deps/buildSrc/src/main/groovy/BuildConfigGenerator.groovy
@@ -231,15 +231,14 @@ private static void addSpecialTreatment(StringBuilder sb, String dependencyId) { if (isPlayServicesTarget(dependencyId)) { if (Pattern.matches(".*cast_framework.*", dependencyId)) { - sb.append(' # Removing all resources from cast framework as they are unused bloat.\n') - sb.append(' strip_resources = true\n') + sb.append(' # Cannot get rid of cast framework resources: crbug.com/985139.\n') } else { sb.append(' # Removing drawables from GMS .aars as they are unused bloat.\n') sb.append(' strip_drawables = true\n') } } switch(dependencyId) { - case 'android_arch_lifecycle_runtime_java': + case 'android_arch_lifecycle_runtime': sb.append(' # https://crbug.com/887942#c1\n') sb.append(' ignore_proguard_configs = true\n') break
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 5d1c3ca4..04d8396 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -763,6 +763,7 @@ 'linux-ozone-rel': 'ozone_linux_release_trybot', 'linux-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', 'linux-trusty-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange', + 'linux-viz-rel': 'release_trybot', 'linux-webkit-msan-rel': 'msan_release_bot', 'linux_arm': 'release_trybot_arm', 'linux_chromium_archive_rel_ng': 'release_bot',
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index c87550e..b999b885 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -24257,8 +24257,8 @@ <int value="2978" label="ToggleEventHandlerDuringParsing"/> <int value="2979" label="FragmentDoubleHash"/> <int value="2980" label="V8RegExpMatchAllWithNonGlobalRegExp"/> - <int value="2981" label="CSSValueOverflowXOverlay"/> - <int value="2982" label="CSSValueOverflowYOverlay"/> + <int value="2981" label="OBSOLETE_CSSValueOverflowXOverlay"/> + <int value="2982" label="OBSOLETE_CSSValueOverflowYOverlay"/> <int value="2983" label="ContentIndexAdd"/> <int value="2984" label="ContentIndexDelete"/> <int value="2985" label="ContentIndexGet"/> @@ -24271,6 +24271,7 @@ <int value="2992" label="V8SpeechRecognition_Grammars_AttributeSetter"/> <int value="2993" label="ContactsManagerSelect"/> <int value="2994" label="V8MediaSession_SetPositionState_Method"/> + <int value="2995" label="CSSValueOverflowOverlay"/> </enum> <enum name="FeaturePolicyAllowlistType"> @@ -34095,6 +34096,7 @@ <int value="-2123795624" label="ArcSmartTextSelection:enabled"/> <int value="-2122048316" label="DisplayPersistenceToggleInPermissionPrompts:enabled"/> + <int value="-2119958901" label="WebXRAnchors:disabled"/> <int value="-2119827860" label="ash-disable-maximize-mode-window-backdrop"/> <int value="-2119530966" label="enable-webrtc-dtls12"/> <int value="-2119493239" label="enable-app-info-dialog-mac"/> @@ -36410,6 +36412,7 @@ <int value="1081546525" label="ash-enable-docked-windows"/> <int value="1082054180" label="PersistentWindowBounds:disabled"/> <int value="1083201516" label="PersistentWindowBounds:enabled"/> + <int value="1084972292" label="WebXRAnchors:enabled"/> <int value="1085130793" label="LongPressBackForHistory:disabled"/> <int value="1087235172" label="file-manager-enable-new-audio-player"/> <int value="1088915385" label="new-password-form-parsing:enabled"/> @@ -44751,6 +44754,9 @@ Failed to create a server blacklist because it has more than one configuration. </int> + <int value="5" label="Invalid regular expression"> + There was an invalid RE2 in the regexps field. + </int> </enum> <enum name="OptimizationGuideProcessHintsResult"> @@ -55136,12 +55142,24 @@ <int value="2" label="Unset"/> </enum> +<enum name="SmartLockFindAndConnectToHostResult"> + <int value="0" label="Found and connected to host"/> + <int value="1" label="Canceled, Bluetooth disabled"/> + <int value="2" label="Canceled, user entered password"/> + <int value="3" label="Connection attempt failure with SecureChannel service"/> + <int value="4" + label="Timed out (phone is too far, it or its Bluetooth is off, or a + connection error occurred)"/> +</enum> + <enum name="SmartLockGetRemoteStatusResultFailureReason"> - <int value="0" label="Timed out Bluetooth disabled"/> - <int value="1" label="Timed out could not establish authenticated channel"/> + <int value="0" label="Canceled, Bluetooth disabled"/> + <int value="1" + label="(Deprecated) Timed out could not establish authenticated channel"/> <int value="2" label="Timed out did not receive remote status update"/> - <int value="3" label="User entered password while Bluetooth disabled"/> - <int value="4" label="User entered password while connecting"/> + <int value="3" + label="(Deprecated) User entered password while Bluetooth disabled"/> + <int value="4" label="Canceled, user entered password"/> <int value="5" label="Authenticated channel dropped"/> </enum>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 9e7e6221..90eef75 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -44842,7 +44842,7 @@ </histogram> <histogram name="FileBrowser.DownloadDestination.IsGoogleDrive.Changed" - enum="BooleanEnabled" expires_after="M79"> + enum="BooleanEnabled" expires_after="M89"> <owner>slangley@chromium.org</owner> <owner>weifangsun@chromium.org</owner> <summary> @@ -44852,7 +44852,7 @@ </histogram> <histogram name="FileBrowser.DownloadDestination.IsGoogleDrive.Started" - enum="BooleanEnabled" expires_after="M79"> + enum="BooleanEnabled" expires_after="M89"> <owner>slangley@chromium.org</owner> <owner>weifangsun@chromium.org</owner> <summary> @@ -68327,6 +68327,15 @@ </summary> </histogram> +<histogram name="Navigation.ClientRedirectCycle.RedirectToReferrer" + enum="Boolean" expires_after="M82"> + <owner>dougarnett@chromium.org</owner> + <summary> + Records when a client redirect cycle that is directly back to the referrer + is detected. + </summary> +</histogram> + <histogram name="Navigation.CommitTimeout.ErrorCode" enum="NetErrorCodes" expires_after="M82"> <owner>cduvall@chromium.org</owner> @@ -94243,12 +94252,9 @@ </histogram> <histogram name="PageLoad.InteractiveTiming.FirstInputDelay3" units="ms" - expires_after="never"> -<!-- expires-never: guiding metric (internal: go/chrome-browser-guiding-metrics) --> - + expires_after="2020-02-23"> <owner>tdresser@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> - <owner>chrome-analysis-team@google.com</owner> <summary> Measures First Input Delay, the duration between the hardware timestamp and the start of event processing on the main thread for the first meaningful @@ -94256,14 +94262,17 @@ https://goo.gl/tr1oTZ for a detailed explanation. Excludes scrolls. Do not modify this metric in any way without contacting - speed-metrics-dev@chromium.org AND chrome-analysis-team@google.com. + speed-metrics-dev@chromium.org. </summary> </histogram> <histogram name="PageLoad.InteractiveTiming.FirstInputDelay4" units="ms" - expires_after="2020-02-23"> + expires_after="never"> +<!-- expires-never: guiding metric (internal: go/chrome-browser-guiding-metrics) --> + <owner>tdresser@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> + <owner>chrome-analysis-team@google.com</owner> <summary> This metric will replace PageLoad.InteractiveTiming.FirstInputDelay3 if the SkipTouchEventFilter experiment launches. @@ -94272,6 +94281,9 @@ the start of event processing on the main thread for the first meaningful input per navigation. Recorded on first page interaction. See https://goo.gl/tr1oTZ for a detailed explanation. Excludes scrolls. + + Do not modify this metric in any way without contacting + speed-metrics-dev@chromium.org AND chrome-analysis-team@google.com. </summary> </histogram> @@ -130801,9 +130813,30 @@ </summary> </histogram> -<histogram name="SmartLock.GetRemoteStatus.SignIn" enum="BooleanSuccess"> +<histogram name="SmartLock.FindAndConnectToHostResult.SignIn" + enum="SmartLockFindAndConnectToHostResult" expires_after="2020-08-07"> <owner>hansberry@chromium.org</owner> - <owner>hsuregan@chromium.org</owner> + <owner>jhawkins@chromium.org</owner> + <summary> + The resolution of Smart Lock trying to find the host device during the + initial scan window at the signin screen. + </summary> +</histogram> + +<histogram name="SmartLock.FindAndConnectToHostResult.Unlock" + enum="SmartLockFindAndConnectToHostResult" expires_after="2020-08-07"> + <owner>hansberry@chromium.org</owner> + <owner>jhawkins@chromium.org</owner> + <summary> + The resolution of Smart Lock trying to find the host device during the + initial scan window at the lock screen. + </summary> +</histogram> + +<histogram name="SmartLock.GetRemoteStatus.SignIn" enum="BooleanSuccess" + expires_after="2020-08-07"> + <owner>hansberry@chromium.org</owner> + <owner>jhawkins@chromium.org</owner> <summary> Count of successful and failed attempts to get the 'remote status' of the host device, i.e., determine if the Chromebook can be signed into. @@ -130811,16 +130844,20 @@ </histogram> <histogram name="SmartLock.GetRemoteStatus.SignIn.Failure" - enum="SmartLockGetRemoteStatusResultFailureReason"> + enum="SmartLockGetRemoteStatusResultFailureReason" + expires_after="2020-08-07"> <owner>hansberry@chromium.org</owner> + <owner>jhawkins@chromium.org</owner> <summary> Shows why a sign in attempt failed during the connection phase. Breaks down the failure bucket of SmartLock.ConnectionResult. </summary> </histogram> -<histogram name="SmartLock.GetRemoteStatus.Unlock" enum="BooleanSuccess"> +<histogram name="SmartLock.GetRemoteStatus.Unlock" enum="BooleanSuccess" + expires_after="2020-08-07"> <owner>hansberry@chromium.org</owner> + <owner>jhawkins@chromium.org</owner> <summary> Count of successful and failed attempts to get the 'remote status' of the host device, i.e., determine if the Chromebook can be unlocked. @@ -130828,8 +130865,10 @@ </histogram> <histogram name="SmartLock.GetRemoteStatus.Unlock.Failure" - enum="SmartLockGetRemoteStatusResultFailureReason"> + enum="SmartLockGetRemoteStatusResultFailureReason" + expires_after="2020-08-07"> <owner>hansberry@chromium.org</owner> + <owner>jhawkins@chromium.org</owner> <summary> Shows why an unlock attempt failed during the connection phase. Breaks down the failure bucket of SmartLock.ConnectionResult.
diff --git a/tools/perf/core/generate_system_health_csv_unittest.py b/tools/perf/core/generate_system_health_csv_unittest.py deleted file mode 100644 index 5bb63c0..0000000 --- a/tools/perf/core/generate_system_health_csv_unittest.py +++ /dev/null
@@ -1,45 +0,0 @@ -# Copyright 2017 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import unittest -import sys - -from core import system_health_csv_generator -from core import path_util -sys.path.insert(1, path_util.GetTelemetryDir()) # To resolve telemetry imports - - -class GenerateSystemHealthCSVTest(unittest.TestCase): - def testPopulateExpectations(self): - expected_result = { - 'browse:media:tumblr': 'Mac 10.11', - 'browse:news:cnn': 'Mac Platforms', - 'browse:news:hackernews': 'Win Platforms, Mac Platforms', - 'browse:search:google': 'Win Platforms', - 'browse:tools:earth': 'All Platforms', - 'browse:tools:maps': 'All Platforms', - 'play:media:google_play_music': 'All Platforms', - 'play:media:soundcloud': 'Win Platforms'} - all_expects = [{ - 'browse:news:cnn': [( - ['Mac Platforms'], 'crbug.com/728576')], - 'browse:tools:earth': [( - ['All Platforms'], 'crbug.com/760966')], - 'browse:news:hackernews': [( - ['Win Platforms', 'Mac Platforms'], - 'crbug.com/712694')], - 'play:media:soundcloud': [( - ['Win Platforms'], 'crbug.com/649392')], - 'play:media:google_play_music': [( - ['All Platforms'], 'crbug.com/649392')], - 'browse:tools:maps': [( - ['All Platforms'], 'crbug.com/712694')], - 'browse:search:google': [( - ['Win Platforms'], 'win:crbug.com/673775, mac:crbug.com/756027')], - 'browse:media:tumblr': [( - ['Mac 10.11'], 'crbug.com/760966')], - }] - self.assertEquals( - expected_result, - system_health_csv_generator.PopulateExpectations(all_expects))
diff --git a/tools/perf/core/system_health_csv_generator.py b/tools/perf/core/system_health_csv_generator.py deleted file mode 100644 index 90aa3f51..0000000 --- a/tools/perf/core/system_health_csv_generator.py +++ /dev/null
@@ -1,84 +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 csv -import sys - -from core import path_util - -sys.path.insert(1, path_util.GetPerfDir()) # To resolve perf imports -path_util.AddPyUtilsToPath() -path_util.AddTelemetryToPath() -import page_sets -from py_utils import expectations_parser -from telemetry.story import expectations as expectations - -def IterAllSystemHealthStories(): - for s in page_sets.SystemHealthStorySet(platform='desktop'): - yield s - for s in page_sets.SystemHealthStorySet(platform='mobile'): - if len(s.SUPPORTED_PLATFORMS) < 2: - yield s - - -def PopulateExpectations(all_expectations): - """Accepts Expectations and parses out the storyname and disabled platforms. - - Args: - all_expectations = { - story_name: [[conditions], reason]} - conditions: list of disabled platforms for story_name - reason: Bug referencing why the test is disabled on the platform - - Returns: - A dictionary containing the disabled platforms for each story. - disables = { - story_name: "Disabled Platforms"} - """ - disables = {} - for exp in all_expectations: - exp_keys = exp.keys() - exp_keys.sort() - - for story in exp_keys: - for conditions, _ in exp[story]: - conditions_str = ", ".join(map(str, conditions)) - if story in disables: - if conditions_str not in disables[story]: - disables[story] += ", " + conditions_str - else: - disables[story] = conditions_str - return disables - -def GenerateSystemHealthCSV(file_path): - system_health_stories = list(IterAllSystemHealthStories()) - - e = expectations.StoryExpectations() - with open(path_util.GetExpectationsPath()) as fp: - parser = expectations_parser.TestExpectationParser(fp.read()) - - benchmarks = ['system_health.common_desktop', 'system_health.common_mobile', - 'system_health.memory_desktop', 'system_health.memory_mobile'] - for benchmark in benchmarks: - e.GetBenchmarkExpectationsFromParser(parser.expectations, benchmark) - - disabed_platforms = PopulateExpectations([e.AsDict()['stories']]) - - system_health_stories.sort(key=lambda s: s.name) - with open(file_path, 'w') as f: - csv_writer = csv.writer(f) - csv_writer.writerow([ - 'Story name', 'Platform', 'Description', 'Disabled Platforms']) - for s in system_health_stories: - p = s.SUPPORTED_PLATFORMS - if len(p) == 2: - p = 'all' - else: - p = list(p)[0] - if s.name in disabed_platforms: - csv_writer.writerow( - [s.name, p, s.GetStoryDescription(), disabed_platforms[s.name]]) - else: - csv_writer.writerow([s.name, p, s.GetStoryDescription(), " "]) - return 0
diff --git a/tools/perf/generate_system_health_csv b/tools/perf/generate_system_health_csv deleted file mode 100755 index af53b31..0000000 --- a/tools/perf/generate_system_health_csv +++ /dev/null
@@ -1,15 +0,0 @@ -#!/usr/bin/env vpython -# Copyright 2016 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import sys -import os -from core import system_health_csv_generator -from core import path_util - -SYSTEM_HEALTH_CSV = os.path.join(path_util.GetPerfDir(), - 'system_health_stories.csv') -if __name__ == '__main__': - sys.exit(system_health_csv_generator.GenerateSystemHealthCSV( - SYSTEM_HEALTH_CSV)) \ No newline at end of file
diff --git a/tools/perf/system_health_stories.csv b/tools/perf/system_health_stories.csv deleted file mode 100644 index f52be80..0000000 --- a/tools/perf/system_health_stories.csv +++ /dev/null
@@ -1,157 +0,0 @@ -Story name,Platform,Description,Disabled Platforms -background:media:imgur,mobile,"Load http://imgur.com/gallery/hUita, then put the browser into the background.", -background:news:nytimes,mobile,"Load http://www.nytimes.com/2016/10/04/us/politics/vice-presidential-debate.html?_r=0, then put the browser into the background.","Android, Android_One, Android_Go, Nexus_5X" -background:search:google,mobile,"Load https://www.google.co.uk/#q=tom+cruise+movies, then put the browser into the background.", -background:social:facebook,mobile,"Load https://www.facebook.com/rihanna, then put the browser into the background.", -background:tools:gmail,mobile,Load https://mail.google.com/mail/,Nexus_5 -browse:chrome:newtab,mobile,"Story that loads new tab page and performs searches. - - Given a list of typical search queries, this story does for each of them: - - enter the search query on the new tab page search box - - read results - - navigates back to new tab page - ","Android_Webview, Nexus_5, Android_One" -browse:chrome:omnibox,mobile,"Story that peforms search by using omnibox search provider - - Loads a website and enters a search query on omnibox and navigates to default - search provider (google). - ","Android_Webview, Nexus_5X" -browse:media:facebook_photos,mobile,"Load a photo page from Rihanna's facebook page then navigate a few next - photos. - ", -browse:media:flickr_infinite_scroll,desktop,Load https://www.flickr.com/explore then make a very long scroll.,Win -browse:media:flickr_infinite_scroll,mobile,Load https://www.flickr.com/explore then make a very long scroll.,Win -browse:media:imgur,desktop,Load http://imgur.com/gallery/5UlBN and navigate to some items/articles., -browse:media:imgur,mobile,Load http://imgur.com/gallery/5UlBN and navigate to some items/articles., -browse:media:pinterest,desktop,Load https://pinterest.com and navigate to some items/articles., -browse:media:tumblr,desktop,Load https://tumblr.com/search/gifs and navigate to some items/articles.,"All, Win, Linux" -browse:media:youtube,desktop,"Load a typical YouTube video then navigate to a next few videos. Stop and - watch each video for a few seconds. - ", -browse:media:youtube,mobile,"Load a typical YouTube video then navigate to a next few videos. Stop and - watch each video for few seconds. - ", -browse:news:cnn,all,The second top website in http://www.alexa.com/topsites/category/News,"Mac, Win" -browse:news:cricbuzz,mobile,Load http://m.cricbuzz.com and navigate to some items/articles., -browse:news:flipboard,desktop,Load https://flipboard.com/explore and navigate to some items/articles.,Linux -browse:news:globo,mobile,Load http://www.globo.com and navigate to some items/articles.,Android -browse:news:hackernews,desktop,Load https://news.ycombinator.com and navigate to some items/articles.,"Win, Mac" -browse:news:nytimes,desktop,The third top website in http://www.alexa.com/topsites/category/News, -browse:news:qq,mobile,Load http://news.qq.com and navigate to some items/articles., -browse:news:reddit,desktop,The top website in http://www.alexa.com/topsites/category/News, -browse:news:reddit,mobile,The top website in http://www.alexa.com/topsites/category/News, -browse:news:toi,mobile,Load http://m.timesofindia.com and navigate to some items/articles.,Android -browse:news:washingtonpost,mobile,Progressive website, -browse:search:google,desktop," - A typical google search story: - _ Start at https://www.google.com/search?q=flower - _ Click on the wikipedia link & navigate to - https://en.wikipedia.org/wiki/Flower - _ Scroll down the wikipedia page about flower. - _ Back to the search main page. - _ Refine the search query to 'flower delivery'. - _ Scroll down the page. - _ Click the next page result of 'flower delivery'. - _ Scroll the search page. - - ",Win -browse:search:google_india,desktop," - A typical google search story in India: - 1. Start at https://www.google.co.in/search?q=%E0%A4%AB%E0%A5%82%E0%A4%B2` - 2. Scroll down the page. - 3. Refine the query & click search box, which navigates to - https://www.google.co.in/search?q=%E0%A4%AB%E0%A5%82%E0%A4%B2&rct=j#q=%E0%A4%AB%E0%A5%82%E0%A4%B2+%E0%A4%B5%E0%A4%BF%E0%A4%A4%E0%A4%B0%E0%A4%A3 - 4. Scroll down the page. - 5. Click the next page result - 6. Scroll the search result page. - - ", -browse:shopping:amazon,mobile,Load https://www.amazon.co.in/s/?field-keywords=Mobile and navigate to some items/articles., -browse:shopping:avito,mobile,Load https://www.avito.ru/rossiya and navigate to some items/articles.,Nexus_6 -browse:shopping:flipkart,mobile,Load https://flipkart.com/search?q=Sunglasses and navigate to some items/articles.,Android -browse:shopping:lazada,mobile,Load https://www.lazada.co.id/catalog/?q=Wrist+watch and navigate to some items/articles., -browse:social:facebook,mobile,Load https://www.facebook.com/rihanna and navigate to some items/articles.,Nexus_5 -browse:social:facebook_infinite_scroll,desktop,Load https://www.facebook.com/shakira then make a very long scroll.,Android_One -browse:social:facebook_infinite_scroll,mobile,Load https://m.facebook.com/shakira then make a very long scroll.,Android_One -browse:social:instagram,mobile,Load https://www.instagram.com/badgalriri/ and navigate to some items/articles., -browse:social:pinterest_infinite_scroll,mobile,Load https://www.pinterest.com/all then make a very long scroll.,"Android_One, Nexus_5" -browse:social:tumblr_infinite_scroll,all,Load http://techcrunch.tumblr.com/ then make a very long scroll.,"Android_One, Nexus_5X" -browse:social:twitter,desktop,Load https://www.twitter.com/nasa and navigate to some items/articles., -browse:social:twitter,mobile,Load https://www.twitter.com/nasa and navigate to some items/articles., -browse:social:twitter_infinite_scroll,desktop,Load https://twitter.com/taylorswift13 then make a very long scroll.,"Win, Linux, All" -browse:tech:discourse_infinite_scroll,desktop,Load https://meta.discourse.org/t/the-official-discourse-tags-plugin-discourse-tagging/26482 then make a very long scroll., -browse:tech:discourse_infinite_scroll,mobile,Load https://meta.discourse.org/t/the-official-discourse-tags-plugin-discourse-tagging/26482 then make a very long scroll., -browse:tools:earth,desktop," - Google Earth story: - _ Start at https://www.maps.google.com/maps - _ Click on the Earth link - _ Click ZoomIn three times, waiting for 3 sec in between. - - ", -browse:tools:maps,desktop," - Google maps story: - _ Start at https://www.maps.google.com/maps - _ Search for ""restaurents near me"" and wait for 4 sec. - _ Click ZoomIn two times, waiting for 3 sec in between. - _ Scroll the map horizontally and vertically. - _ Pick a restaurant and ask for directions. - ","Mac, Linux" -browse:tools:maps,mobile,"Story that browses google maps mobile page - - This story searches for nearby restaurants on google maps website and finds - directions to a chosen restaurant from search results. - ","Mac, Linux" -browse_accessibility:tech:codesearch,desktop,Tests scrolling an element within a page., -load:chrome:blank,all,Story that loads the about:blank page., -load:games:alphabetty,desktop,Load https://king.com/play/alphabetty, -load:games:bubbles,all,"Load ""smarty bubbles"" game on famobi.com", -load:games:lazors,all,Load http://www8.games.mobi/games/html5/lazors/lazors.html, -load:games:miniclip,desktop,Load http://www.miniclip.com/games/en/,Mac -load:games:spychase,all,Load http://playstar.mobi/games/spychase/index.php,Android_Webview -load:media:9gag,desktop,Load https://www.9gag.com/, -load:media:dailymotion,all,Load https://www.dailymotion.com/video/x489k7d_street-performer-shows-off-slinky-skills_fun?autoplay=false, -load:media:facebook_photos,mobile,Load a page of rihanna's facebook with a photo., -load:media:google_images,all,Load https://www.google.co.uk/search?tbm=isch&q=love, -load:media:imgur,all,Load http://imgur.com/gallery/5UlBN, -load:media:soundcloud,all,Load https://soundcloud.com/lifeofdesiigner/desiigner-panda,Android_Webview -load:media:youtube,all,Load https://www.youtube.com/watch?v=QGfhS1hfTWw&autoplay=false, -load:news:bbc,desktop,Load https://www.bbc.co.uk/news/world-asia-china-36189636, -load:news:cnn,all,Load http://edition.cnn.com, -load:news:flipboard,desktop,Load https://flipboard.com/explore, -load:news:hackernews,desktop,Load https://news.ycombinator.com, -load:news:irctc,mobile,Load https://www.irctc.co.in, -load:news:nytimes,desktop,Load http://www.nytimes.com, -load:news:nytimes,mobile,Load http://mobile.nytimes.com, -load:news:qq,all,Load http://news.qq.com, -load:news:reddit,desktop,Load https://www.reddit.com/r/news/top/?sort=top&t=week, -load:news:reddit,mobile,Load https://www.reddit.com/r/news/top/?sort=top&t=week, -load:news:washingtonpost,mobile,Load https://www.washingtonpost.com/pwa, -load:news:wikipedia,all,Load https://en.wikipedia.org/wiki/Science, -load:search:amazon,desktop,Load https://www.amazon.com/s/?field-keywords=nexus, -load:search:baidu,all,Load https://www.baidu.com/s?word=google, -load:search:ebay,all,Load https://www.ebay.com/sch/i.html?_nkw=headphones, -load:search:google,all,Load https://www.google.co.uk/, -load:search:taobao,desktop,Load https://world.taobao.com/, -load:search:taobao,mobile,Load http://m.intl.taobao.com/?ali_trackid, -load:search:yahoo,all,Load https://search.yahoo.com/search;_ylt=?p=google, -load:search:yandex,all,Load https://yandex.ru/touchsearch?text=science, -load:social:instagram,desktop,Load https://www.instagram.com/selenagomez/, -load:social:pinterest,desktop,Load https://uk.pinterest.com/categories/popular/, -load:social:twitter,mobile,Load https://www.twitter.com/nasa, -load:social:vk,desktop,Load https://vk.com/sbeatles, -load:tools:docs,all,Load a typical google doc page., -load:tools:drive,all,Load https://drive.google.com/drive/my-drive,"Nexus_5X, Android_Webview" -load:tools:dropbox,all,Load https://www.dropbox.com, -load:tools:gmail,desktop,Load https://mail.google.com/mail/,Android -load:tools:gmail,mobile,Load https://mail.google.com/mail/,Android -load:tools:stackoverflow,all,Load a typical question & answer page of stackoverflow.com, -load:tools:weather,all,Load https://weather.com/en-GB/weather/today/l/USCA0286:1:US, -load_accessibility:media:wikipedia,desktop,"Wikipedia page on Accessibility. Long, but very simple, clean layout.", -load_accessibility:shopping:amazon,desktop,Amazon results page. Good example of a site with a data table.,Linux -long_running:tools:gmail-background,desktop,Load https://mail.google.com/mail/ then open a new blank tab and let the loaded page stay in background for 100 seconds.,"Android_Webview, Android_Low_End" -long_running:tools:gmail-background,mobile,Load https://mail.google.com/mail/ then open a new blank tab and let the loaded page stay in background for 100 seconds.,"Android_Webview, Android_Low_End" -long_running:tools:gmail-foreground,desktop,Load https://mail.google.com/mail/ then let it stay in foreground for 100 seconds.,Android_Webview -long_running:tools:gmail-foreground,mobile,Load https://mail.google.com/mail/ then let it stay in foreground for 100 seconds.,Android_Webview -multitab:misc:typical24,desktop,"Load 24 different web sites in 24 tabs, then cycle through each tab.","Mac, Linux, ChromeOS" -play:media:google_play_music,desktop,"Browse the songs list in music.google.com, then play a song.",All -play:media:soundcloud,desktop,"Load soundcloud.com, search for ""Smooth Jazz"", then play a song.",Win
diff --git a/ui/webui/resources/cr_elements/cr_fingerprint/cr_fingerprint_progress_arc.js b/ui/webui/resources/cr_elements/cr_fingerprint/cr_fingerprint_progress_arc.js index c204783..7f7b254e 100644 --- a/ui/webui/resources/cr_elements/cr_fingerprint/cr_fingerprint_progress_arc.js +++ b/ui/webui/resources/cr_elements/cr_fingerprint/cr_fingerprint_progress_arc.js
@@ -337,5 +337,10 @@ target.style.left = left + 'px'; target.style.top = top + 'px'; }, + + /** @public */ + isComplete: function() { + return this.isComplete_; + }, }); })();