diff --git a/DEPS b/DEPS index 552978806..9a39c8b 100644 --- a/DEPS +++ b/DEPS
@@ -44,7 +44,7 @@ # 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': '952f96092a17a55f65cfb5d45979a14ad67cdf0a', + 'v8_revision': '2c1f3255c38172f5085b70c0fb360d3eb874497a', # 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.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/SubresourceFilterExperimentalInfoBar.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SubresourceFilterExperimentalInfoBar.java index 692f5012..e78e258 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/SubresourceFilterExperimentalInfoBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/SubresourceFilterExperimentalInfoBar.java
@@ -82,6 +82,7 @@ public void onLinkClicked() { mShowExplanation = true; replaceView(createView()); + super.onLinkClicked(); } @Override
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index cbec83f..10ced259 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -617,7 +617,8 @@ } void ExistingUserController::ShowEncryptionMigrationScreen( - const UserContext& user_context) { + const UserContext& user_context, + bool has_incomplete_migration) { host_->StartWizard(OobeScreen::SCREEN_ENCRYPTION_MIGRATION); EncryptionMigrationScreen* migration_screen = @@ -625,6 +626,7 @@ host_->GetWizardController()->current_screen()); DCHECK(migration_screen); migration_screen->SetUserContext(user_context); + migration_screen->SetShouldResume(has_incomplete_migration); migration_screen->SetContinueLoginCallback(base::BindOnce( &ExistingUserController::ContinuePerformLogin, weak_factory_.GetWeakPtr(), login_performer_->auth_mode())); @@ -868,8 +870,9 @@ } void ExistingUserController::OnOldEncryptionDetected( - const UserContext& user_context) { - ShowEncryptionMigrationScreen(user_context); + const UserContext& user_context, + bool has_incomplete_migration) { + ShowEncryptionMigrationScreen(user_context, has_incomplete_migration); } void ExistingUserController::WhiteListCheckFailed(const std::string& email) {
diff --git a/chrome/browser/chromeos/login/existing_user_controller.h b/chrome/browser/chromeos/login/existing_user_controller.h index 9afa87da..32f8a497 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.h +++ b/chrome/browser/chromeos/login/existing_user_controller.h
@@ -163,7 +163,8 @@ void OnAuthSuccess(const UserContext& user_context) override; void OnOffTheRecordAuthSuccess() override; void OnPasswordChangeDetected() override; - void OnOldEncryptionDetected(const UserContext& user_context) override; + void OnOldEncryptionDetected(const UserContext& user_context, + bool has_incomplete_migration) override; void WhiteListCheckFailed(const std::string& email) override; void PolicyLoadFailed() override; void SetAuthFlowOffline(bool offline) override; @@ -208,7 +209,8 @@ void ShowKioskAutolaunchScreen(); // Shows "filesystem encryption migration" screen. - void ShowEncryptionMigrationScreen(const UserContext& user_context); + void ShowEncryptionMigrationScreen(const UserContext& user_context, + bool has_incomplete_migration); // Shows "critical TPM error" screen. void ShowTPMError();
diff --git a/chrome/browser/chromeos/login/screens/encryption_migration_screen.cc b/chrome/browser/chromeos/login/screens/encryption_migration_screen.cc index 1c34de6..d29b647 100644 --- a/chrome/browser/chromeos/login/screens/encryption_migration_screen.cc +++ b/chrome/browser/chromeos/login/screens/encryption_migration_screen.cc
@@ -53,6 +53,11 @@ view_->SetUserContext(user_context); } +void EncryptionMigrationScreen::SetShouldResume(bool should_resume) { + DCHECK(view_); + view_->SetShouldResume(should_resume); +} + void EncryptionMigrationScreen::SetContinueLoginCallback( ContinueLoginCallback callback) { DCHECK(view_);
diff --git a/chrome/browser/chromeos/login/screens/encryption_migration_screen.h b/chrome/browser/chromeos/login/screens/encryption_migration_screen.h index 4ba1e30d0..9835c53 100644 --- a/chrome/browser/chromeos/login/screens/encryption_migration_screen.h +++ b/chrome/browser/chromeos/login/screens/encryption_migration_screen.h
@@ -34,6 +34,9 @@ // Sets the UserContext for a user whose cryptohome should be migrated. void SetUserContext(const UserContext& user_context); + // Sets whether the migration process should resume the previous one or not. + void SetShouldResume(bool should_resume); + // Sets a callback, which should be called when the user want to log in to the // session from the migration UI. void SetContinueLoginCallback(ContinueLoginCallback callback);
diff --git a/chrome/browser/chromeos/login/screens/encryption_migration_screen_view.h b/chrome/browser/chromeos/login/screens/encryption_migration_screen_view.h index 879c0d9..bd25ee6 100644 --- a/chrome/browser/chromeos/login/screens/encryption_migration_screen_view.h +++ b/chrome/browser/chromeos/login/screens/encryption_migration_screen_view.h
@@ -37,6 +37,7 @@ virtual void Hide() = 0; virtual void SetDelegate(Delegate* delegate) = 0; virtual void SetUserContext(const UserContext& user_context) = 0; + virtual void SetShouldResume(bool should_resume) = 0; virtual void SetContinueLoginCallback(ContinueLoginCallback callback) = 0; };
diff --git a/chrome/browser/subresource_filter/chrome_subresource_filter_client.h b/chrome/browser/subresource_filter/chrome_subresource_filter_client.h index e337ed8..e706577 100644 --- a/chrome/browser/subresource_filter/chrome_subresource_filter_client.h +++ b/chrome/browser/subresource_filter/chrome_subresource_filter_client.h
@@ -27,8 +27,9 @@ // On Desktop, this is a bubble. On Android it is an // expanded infobar. - // TODO(csharrison): Start logging these once the new UI is finished. kActionDetailsShown, + + // TODO(csharrison): Log this once the link is in place. kActionClickedLearnMore, // Content settings:
diff --git a/chrome/browser/ui/android/content_settings/subresource_filter_infobar_delegate.cc b/chrome/browser/ui/android/content_settings/subresource_filter_infobar_delegate.cc index 01d167e..5fee641 100644 --- a/chrome/browser/ui/android/content_settings/subresource_filter_infobar_delegate.cc +++ b/chrome/browser/ui/android/content_settings/subresource_filter_infobar_delegate.cc
@@ -8,6 +8,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/android/android_theme_resources.h" #include "chrome/browser/infobars/infobar_service.h" +#include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" #include "chrome/grit/generated_resources.h" #include "components/infobars/core/infobar.h" #include "components/strings/grit/components_strings.h" @@ -83,3 +84,9 @@ ->OnReloadRequested(); return true; } + +bool SubresourceFilterInfobarDelegate::LinkClicked( + WindowOpenDisposition disposition) { + ChromeSubresourceFilterClient::LogAction(kActionDetailsShown); + return false; +}
diff --git a/chrome/browser/ui/android/content_settings/subresource_filter_infobar_delegate.h b/chrome/browser/ui/android/content_settings/subresource_filter_infobar_delegate.h index 918cb08..e57367b9 100644 --- a/chrome/browser/ui/android/content_settings/subresource_filter_infobar_delegate.h +++ b/chrome/browser/ui/android/content_settings/subresource_filter_infobar_delegate.h
@@ -34,6 +34,7 @@ int GetButtons() const override; base::string16 GetButtonLabel(InfoBarButton button) const override; bool Cancel() override; + bool LinkClicked(WindowOpenDisposition disposition) override; private: SubresourceFilterInfobarDelegate();
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc index 5b61709..bb2458f 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -29,6 +29,7 @@ #include "chrome/browser/plugins/chrome_plugin_service_filter.h" #include "chrome/browser/plugins/plugin_utils.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delegate.h" @@ -1233,6 +1234,7 @@ SetTitle(); SetMessage(); SetManageText(); + ChromeSubresourceFilterClient::LogAction(kActionDetailsShown); } ContentSettingSubresourceFilterBubbleModel::
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc index e5779d37..7302767 100644 --- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
@@ -58,6 +58,13 @@ user_context_ = user_context; } +void EncryptionMigrationScreenHandler::SetShouldResume(bool should_resume) { + if (current_ui_state_ == INITIAL && should_resume) { + // TODO(fukino): Wait until the battery gets enough level. + StartMigration(); + } +} + void EncryptionMigrationScreenHandler::SetContinueLoginCallback( ContinueLoginCallback callback) { continue_login_callback_ = std::move(callback); @@ -86,6 +93,7 @@ } void EncryptionMigrationScreenHandler::HandleStartMigration() { + // TODO(fukino): Wait until the battery gets enough level. StartMigration(); }
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h index 5be5ede..719af81c 100644 --- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
@@ -25,6 +25,7 @@ void Hide() override; void SetDelegate(Delegate* delegate) override; void SetUserContext(const UserContext& user_context) override; + void SetShouldResume(bool should_resume) override; void SetContinueLoginCallback(ContinueLoginCallback callback) override; // BaseScreenHandler implementation:
diff --git a/chromecast/graphics/BUILD.gn b/chromecast/graphics/BUILD.gn index 5e47686..1c4c0b8 100644 --- a/chromecast/graphics/BUILD.gn +++ b/chromecast/graphics/BUILD.gn
@@ -8,8 +8,6 @@ source_set("graphics") { sources = [ - "cast_vsync_settings.cc", - "cast_vsync_settings.h", "cast_window_manager.h", ]
diff --git a/chromecast/graphics/cast_vsync_settings.cc b/chromecast/graphics/cast_vsync_settings.cc deleted file mode 100644 index dda4870..0000000 --- a/chromecast/graphics/cast_vsync_settings.cc +++ /dev/null
@@ -1,44 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chromecast/graphics/cast_vsync_settings.h" - -namespace chromecast { -namespace { -base::LazyInstance<CastVSyncSettings>::DestructorAtExit g_instance = - LAZY_INSTANCE_INITIALIZER; -} // namespace - -// static -CastVSyncSettings* CastVSyncSettings::GetInstance() { - return g_instance.Pointer(); -} - -base::TimeDelta CastVSyncSettings::GetVSyncInterval() const { - return interval_; -} - -void CastVSyncSettings::SetVSyncInterval(base::TimeDelta interval) { - if (interval_ == interval) - return; - interval_ = interval; - for (auto& observer : observers_) - observer.OnVSyncIntervalChanged(interval); -} - -void CastVSyncSettings::AddObserver(Observer* observer) { - observers_.AddObserver(observer); -} - -void CastVSyncSettings::RemoveObserver(Observer* observer) { - observers_.RemoveObserver(observer); -} - -// Default to 60fps until set otherwise -CastVSyncSettings::CastVSyncSettings() - : interval_(base::TimeDelta::FromMicroseconds(16666)) {} - -CastVSyncSettings::~CastVSyncSettings() = default; - -} // namespace chromecast
diff --git a/chromecast/graphics/cast_vsync_settings.h b/chromecast/graphics/cast_vsync_settings.h deleted file mode 100644 index 48211ac7..0000000 --- a/chromecast/graphics/cast_vsync_settings.h +++ /dev/null
@@ -1,48 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROMECAST_GRAPHICS_CAST_VSYNC_SETTINGS_H_ -#define CHROMECAST_GRAPHICS_CAST_VSYNC_SETTINGS_H_ - -#include "base/lazy_instance.h" -#include "base/macros.h" -#include "base/observer_list.h" -#include "base/time/time.h" - -namespace chromecast { - -// Provides a central place to manage VSync interval, supports observers -// to be notified of changes. -// TODO(halliwell): plumb this via Ozone or ui::Display instead. -class CastVSyncSettings { - public: - class Observer { - public: - virtual ~Observer() {} - virtual void OnVSyncIntervalChanged(base::TimeDelta interval) = 0; - }; - - static CastVSyncSettings* GetInstance(); - - base::TimeDelta GetVSyncInterval() const; - void SetVSyncInterval(base::TimeDelta interval); - - void AddObserver(Observer* observer); - void RemoveObserver(Observer* observer); - - private: - friend struct base::LazyInstanceTraitsBase<CastVSyncSettings>; - - CastVSyncSettings(); - ~CastVSyncSettings(); - - base::TimeDelta interval_; - base::ObserverList<Observer> observers_; - - DISALLOW_COPY_AND_ASSIGN(CastVSyncSettings); -}; - -} // namespace chromecast - -#endif // CHROMECAST_GRAPHICS_CAST_VSYNC_SETTINGS_H_
diff --git a/chromecast/graphics/cast_window_manager_aura.cc b/chromecast/graphics/cast_window_manager_aura.cc index 4fe20085..e60c9a0 100644 --- a/chromecast/graphics/cast_window_manager_aura.cc +++ b/chromecast/graphics/cast_window_manager_aura.cc
@@ -211,10 +211,6 @@ capture_client_.reset( new aura::client::DefaultCaptureClient(window_tree_host_->window())); - CastVSyncSettings::GetInstance()->AddObserver(this); - window_tree_host_->compositor()->SetAuthoritativeVSyncInterval( - CastVSyncSettings::GetInstance()->GetVSyncInterval()); - window_tree_host_->Show(); } @@ -222,7 +218,6 @@ if (!window_tree_host_) { return; } - CastVSyncSettings::GetInstance()->RemoveObserver(this); capture_client_.reset(); aura::client::SetWindowParentingClient(window_tree_host_->window(), nullptr); aura::client::SetActivationClient(window_tree_host_->window(), nullptr); @@ -258,9 +253,4 @@ } } -void CastWindowManagerAura::OnVSyncIntervalChanged(base::TimeDelta interval) { - DCHECK(window_tree_host_.get()); - window_tree_host_->compositor()->SetAuthoritativeVSyncInterval(interval); -} - } // namespace chromecast
diff --git a/chromecast/graphics/cast_window_manager_aura.h b/chromecast/graphics/cast_window_manager_aura.h index 012d274..66d9b0c5 100644 --- a/chromecast/graphics/cast_window_manager_aura.h +++ b/chromecast/graphics/cast_window_manager_aura.h
@@ -8,7 +8,6 @@ #include <memory> #include "base/macros.h" -#include "chromecast/graphics/cast_vsync_settings.h" #include "chromecast/graphics/cast_window_manager.h" #include "ui/aura/client/window_parenting_client.h" @@ -24,8 +23,7 @@ class CastWindowTreeHost; class CastWindowManagerAura : public CastWindowManager, - public aura::client::WindowParentingClient, - private CastVSyncSettings::Observer { + public aura::client::WindowParentingClient { public: ~CastWindowManagerAura() override; @@ -45,9 +43,6 @@ // This class should only be instantiated by CastWindowManager::Create. explicit CastWindowManagerAura(bool enable_input); - // CastVSyncSettings::Observer implementation: - void OnVSyncIntervalChanged(base::TimeDelta interval) override; - void Setup(); const bool enable_input_;
diff --git a/chromeos/login/auth/auth_status_consumer.cc b/chromeos/login/auth/auth_status_consumer.cc index aed5f7d..037f1d9 100644 --- a/chromeos/login/auth/auth_status_consumer.cc +++ b/chromeos/login/auth/auth_status_consumer.cc
@@ -11,7 +11,8 @@ } void AuthStatusConsumer::OnOldEncryptionDetected( - const UserContext& user_context) { + const UserContext& user_context, + bool has_incomplete_migration) { NOTREACHED(); }
diff --git a/chromeos/login/auth/auth_status_consumer.h b/chromeos/login/auth/auth_status_consumer.h index 86c1b57..0c1158b 100644 --- a/chromeos/login/auth/auth_status_consumer.h +++ b/chromeos/login/auth/auth_status_consumer.h
@@ -121,7 +121,8 @@ // The same password didn't work both online and offline. virtual void OnPasswordChangeDetected(); // The cryptohome is encrypted in old format and needs migration. - virtual void OnOldEncryptionDetected(const UserContext& user_context); + virtual void OnOldEncryptionDetected(const UserContext& user_context, + bool has_incomplete_migration); }; } // namespace chromeos
diff --git a/chromeos/login/auth/cryptohome_authenticator.cc b/chromeos/login/auth/cryptohome_authenticator.cc index a301fccc..a4f98d2 100644 --- a/chromeos/login/auth/cryptohome_authenticator.cc +++ b/chromeos/login/auth/cryptohome_authenticator.cc
@@ -660,10 +660,13 @@ consumer_->OnPasswordChangeDetected(); } -void CryptohomeAuthenticator::OnOldEncryptionDetected() { +void CryptohomeAuthenticator::OnOldEncryptionDetected( + bool has_incomplete_migration) { DCHECK(task_runner_->RunsTasksOnCurrentThread()); - if (consumer_) - consumer_->OnOldEncryptionDetected(current_state_->user_context); + if (consumer_) { + consumer_->OnOldEncryptionDetected(current_state_->user_context, + has_incomplete_migration); + } } void CryptohomeAuthenticator::OnAuthFailure(const AuthFailure& error) { @@ -865,12 +868,14 @@ break; } case FAILED_OLD_ENCRYPTION: + case FAILED_PREVIOUS_MIGRATION_INCOMPLETE: // In this case, we tried to create/mount cryptohome and failed // because the file system is encrypted in old format. // Chrome will show a screen which asks user to migrate the encryption. task_runner_->PostTask( FROM_HERE, - base::Bind(&CryptohomeAuthenticator::OnOldEncryptionDetected, this)); + base::Bind(&CryptohomeAuthenticator::OnOldEncryptionDetected, this, + state == FAILED_PREVIOUS_MIGRATION_INCOMPLETE)); break; default: NOTREACHED(); @@ -948,6 +953,10 @@ cryptohome::MOUNT_ERROR_OLD_ENCRYPTION) { return FAILED_OLD_ENCRYPTION; } + if (current_state_->cryptohome_code() == + cryptohome::MOUNT_ERROR_PREVIOUS_MIGRATION_INCOMPLETE) { + return FAILED_PREVIOUS_MIGRATION_INCOMPLETE; + } // Return intermediate states in the following case: // when there is an online result to use;
diff --git a/chromeos/login/auth/cryptohome_authenticator.h b/chromeos/login/auth/cryptohome_authenticator.h index a1286e0..3743fde 100644 --- a/chromeos/login/auth/cryptohome_authenticator.h +++ b/chromeos/login/auth/cryptohome_authenticator.h
@@ -92,6 +92,9 @@ // cryptohome after a login failure. FAILED_OLD_ENCRYPTION = 24, // Login failed, cryptohome is encrypted // in old format. + FAILED_PREVIOUS_MIGRATION_INCOMPLETE = 25, // Login failed, cryptohome is + // partially encrypted in old + // format. }; CryptohomeAuthenticator(scoped_refptr<base::TaskRunner> task_runner, @@ -165,7 +168,7 @@ void OnOffTheRecordAuthSuccess(); void OnPasswordChangeDetected(); - void OnOldEncryptionDetected(); + void OnOldEncryptionDetected(bool has_incomplete_migration); protected: ~CryptohomeAuthenticator() override;
diff --git a/chromeos/login/auth/login_performer.cc b/chromeos/login/auth/login_performer.cc index c4376c2..e35c436 100644 --- a/chromeos/login/auth/login_performer.cc +++ b/chromeos/login/auth/login_performer.cc
@@ -107,11 +107,12 @@ } } -void LoginPerformer::OnOldEncryptionDetected(const UserContext& user_context) { +void LoginPerformer::OnOldEncryptionDetected(const UserContext& user_context, + bool has_incomplete_migration) { DCHECK(task_runner_->RunsTasksOnCurrentThread()); if (delegate_) - delegate_->OnOldEncryptionDetected(user_context); + delegate_->OnOldEncryptionDetected(user_context, has_incomplete_migration); else NOTREACHED(); }
diff --git a/chromeos/login/auth/login_performer.h b/chromeos/login/auth/login_performer.h index 1c79a848..fce862a 100644 --- a/chromeos/login/auth/login_performer.h +++ b/chromeos/login/auth/login_performer.h
@@ -91,7 +91,8 @@ void OnAuthSuccess(const UserContext& user_context) override; void OnOffTheRecordAuthSuccess() override; void OnPasswordChangeDetected() override; - void OnOldEncryptionDetected(const UserContext& user_context) override; + void OnOldEncryptionDetected(const UserContext& user_context, + bool has_incomplete_migration) override; // Migrates cryptohome using |old_password| specified. void RecoverEncryptedData(const std::string& old_password);
diff --git a/components/safe_browsing/password_protection/password_protection_service.cc b/components/safe_browsing/password_protection/password_protection_service.cc index 941c9092..1190cde 100644 --- a/components/safe_browsing/password_protection/password_protection_service.cc +++ b/components/safe_browsing/password_protection/password_protection_service.cc
@@ -335,6 +335,8 @@ // We might revisit this logic later to decide if we want to only delete the // cached verdict whose cache expression matches this URL. for (const history::URLRow& row : deleted_rows) { + if (!row.url().SchemeIsHTTPOrHTTPS()) + continue; GURL url_key = GetHostNameWithHTTPScheme(row.url()); std::unique_ptr<base::DictionaryValue> verdict_dictionary = base::DictionaryValue::From(content_settings_->GetWebsiteSetting(
diff --git a/components/safe_browsing/password_protection/password_protection_service_unittest.cc b/components/safe_browsing/password_protection/password_protection_service_unittest.cc index 3bef5dc..022fa2c 100644 --- a/components/safe_browsing/password_protection/password_protection_service_unittest.cc +++ b/components/safe_browsing/password_protection/password_protection_service_unittest.cc
@@ -447,6 +447,11 @@ // origin "http://bar.com" should be removed, history::URLRows deleted_urls; deleted_urls.push_back(history::URLRow(GURL("http://bar.com"))); + + // Delete an arbitrary data URL, to ensure the service is robust against + // filtering only http/s URLs. See crbug.com/709758. + deleted_urls.push_back(history::URLRow(GURL("data:text/html, <p>hellow"))); + password_protection_service_->RemoveContentSettingsOnURLsDeleted( false /* all_history */, deleted_urls); EXPECT_EQ(1U, GetStoredVerdictCount());
diff --git a/components/update_client/OWNERS b/components/update_client/OWNERS index 75e2f4d..ddb2169c 100644 --- a/components/update_client/OWNERS +++ b/components/update_client/OWNERS
@@ -1,4 +1,3 @@ -asargent@chromium.org cpu@chromium.org sorin@chromium.org waffles@chromium.org
diff --git a/content/test/data/accessibility/html/iframe-transform-expected-blink.txt b/content/test/data/accessibility/html/iframe-transform-expected-blink.txt index 75d1a94..6ebd249 100644 --- a/content/test/data/accessibility/html/iframe-transform-expected-blink.txt +++ b/content/test/data/accessibility/html/iframe-transform-expected-blink.txt
@@ -4,4 +4,4 @@ ++++++image pageLocation=(10, 10) pageSize=(200, 200) ++iframe pageLocation=(0, 300) transform ++++rootWebArea pageLocation=(0, 300) -++++++image pageLocation=(20, 320) pageSize=(400, 400) +++++++image pageLocation=(20, 320) pageSize=(400, 400) \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-transform-expected-win.txt b/content/test/data/accessibility/html/iframe-transform-expected-win.txt new file mode 100644 index 0000000..64f1cee --- /dev/null +++ b/content/test/data/accessibility/html/iframe-transform-expected-win.txt
@@ -0,0 +1,7 @@ +ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE location=(0, 0) size=(800, 800) +++IA2_ROLE_INTERNAL_FRAME READONLY location=(0, 0) size=(250, 250) +++++ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE location=(0, 0) size=(250, 250) +++++++ROLE_SYSTEM_GRAPHIC READONLY location=(10, 10) size=(200, 200) +++IA2_ROLE_INTERNAL_FRAME READONLY location=(0, 300) size=(500, 500) +++++ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE location=(0, 300) size=(500, 500) +++++++ROLE_SYSTEM_GRAPHIC READONLY location=(20, 320) size=(400, 400) \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-transform.html b/content/test/data/accessibility/html/iframe-transform.html index ebb01e7d..3adeae1 100644 --- a/content/test/data/accessibility/html/iframe-transform.html +++ b/content/test/data/accessibility/html/iframe-transform.html
@@ -1,4 +1,7 @@ <!-- +@WIN-ALLOW:location* +@WIN-ALLOW:size* + @BLINK-ALLOW:pageLocation* @BLINK-ALLOW:pageSize=(200, 200) @BLINK-ALLOW:pageSize=(400, 400) @@ -6,8 +9,8 @@ --> <!DOCTYPE html> <html> -<body style="padding: 0; margin: 0;"> +<body style="padding: 0; margin: 0; width: 800px; height: 800px"> <iframe width=250 height=250 src="frame/box.html" style="border: 0; position: absolute; top: 0px; left: 0px;"></iframe> <iframe width=250 height=250 src="frame/box.html" style="border: 0; position: absolute; top: 300px; left: 0px; transform: scale(2.0); transform-origin: left top;"></iframe> </body> -</html> +</html> \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe.html b/content/test/data/accessibility/html/iframe.html index 82e8cd63..3b586b1 100644 --- a/content/test/data/accessibility/html/iframe.html +++ b/content/test/data/accessibility/html/iframe.html
@@ -8,4 +8,4 @@ <iframe aria-label="Empty iframe" src="frame/empty.html"> </iframe> </body> -</html> +</html> \ No newline at end of file
diff --git a/gpu/ipc/service/child_window_surface_win.cc b/gpu/ipc/service/child_window_surface_win.cc index 93308d4d..b3dc4a99 100644 --- a/gpu/ipc/service/child_window_surface_win.cc +++ b/gpu/ipc/service/child_window_surface_win.cc
@@ -21,9 +21,10 @@ namespace gpu { ChildWindowSurfaceWin::ChildWindowSurfaceWin( + std::unique_ptr<gfx::VSyncProvider> vsync_provider, base::WeakPtr<ImageTransportSurfaceDelegate> delegate, HWND parent_window) - : gl::NativeViewGLSurfaceEGL(0), + : gl::NativeViewGLSurfaceEGL(0, std::move(vsync_provider)), child_window_(delegate, parent_window), alpha_(true), first_swap_(true) {
diff --git a/gpu/ipc/service/child_window_surface_win.h b/gpu/ipc/service/child_window_surface_win.h index 9f5017b..8304cd1 100644 --- a/gpu/ipc/service/child_window_surface_win.h +++ b/gpu/ipc/service/child_window_surface_win.h
@@ -16,7 +16,8 @@ class ChildWindowSurfaceWin : public gl::NativeViewGLSurfaceEGL { public: - ChildWindowSurfaceWin(base::WeakPtr<ImageTransportSurfaceDelegate> delegate, + ChildWindowSurfaceWin(std::unique_ptr<gfx::VSyncProvider> vsync_provider, + base::WeakPtr<ImageTransportSurfaceDelegate> delegate, HWND parent_window); // GLSurface implementation.
diff --git a/gpu/ipc/service/direct_composition_surface_win.cc b/gpu/ipc/service/direct_composition_surface_win.cc index c54a894a..a28ad40 100644 --- a/gpu/ipc/service/direct_composition_surface_win.cc +++ b/gpu/ipc/service/direct_composition_surface_win.cc
@@ -649,9 +649,12 @@ } DirectCompositionSurfaceWin::DirectCompositionSurfaceWin( + std::unique_ptr<gfx::VSyncProvider> vsync_provider, base::WeakPtr<ImageTransportSurfaceDelegate> delegate, HWND parent_window) - : gl::GLSurfaceEGL(), child_window_(delegate, parent_window) {} + : gl::GLSurfaceEGL(), + child_window_(delegate, parent_window), + vsync_provider_(std::move(vsync_provider)) {} DirectCompositionSurfaceWin::~DirectCompositionSurfaceWin() { Destroy(); @@ -709,12 +712,6 @@ return result; } -bool DirectCompositionSurfaceWin::Initialize( - std::unique_ptr<gfx::VSyncProvider> vsync_provider) { - vsync_provider_ = std::move(vsync_provider); - return Initialize(gl::GLSurfaceFormat()); -} - bool DirectCompositionSurfaceWin::Initialize(gl::GLSurfaceFormat format) { d3d11_device_ = gl::QueryD3D11DeviceObjectFromANGLE(); dcomp_device_ = gl::QueryDirectCompositionDevice(d3d11_device_);
diff --git a/gpu/ipc/service/direct_composition_surface_win.h b/gpu/ipc/service/direct_composition_surface_win.h index 5fa3d375..2402a99 100644 --- a/gpu/ipc/service/direct_composition_surface_win.h +++ b/gpu/ipc/service/direct_composition_surface_win.h
@@ -24,6 +24,7 @@ class GPU_EXPORT DirectCompositionSurfaceWin : public gl::GLSurfaceEGL { public: DirectCompositionSurfaceWin( + std::unique_ptr<gfx::VSyncProvider> vsync_provider, base::WeakPtr<ImageTransportSurfaceDelegate> delegate, HWND parent_window); @@ -61,8 +62,6 @@ // tree at z-order 0. bool ScheduleDCLayer(const ui::DCRendererLayerParams& params) override; - bool Initialize(std::unique_ptr<gfx::VSyncProvider> vsync_provider); - const base::win::ScopedComPtr<IDCompositionSurface>& dcomp_surface() const { return dcomp_surface_; }
diff --git a/gpu/ipc/service/direct_composition_surface_win_unittest.cc b/gpu/ipc/service/direct_composition_surface_win_unittest.cc index e9640208..fcc34d8 100644 --- a/gpu/ipc/service/direct_composition_surface_win_unittest.cc +++ b/gpu/ipc/service/direct_composition_surface_win_unittest.cc
@@ -130,7 +130,7 @@ TestImageTransportSurfaceDelegate delegate; scoped_refptr<DirectCompositionSurfaceWin> surface1( - new DirectCompositionSurfaceWin(delegate.AsWeakPtr(), + new DirectCompositionSurfaceWin(nullptr, delegate.AsWeakPtr(), ui::GetHiddenWindow())); EXPECT_TRUE(surface1->Initialize()); surface1->SetEnableDCLayers(true); @@ -162,7 +162,7 @@ EXPECT_TRUE(context1->IsCurrent(surface1.get())); scoped_refptr<DirectCompositionSurfaceWin> surface2( - new DirectCompositionSurfaceWin(delegate.AsWeakPtr(), + new DirectCompositionSurfaceWin(nullptr, delegate.AsWeakPtr(), ui::GetHiddenWindow())); EXPECT_TRUE(surface2->Initialize()); @@ -194,7 +194,7 @@ TestImageTransportSurfaceDelegate delegate; scoped_refptr<DirectCompositionSurfaceWin> surface( - new DirectCompositionSurfaceWin(delegate.AsWeakPtr(), + new DirectCompositionSurfaceWin(nullptr, delegate.AsWeakPtr(), ui::GetHiddenWindow())); EXPECT_TRUE(surface->Initialize()); @@ -248,7 +248,7 @@ TestImageTransportSurfaceDelegate delegate; scoped_refptr<DirectCompositionSurfaceWin> surface( - new DirectCompositionSurfaceWin(delegate.AsWeakPtr(), + new DirectCompositionSurfaceWin(nullptr, delegate.AsWeakPtr(), ui::GetHiddenWindow())); EXPECT_TRUE(surface->Initialize()); @@ -289,7 +289,7 @@ TestImageTransportSurfaceDelegate delegate; scoped_refptr<DirectCompositionSurfaceWin> surface( - new DirectCompositionSurfaceWin(delegate.AsWeakPtr(), + new DirectCompositionSurfaceWin(nullptr, delegate.AsWeakPtr(), ui::GetHiddenWindow())); EXPECT_TRUE(surface->Initialize()); surface->SetEnableDCLayers(true); @@ -396,8 +396,8 @@ void InitializeSurface() { static_cast<ui::PlatformWindow*>(&window_)->Show(); - surface_ = - new DirectCompositionSurfaceWin(delegate_.AsWeakPtr(), window_.hwnd()); + surface_ = new DirectCompositionSurfaceWin(nullptr, delegate_.AsWeakPtr(), + window_.hwnd()); EXPECT_TRUE(surface_->Initialize()); }
diff --git a/gpu/ipc/service/image_transport_surface_android.cc b/gpu/ipc/service/image_transport_surface_android.cc index a80e364ec..7c0e9334 100644 --- a/gpu/ipc/service/image_transport_surface_android.cc +++ b/gpu/ipc/service/image_transport_surface_android.cc
@@ -30,7 +30,8 @@ LOG(WARNING) << "Failed to acquire native widget."; return nullptr; } - scoped_refptr<gl::GLSurface> surface = new gl::NativeViewGLSurfaceEGL(window); + scoped_refptr<gl::GLSurface> surface = + new gl::NativeViewGLSurfaceEGL(window, nullptr); bool initialize_success = surface->Initialize(format); ANativeWindow_release(window); if (!initialize_success)
diff --git a/gpu/ipc/service/image_transport_surface_win.cc b/gpu/ipc/service/image_transport_surface_win.cc index fcba271..495a583 100644 --- a/gpu/ipc/service/image_transport_surface_win.cc +++ b/gpu/ipc/service/image_transport_surface_win.cc
@@ -56,15 +56,16 @@ overlays_supported); if (overlays_supported) { scoped_refptr<DirectCompositionSurfaceWin> egl_surface = - make_scoped_refptr( - new DirectCompositionSurfaceWin(delegate, surface_handle)); - if (!egl_surface->Initialize(std::move(vsync_provider))) + make_scoped_refptr(new DirectCompositionSurfaceWin( + std::move(vsync_provider), delegate, surface_handle)); + if (!egl_surface->Initialize()) return nullptr; surface = egl_surface; } else { - scoped_refptr<ChildWindowSurfaceWin> egl_surface = make_scoped_refptr( - new ChildWindowSurfaceWin(delegate, surface_handle)); - if (!egl_surface->Initialize(std::move(vsync_provider))) + scoped_refptr<ChildWindowSurfaceWin> egl_surface = + make_scoped_refptr(new ChildWindowSurfaceWin( + std::move(vsync_provider), delegate, surface_handle)); + if (!egl_surface->Initialize()) return nullptr; surface = egl_surface; }
diff --git a/media/base/android/java/src/org/chromium/media/MediaDrmStorageBridge.java b/media/base/android/java/src/org/chromium/media/MediaDrmStorageBridge.java index 92c90ac..1235a47 100644 --- a/media/base/android/java/src/org/chromium/media/MediaDrmStorageBridge.java +++ b/media/base/android/java/src/org/chromium/media/MediaDrmStorageBridge.java
@@ -8,6 +8,7 @@ import android.os.Build; import org.chromium.base.Callback; +import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.MainDex; @@ -37,20 +38,28 @@ // Mime type for the license. private final String mMimeType; + @CalledByNative("PersistentInfo") + private static PersistentInfo create(byte[] emeId, byte[] keySetId, String mime) { + return new PersistentInfo(emeId, keySetId, mime); + } + PersistentInfo(byte[] emeId, byte[] keySetId, String mime) { mEmeId = emeId; mKeySetId = keySetId; mMimeType = mime; } + @CalledByNative("PersistentInfo") byte[] emeId() { return mEmeId; } + @CalledByNative("PersistentInfo") byte[] keySetId() { return mKeySetId; } + @CalledByNative("PersistentInfo") String mimeType() { return mMimeType; }
diff --git a/media/base/android/media_drm_bridge.cc b/media/base/android/media_drm_bridge.cc index 4ec2eed..27a2bdf 100644 --- a/media/base/android/media_drm_bridge.cc +++ b/media/base/android/media_drm_bridge.cc
@@ -32,7 +32,9 @@ #include "media/base/cdm_key_information.h" #include "media/base/media_switches.h" #include "media/base/provision_fetcher.h" -#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. + +// In SHARED_INTERMEDIATE_DIR +#include "widevine_cdm_version.h" // NOLINT(build/include) using base::android::AttachCurrentThread; using base::android::ConvertUTF8ToJavaString; @@ -801,8 +803,8 @@ const SessionKeysChangeCB& session_keys_change_cb, const SessionExpirationUpdateCB& session_expiration_update_cb) : scheme_uuid_(scheme_uuid), + storage_(url::Origin(security_origin), create_storage_cb), create_fetcher_cb_(create_fetcher_cb), - create_storage_cb_(create_storage_cb), session_message_cb_(session_message_cb), session_closed_cb_(session_closed_cb), session_keys_change_cb_(session_keys_change_cb), @@ -896,8 +898,8 @@ return; // We have to use scoped_ptr to pass ScopedJavaGlobalRef with a callback. - // TODO(yucliu): Check whether we can simply pass j_media_crypto_->obj() in the - // callback. + // TODO(yucliu): Check whether we can simply pass j_media_crypto_->obj() in + // the callback. base::ResetAndReturn(&media_crypto_ready_cb_) .Run(CreateJavaObjectPtr(j_media_crypto_->obj()), IsProtectedSurfaceRequired());
diff --git a/media/base/android/media_drm_bridge.h b/media/base/android/media_drm_bridge.h index d86ee79..6dc26a45 100644 --- a/media/base/android/media_drm_bridge.h +++ b/media/base/android/media_drm_bridge.h
@@ -311,9 +311,6 @@ // The callback to create a ProvisionFetcher. CreateFetcherCB create_fetcher_cb_; - // The callback to create a MediaDrmStorage. - CreateStorageCB create_storage_cb_; - // The ProvisionFetcher that requests and receives provisioning data. // Non-null iff when a provision request is pending. std::unique_ptr<ProvisionFetcher> provision_fetcher_;
diff --git a/media/base/android/media_drm_storage.cc b/media/base/android/media_drm_storage.cc index 4c81199..03e129c 100644 --- a/media/base/android/media_drm_storage.cc +++ b/media/base/android/media_drm_storage.cc
@@ -12,6 +12,8 @@ std::string mime_type) : key_set_id(std::move(key_set_id)), mime_type(std::move(mime_type)) {} +MediaDrmStorage::SessionData::SessionData(const SessionData& other) = default; + MediaDrmStorage::SessionData::~SessionData() {} MediaDrmStorage::MediaDrmStorage() {}
diff --git a/media/base/android/media_drm_storage.h b/media/base/android/media_drm_storage.h index c21a418..a71c207c 100644 --- a/media/base/android/media_drm_storage.h +++ b/media/base/android/media_drm_storage.h
@@ -13,6 +13,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "media/base/media_export.h" #include "url/origin.h" @@ -20,10 +21,12 @@ // Allows MediaDrmBridge to store and retrieve persistent data. This is needed // for features like per-origin provisioning and persistent license support. -class MEDIA_EXPORT MediaDrmStorage { +class MEDIA_EXPORT MediaDrmStorage + : public base::SupportsWeakPtr<MediaDrmStorage> { public: struct SessionData { SessionData(std::vector<uint8_t> key_set_id, std::string mime_type); + SessionData(const SessionData& other); ~SessionData(); std::vector<uint8_t> key_set_id;
diff --git a/media/base/android/media_drm_storage_bridge.cc b/media/base/android/media_drm_storage_bridge.cc index a9b6047c..8640ed607 100644 --- a/media/base/android/media_drm_storage_bridge.cc +++ b/media/base/android/media_drm_storage_bridge.cc
@@ -5,15 +5,26 @@ #include "media/base/android/media_drm_storage_bridge.h" #include <memory> +#include <string> +#include <utility> +#include <vector> #include "base/android/callback_android.h" +#include "base/android/jni_array.h" +#include "base/android/jni_string.h" +#include "base/bind.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "jni/MediaDrmStorageBridge_jni.h" +#include "media/base/android/android_util.h" +using base::android::AttachCurrentThread; +using base::android::ConvertUTF8ToJavaString; +using base::android::JavaByteArrayToByteVector; using base::android::JavaParamRef; using base::android::RunCallbackAndroid; using base::android::ScopedJavaLocalRef; +using base::android::ToJavaByteArray; namespace media { @@ -22,21 +33,30 @@ return RegisterNativesImpl(env); } -MediaDrmStorageBridge::MediaDrmStorageBridge() - : task_runner_(base::ThreadTaskRunnerHandle::Get()), weak_factory_(this) {} +MediaDrmStorageBridge::MediaDrmStorageBridge( + const url::Origin& origin, + const CreateStorageCB& create_storage_cb) + : create_storage_cb_(create_storage_cb), + origin_(origin), + task_runner_(base::ThreadTaskRunnerHandle::Get()), + weak_factory_(this) {} MediaDrmStorageBridge::~MediaDrmStorageBridge() = default; -// TODO(yucliu): Implement these methods with MediaDrmStorage - void MediaDrmStorageBridge::OnProvisioned( JNIEnv* env, const JavaParamRef<jobject>& j_storage, // Callback<Boolean> const JavaParamRef<jobject>& j_callback) { - NOTIMPLEMENTED(); - - RunCallbackAndroid(j_callback, true); + task_runner_->PostTask( + FROM_HERE, + base::BindOnce( + &MediaDrmStorage::OnProvisioned, GetStorageImpl()->AsWeakPtr(), + base::BindOnce(&MediaDrmStorageBridge::RunAndroidBoolCallback, + // Bind callback to WeakPtr in case callback is called + // after object is deleted. + weak_factory_.GetWeakPtr(), + base::Passed(CreateJavaObjectPtr(j_callback.obj()))))); } void MediaDrmStorageBridge::OnLoadInfo( @@ -45,9 +65,16 @@ const JavaParamRef<jbyteArray>& j_session_id, // Callback<PersistentInfo> const JavaParamRef<jobject>& j_callback) { - NOTIMPLEMENTED(); - - RunCallbackAndroid(j_callback, ScopedJavaLocalRef<jobject>()); + std::string session_id = JavaBytesToString(env, j_session_id); + task_runner_->PostTask( + FROM_HERE, + base::BindOnce( + &MediaDrmStorage::LoadPersistentSession, + GetStorageImpl()->AsWeakPtr(), session_id, + base::BindOnce(&MediaDrmStorageBridge::OnSessionDataLoaded, + weak_factory_.GetWeakPtr(), + base::Passed(CreateJavaObjectPtr(j_callback.obj())), + session_id))); } void MediaDrmStorageBridge::OnSaveInfo( @@ -56,9 +83,26 @@ const JavaParamRef<jobject>& j_persist_info, // Callback<Boolean> const JavaParamRef<jobject>& j_callback) { - NOTIMPLEMENTED(); + std::vector<uint8_t> key_set_id; + JavaByteArrayToByteVector( + env, Java_PersistentInfo_keySetId(env, j_persist_info.obj()).obj(), + &key_set_id); - RunCallbackAndroid(j_callback, false); + std::string mime = ConvertJavaStringToUTF8( + env, Java_PersistentInfo_mimeType(env, j_persist_info.obj())); + + std::string session_id = JavaBytesToString( + env, Java_PersistentInfo_emeId(env, j_persist_info.obj()).obj()); + + task_runner_->PostTask( + FROM_HERE, + base::BindOnce( + &MediaDrmStorage::SavePersistentSession, + GetStorageImpl()->AsWeakPtr(), session_id, + MediaDrmStorage::SessionData(std::move(key_set_id), std::move(mime)), + base::BindOnce(&MediaDrmStorageBridge::RunAndroidBoolCallback, + weak_factory_.GetWeakPtr(), + base::Passed(CreateJavaObjectPtr(j_callback.obj()))))); } void MediaDrmStorageBridge::OnClearInfo( @@ -67,8 +111,49 @@ const JavaParamRef<jbyteArray>& j_session_id, // Callback<Boolean> const JavaParamRef<jobject>& j_callback) { - NOTIMPLEMENTED(); - - RunCallbackAndroid(j_callback, false); + task_runner_->PostTask( + FROM_HERE, + base::BindOnce( + &MediaDrmStorage::RemovePersistentSession, + GetStorageImpl()->AsWeakPtr(), JavaBytesToString(env, j_session_id), + base::BindOnce(&MediaDrmStorageBridge::RunAndroidBoolCallback, + weak_factory_.GetWeakPtr(), + base::Passed(CreateJavaObjectPtr(j_callback.obj()))))); } + +void MediaDrmStorageBridge::RunAndroidBoolCallback(JavaObjectPtr j_callback, + bool success) { + RunCallbackAndroid(*j_callback, success); +} + +void MediaDrmStorageBridge::OnSessionDataLoaded( + JavaObjectPtr j_callback, + const std::string& session_id, + std::unique_ptr<MediaDrmStorage::SessionData> session_data) { + if (!session_data) { + RunCallbackAndroid(*j_callback, ScopedJavaLocalRef<jobject>()); + return; + } + + JNIEnv* env = AttachCurrentThread(); + ScopedJavaLocalRef<jbyteArray> j_eme_id = StringToJavaBytes(env, session_id); + ScopedJavaLocalRef<jbyteArray> j_key_set_id = ToJavaByteArray( + env, session_data->key_set_id.data(), session_data->key_set_id.size()); + ScopedJavaLocalRef<jstring> j_mime = + ConvertUTF8ToJavaString(env, session_data->mime_type); + + RunCallbackAndroid(*j_callback, Java_PersistentInfo_create( + env, j_eme_id, j_key_set_id, j_mime)); +} + +MediaDrmStorage* MediaDrmStorageBridge::GetStorageImpl() { + if (!impl_) { + DCHECK(create_storage_cb_); + impl_ = std::move(create_storage_cb_).Run(); + impl_->Initialize(origin_); + } + + return impl_.get(); +} + } // namespace media
diff --git a/media/base/android/media_drm_storage_bridge.h b/media/base/android/media_drm_storage_bridge.h index 08072f7..955e570 100644 --- a/media/base/android/media_drm_storage_bridge.h +++ b/media/base/android/media_drm_storage_bridge.h
@@ -7,10 +7,15 @@ #include <jni.h> #include <memory> +#include <string> #include "base/android/scoped_java_ref.h" +#include "base/callback.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" +#include "media/base/android/android_util.h" +#include "media/base/android/media_drm_storage.h" +#include "url/origin.h" namespace base { class SingleThreadTaskRunner; @@ -24,7 +29,8 @@ public: static bool RegisterMediaDrmStorageBridge(JNIEnv* env); - MediaDrmStorageBridge(); + MediaDrmStorageBridge(const url::Origin& origin, + const CreateStorageCB& create_storage_cb); ~MediaDrmStorageBridge(); // The following OnXXX functions are called by Java. The functions will post @@ -61,9 +67,21 @@ const base::android::JavaParamRef<jobject>& j_callback); private: + void RunAndroidBoolCallback(JavaObjectPtr j_callback, bool success); + void OnSessionDataLoaded( + JavaObjectPtr j_callback, + const std::string& session_id, + std::unique_ptr<MediaDrmStorage::SessionData> session_data); + + MediaDrmStorage* GetStorageImpl(); + + CreateStorageCB create_storage_cb_; + std::unique_ptr<MediaDrmStorage> impl_; + + const url::Origin origin_; + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; - // NOTE: Weak pointers must be invalidated before all other member variables. base::WeakPtrFactory<MediaDrmStorageBridge> weak_factory_; DISALLOW_COPY_AND_ASSIGN(MediaDrmStorageBridge);
diff --git a/media/base/mac/video_frame_mac.cc b/media/base/mac/video_frame_mac.cc index 2f06aab..e299bf2f 100644 --- a/media/base/mac/video_frame_mac.cc +++ b/media/base/mac/video_frame_mac.cc
@@ -35,8 +35,8 @@ base::ScopedCFTypeRef<CVPixelBufferRef> pixel_buffer; // If the frame is backed by a pixel buffer, just return that buffer. - if (frame.cv_pixel_buffer()) { - pixel_buffer.reset(frame.cv_pixel_buffer(), base::scoped_policy::RETAIN); + if (frame.CvPixelBuffer()) { + pixel_buffer.reset(frame.CvPixelBuffer(), base::scoped_policy::RETAIN); return pixel_buffer; }
diff --git a/media/base/mac/video_frame_mac_unittests.cc b/media/base/mac/video_frame_mac_unittests.cc index 0229784..7f2105b 100644 --- a/media/base/mac/video_frame_mac_unittests.cc +++ b/media/base/mac/video_frame_mac_unittests.cc
@@ -123,7 +123,7 @@ auto frame = VideoFrame::WrapCVPixelBuffer(pb.get(), kTimestamp); ASSERT_TRUE(frame.get()); - EXPECT_EQ(pb.get(), frame->cv_pixel_buffer()); + EXPECT_EQ(pb.get(), frame->CvPixelBuffer()); EXPECT_EQ(format_pair.chrome, frame->format()); frame = nullptr;
diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc index ea11b54a..5148d00 100644 --- a/media/base/video_frame.cc +++ b/media/base/video_frame.cc
@@ -441,7 +441,7 @@ if (frame->storage_type() == STORAGE_DMABUFS) { std::vector<int> original_fds; for (size_t i = 0; i < kMaxPlanes; ++i) - original_fds.push_back(frame->dmabuf_fd(i)); + original_fds.push_back(frame->DmabufFd(i)); if (!wrapping_frame->DuplicateFileDescriptors(original_fds)) { LOG(DFATAL) << __func__ << " Couldn't duplicate fds."; return nullptr; @@ -723,7 +723,7 @@ } #if defined(OS_LINUX) -int VideoFrame::dmabuf_fd(size_t plane) const { +int VideoFrame::DmabufFd(size_t plane) const { DCHECK_EQ(storage_type_, STORAGE_DMABUFS); DCHECK(IsValidPlane(plane, format_)); return dmabuf_fds_[plane].get(); @@ -763,7 +763,7 @@ } #if defined(OS_MACOSX) -CVPixelBufferRef VideoFrame::cv_pixel_buffer() const { +CVPixelBufferRef VideoFrame::CvPixelBuffer() const { return cv_pixel_buffer_.get(); } #endif
diff --git a/media/base/video_frame.h b/media/base/video_frame.h index 0ae2d70..af488adf 100644 --- a/media/base/video_frame.h +++ b/media/base/video_frame.h
@@ -63,8 +63,10 @@ STORAGE_OWNED_MEMORY = 3, // VideoFrame has allocated its own data buffer. STORAGE_SHMEM = 4, // Pixels are backed by Shared Memory. #if defined(OS_LINUX) - // TODO(mcasas): Consider turning this type into STORAGE_NATIVE or another - // meaningful name and handle it appropriately in all cases. + // TODO(mcasas): Consider turning this type into STORAGE_NATIVE + // based on the idea of using this same enum value for both DMA + // buffers on Linux and CVPixelBuffers on Mac (which currently use + // STORAGE_UNOWNED_MEMORY) and handle it appropriately in all cases. STORAGE_DMABUFS = 5, // Each plane is stored into a DmaBuf. #endif STORAGE_MOJO_SHARED_BUFFER = 6, @@ -339,8 +341,7 @@ #if defined(OS_LINUX) // Returns backing DmaBuf file descriptor for given |plane|, if present, or // -1 if not. - // TODO(mcasas): Rename to DmabufFd() to comply with Style Guide. - int dmabuf_fd(size_t plane) const; + int DmabufFd(size_t plane) const; // Duplicates internally the |fds_in|, overwriting the current ones. Returns // false if something goes wrong, and leaves all internal fds closed. @@ -351,8 +352,7 @@ #if defined(OS_MACOSX) // Returns the backing CVPixelBuffer, if present. - // TODO(mcasas): Rename to CvPixelBuffer() to comply with Style Guide. - CVPixelBufferRef cv_pixel_buffer() const; + CVPixelBufferRef CvPixelBuffer() const; #endif // Sets the mailbox release callback.
diff --git a/media/cast/sender/h264_vt_encoder_unittest.cc b/media/cast/sender/h264_vt_encoder_unittest.cc index d5f6590..8fdf50ab 100644 --- a/media/cast/sender/h264_vt_encoder_unittest.cc +++ b/media/cast/sender/h264_vt_encoder_unittest.cc
@@ -181,7 +181,7 @@ video_frame_factory->MaybeCreateFrame( gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta()); ASSERT_TRUE(video_frame.get()); - auto* cv_pixel_buffer = video_frame->cv_pixel_buffer(); + auto* cv_pixel_buffer = video_frame->CvPixelBuffer(); ASSERT_TRUE(cv_pixel_buffer); CVPixelBufferLockBaseAddress(cv_pixel_buffer, 0); auto* ptr = CVPixelBufferGetBaseAddressOfPlane(cv_pixel_buffer, 0);
diff --git a/media/gpu/v4l2_image_processor.cc b/media/gpu/v4l2_image_processor.cc index 005c095d..bbbed74 100644 --- a/media/gpu/v4l2_image_processor.cc +++ b/media/gpu/v4l2_image_processor.cc
@@ -668,7 +668,7 @@ qbuf.m.planes[i].m.userptr = reinterpret_cast<unsigned long>(input_record.frame->data(i)); } else { - qbuf.m.planes[i].m.fd = input_record.frame->dmabuf_fd(i); + qbuf.m.planes[i].m.fd = input_record.frame->DmabufFd(i); } } IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QBUF, &qbuf);
diff --git a/media/gpu/v4l2_video_encode_accelerator.cc b/media/gpu/v4l2_video_encode_accelerator.cc index 7312a237..b09b6420 100644 --- a/media/gpu/v4l2_video_encode_accelerator.cc +++ b/media/gpu/v4l2_video_encode_accelerator.cc
@@ -767,7 +767,7 @@ break; case V4L2_MEMORY_DMABUF: - qbuf.m.planes[i].m.fd = frame->dmabuf_fd(i); + qbuf.m.planes[i].m.fd = frame->DmabufFd(i); DCHECK_NE(qbuf.m.planes[i].m.fd, -1); break;
diff --git a/testing/libfuzzer/fuzzers/BUILD.gn b/testing/libfuzzer/fuzzers/BUILD.gn index d0d323e..b1aca07 100644 --- a/testing/libfuzzer/fuzzers/BUILD.gn +++ b/testing/libfuzzer/fuzzers/BUILD.gn
@@ -409,6 +409,19 @@ } } +fuzzer_test("skia_color_space_fuzzer") { + sources = [ + "color_space_data.h", + "skia_color_space_fuzzer.cc", + ] + deps = [ + "//base", + "//skia", + ] + dict = "dicts/icc.dict" + libfuzzer_options = [ "max_len=4194304" ] +} + fuzzer_test("prtime_fuzzer") { sources = [ "prtime_fuzzer.cc",
diff --git a/testing/libfuzzer/fuzzers/color_space_data.h b/testing/libfuzzer/fuzzers/color_space_data.h new file mode 100644 index 0000000..0409e78 --- /dev/null +++ b/testing/libfuzzer/fuzzers/color_space_data.h
@@ -0,0 +1,379 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef TESTING_LIBFUZZER_FUZZERS_COLOR_SPACE_DATA_H +#define TESTING_LIBFUZZER_FUZZERS_COLOR_SPACE_DATA_H + +static const char kSRGBData[] = { + // sRGB profile with tabular gamma curves. + 0x00, 0x00, 0x0c, 0x48, 0x4c, 0x69, 0x6e, 0x6f, 0x02, 0x10, 0x00, 0x00, + 0x6d, 0x6e, 0x74, 0x72, 0x52, 0x47, 0x42, 0x20, 0x58, 0x59, 0x5a, 0x20, + 0x07, 0xce, 0x00, 0x02, 0x00, 0x09, 0x00, 0x06, 0x00, 0x31, 0x00, 0x00, + 0x61, 0x63, 0x73, 0x70, 0x4d, 0x53, 0x46, 0x54, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x43, 0x20, 0x73, 0x52, 0x47, 0x42, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xd6, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d, 0x48, 0x50, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, + 0x63, 0x70, 0x72, 0x74, 0x00, 0x00, 0x01, 0x50, 0x00, 0x00, 0x00, 0x33, + 0x64, 0x65, 0x73, 0x63, 0x00, 0x00, 0x01, 0x84, 0x00, 0x00, 0x00, 0x6c, + 0x77, 0x74, 0x70, 0x74, 0x00, 0x00, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x14, + 0x62, 0x6b, 0x70, 0x74, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x14, + 0x72, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x00, 0x14, + 0x67, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x02, 0x2c, 0x00, 0x00, 0x00, 0x14, + 0x62, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x14, + 0x64, 0x6d, 0x6e, 0x64, 0x00, 0x00, 0x02, 0x54, 0x00, 0x00, 0x00, 0x70, + 0x64, 0x6d, 0x64, 0x64, 0x00, 0x00, 0x02, 0xc4, 0x00, 0x00, 0x00, 0x88, + 0x76, 0x75, 0x65, 0x64, 0x00, 0x00, 0x03, 0x4c, 0x00, 0x00, 0x00, 0x86, + 0x76, 0x69, 0x65, 0x77, 0x00, 0x00, 0x03, 0xd4, 0x00, 0x00, 0x00, 0x24, + 0x6c, 0x75, 0x6d, 0x69, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x14, + 0x6d, 0x65, 0x61, 0x73, 0x00, 0x00, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x24, + 0x74, 0x65, 0x63, 0x68, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x00, 0x0c, + 0x72, 0x54, 0x52, 0x43, 0x00, 0x00, 0x04, 0x3c, 0x00, 0x00, 0x08, 0x0c, + 0x67, 0x54, 0x52, 0x43, 0x00, 0x00, 0x04, 0x3c, 0x00, 0x00, 0x08, 0x0c, + 0x62, 0x54, 0x52, 0x43, 0x00, 0x00, 0x04, 0x3c, 0x00, 0x00, 0x08, 0x0c, + 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x70, 0x79, + 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39, + 0x39, 0x38, 0x20, 0x48, 0x65, 0x77, 0x6c, 0x65, 0x74, 0x74, 0x2d, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x72, 0x64, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, + 0x6e, 0x79, 0x00, 0x00, 0x64, 0x65, 0x73, 0x63, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x12, 0x73, 0x52, 0x47, 0x42, 0x20, 0x49, 0x45, 0x43, + 0x36, 0x31, 0x39, 0x36, 0x36, 0x2d, 0x32, 0x2e, 0x31, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x73, 0x52, 0x47, + 0x42, 0x20, 0x49, 0x45, 0x43, 0x36, 0x31, 0x39, 0x36, 0x36, 0x2d, 0x32, + 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf3, 0x51, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x16, 0xcc, + 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x59, 0x5a, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xa2, 0x00, 0x00, 0x38, 0xf5, + 0x00, 0x00, 0x03, 0x90, 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x62, 0x99, 0x00, 0x00, 0xb7, 0x85, 0x00, 0x00, 0x18, 0xda, + 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0xa0, + 0x00, 0x00, 0x0f, 0x84, 0x00, 0x00, 0xb6, 0xcf, 0x64, 0x65, 0x73, 0x63, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x49, 0x45, 0x43, 0x20, + 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, + 0x65, 0x63, 0x2e, 0x63, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x16, 0x49, 0x45, 0x43, 0x20, 0x68, 0x74, 0x74, + 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x65, 0x63, 0x2e, + 0x63, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x64, 0x65, 0x73, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, + 0x49, 0x45, 0x43, 0x20, 0x36, 0x31, 0x39, 0x36, 0x36, 0x2d, 0x32, 0x2e, + 0x31, 0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x52, 0x47, + 0x42, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x75, 0x72, 0x20, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x20, 0x2d, 0x20, 0x73, 0x52, 0x47, 0x42, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x49, 0x45, 0x43, + 0x20, 0x36, 0x31, 0x39, 0x36, 0x36, 0x2d, 0x32, 0x2e, 0x31, 0x20, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x52, 0x47, 0x42, 0x20, 0x63, + 0x6f, 0x6c, 0x6f, 0x75, 0x72, 0x20, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, + 0x2d, 0x20, 0x73, 0x52, 0x47, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x64, 0x65, 0x73, 0x63, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x2c, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x20, 0x56, 0x69, 0x65, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x43, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x49, + 0x45, 0x43, 0x36, 0x31, 0x39, 0x36, 0x36, 0x2d, 0x32, 0x2e, 0x31, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x52, + 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x56, 0x69, 0x65, + 0x77, 0x69, 0x6e, 0x67, 0x20, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x49, 0x45, 0x43, 0x36, 0x31, 0x39, + 0x36, 0x36, 0x2d, 0x32, 0x2e, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x69, 0x65, 0x77, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0xa4, 0xfe, 0x00, 0x14, 0x5f, 0x2e, + 0x00, 0x10, 0xcf, 0x14, 0x00, 0x03, 0xed, 0xcc, 0x00, 0x04, 0x13, 0x0b, + 0x00, 0x03, 0x5c, 0x9e, 0x00, 0x00, 0x00, 0x01, 0x58, 0x59, 0x5a, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x09, 0x56, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x57, 0x1f, 0xe7, 0x6d, 0x65, 0x61, 0x73, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x8f, + 0x00, 0x00, 0x00, 0x02, 0x73, 0x69, 0x67, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x43, 0x52, 0x54, 0x20, 0x63, 0x75, 0x72, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x0f, + 0x00, 0x14, 0x00, 0x19, 0x00, 0x1e, 0x00, 0x23, 0x00, 0x28, 0x00, 0x2d, + 0x00, 0x32, 0x00, 0x37, 0x00, 0x3b, 0x00, 0x40, 0x00, 0x45, 0x00, 0x4a, + 0x00, 0x4f, 0x00, 0x54, 0x00, 0x59, 0x00, 0x5e, 0x00, 0x63, 0x00, 0x68, + 0x00, 0x6d, 0x00, 0x72, 0x00, 0x77, 0x00, 0x7c, 0x00, 0x81, 0x00, 0x86, + 0x00, 0x8b, 0x00, 0x90, 0x00, 0x95, 0x00, 0x9a, 0x00, 0x9f, 0x00, 0xa4, + 0x00, 0xa9, 0x00, 0xae, 0x00, 0xb2, 0x00, 0xb7, 0x00, 0xbc, 0x00, 0xc1, + 0x00, 0xc6, 0x00, 0xcb, 0x00, 0xd0, 0x00, 0xd5, 0x00, 0xdb, 0x00, 0xe0, + 0x00, 0xe5, 0x00, 0xeb, 0x00, 0xf0, 0x00, 0xf6, 0x00, 0xfb, 0x01, 0x01, + 0x01, 0x07, 0x01, 0x0d, 0x01, 0x13, 0x01, 0x19, 0x01, 0x1f, 0x01, 0x25, + 0x01, 0x2b, 0x01, 0x32, 0x01, 0x38, 0x01, 0x3e, 0x01, 0x45, 0x01, 0x4c, + 0x01, 0x52, 0x01, 0x59, 0x01, 0x60, 0x01, 0x67, 0x01, 0x6e, 0x01, 0x75, + 0x01, 0x7c, 0x01, 0x83, 0x01, 0x8b, 0x01, 0x92, 0x01, 0x9a, 0x01, 0xa1, + 0x01, 0xa9, 0x01, 0xb1, 0x01, 0xb9, 0x01, 0xc1, 0x01, 0xc9, 0x01, 0xd1, + 0x01, 0xd9, 0x01, 0xe1, 0x01, 0xe9, 0x01, 0xf2, 0x01, 0xfa, 0x02, 0x03, + 0x02, 0x0c, 0x02, 0x14, 0x02, 0x1d, 0x02, 0x26, 0x02, 0x2f, 0x02, 0x38, + 0x02, 0x41, 0x02, 0x4b, 0x02, 0x54, 0x02, 0x5d, 0x02, 0x67, 0x02, 0x71, + 0x02, 0x7a, 0x02, 0x84, 0x02, 0x8e, 0x02, 0x98, 0x02, 0xa2, 0x02, 0xac, + 0x02, 0xb6, 0x02, 0xc1, 0x02, 0xcb, 0x02, 0xd5, 0x02, 0xe0, 0x02, 0xeb, + 0x02, 0xf5, 0x03, 0x00, 0x03, 0x0b, 0x03, 0x16, 0x03, 0x21, 0x03, 0x2d, + 0x03, 0x38, 0x03, 0x43, 0x03, 0x4f, 0x03, 0x5a, 0x03, 0x66, 0x03, 0x72, + 0x03, 0x7e, 0x03, 0x8a, 0x03, 0x96, 0x03, 0xa2, 0x03, 0xae, 0x03, 0xba, + 0x03, 0xc7, 0x03, 0xd3, 0x03, 0xe0, 0x03, 0xec, 0x03, 0xf9, 0x04, 0x06, + 0x04, 0x13, 0x04, 0x20, 0x04, 0x2d, 0x04, 0x3b, 0x04, 0x48, 0x04, 0x55, + 0x04, 0x63, 0x04, 0x71, 0x04, 0x7e, 0x04, 0x8c, 0x04, 0x9a, 0x04, 0xa8, + 0x04, 0xb6, 0x04, 0xc4, 0x04, 0xd3, 0x04, 0xe1, 0x04, 0xf0, 0x04, 0xfe, + 0x05, 0x0d, 0x05, 0x1c, 0x05, 0x2b, 0x05, 0x3a, 0x05, 0x49, 0x05, 0x58, + 0x05, 0x67, 0x05, 0x77, 0x05, 0x86, 0x05, 0x96, 0x05, 0xa6, 0x05, 0xb5, + 0x05, 0xc5, 0x05, 0xd5, 0x05, 0xe5, 0x05, 0xf6, 0x06, 0x06, 0x06, 0x16, + 0x06, 0x27, 0x06, 0x37, 0x06, 0x48, 0x06, 0x59, 0x06, 0x6a, 0x06, 0x7b, + 0x06, 0x8c, 0x06, 0x9d, 0x06, 0xaf, 0x06, 0xc0, 0x06, 0xd1, 0x06, 0xe3, + 0x06, 0xf5, 0x07, 0x07, 0x07, 0x19, 0x07, 0x2b, 0x07, 0x3d, 0x07, 0x4f, + 0x07, 0x61, 0x07, 0x74, 0x07, 0x86, 0x07, 0x99, 0x07, 0xac, 0x07, 0xbf, + 0x07, 0xd2, 0x07, 0xe5, 0x07, 0xf8, 0x08, 0x0b, 0x08, 0x1f, 0x08, 0x32, + 0x08, 0x46, 0x08, 0x5a, 0x08, 0x6e, 0x08, 0x82, 0x08, 0x96, 0x08, 0xaa, + 0x08, 0xbe, 0x08, 0xd2, 0x08, 0xe7, 0x08, 0xfb, 0x09, 0x10, 0x09, 0x25, + 0x09, 0x3a, 0x09, 0x4f, 0x09, 0x64, 0x09, 0x79, 0x09, 0x8f, 0x09, 0xa4, + 0x09, 0xba, 0x09, 0xcf, 0x09, 0xe5, 0x09, 0xfb, 0x0a, 0x11, 0x0a, 0x27, + 0x0a, 0x3d, 0x0a, 0x54, 0x0a, 0x6a, 0x0a, 0x81, 0x0a, 0x98, 0x0a, 0xae, + 0x0a, 0xc5, 0x0a, 0xdc, 0x0a, 0xf3, 0x0b, 0x0b, 0x0b, 0x22, 0x0b, 0x39, + 0x0b, 0x51, 0x0b, 0x69, 0x0b, 0x80, 0x0b, 0x98, 0x0b, 0xb0, 0x0b, 0xc8, + 0x0b, 0xe1, 0x0b, 0xf9, 0x0c, 0x12, 0x0c, 0x2a, 0x0c, 0x43, 0x0c, 0x5c, + 0x0c, 0x75, 0x0c, 0x8e, 0x0c, 0xa7, 0x0c, 0xc0, 0x0c, 0xd9, 0x0c, 0xf3, + 0x0d, 0x0d, 0x0d, 0x26, 0x0d, 0x40, 0x0d, 0x5a, 0x0d, 0x74, 0x0d, 0x8e, + 0x0d, 0xa9, 0x0d, 0xc3, 0x0d, 0xde, 0x0d, 0xf8, 0x0e, 0x13, 0x0e, 0x2e, + 0x0e, 0x49, 0x0e, 0x64, 0x0e, 0x7f, 0x0e, 0x9b, 0x0e, 0xb6, 0x0e, 0xd2, + 0x0e, 0xee, 0x0f, 0x09, 0x0f, 0x25, 0x0f, 0x41, 0x0f, 0x5e, 0x0f, 0x7a, + 0x0f, 0x96, 0x0f, 0xb3, 0x0f, 0xcf, 0x0f, 0xec, 0x10, 0x09, 0x10, 0x26, + 0x10, 0x43, 0x10, 0x61, 0x10, 0x7e, 0x10, 0x9b, 0x10, 0xb9, 0x10, 0xd7, + 0x10, 0xf5, 0x11, 0x13, 0x11, 0x31, 0x11, 0x4f, 0x11, 0x6d, 0x11, 0x8c, + 0x11, 0xaa, 0x11, 0xc9, 0x11, 0xe8, 0x12, 0x07, 0x12, 0x26, 0x12, 0x45, + 0x12, 0x64, 0x12, 0x84, 0x12, 0xa3, 0x12, 0xc3, 0x12, 0xe3, 0x13, 0x03, + 0x13, 0x23, 0x13, 0x43, 0x13, 0x63, 0x13, 0x83, 0x13, 0xa4, 0x13, 0xc5, + 0x13, 0xe5, 0x14, 0x06, 0x14, 0x27, 0x14, 0x49, 0x14, 0x6a, 0x14, 0x8b, + 0x14, 0xad, 0x14, 0xce, 0x14, 0xf0, 0x15, 0x12, 0x15, 0x34, 0x15, 0x56, + 0x15, 0x78, 0x15, 0x9b, 0x15, 0xbd, 0x15, 0xe0, 0x16, 0x03, 0x16, 0x26, + 0x16, 0x49, 0x16, 0x6c, 0x16, 0x8f, 0x16, 0xb2, 0x16, 0xd6, 0x16, 0xfa, + 0x17, 0x1d, 0x17, 0x41, 0x17, 0x65, 0x17, 0x89, 0x17, 0xae, 0x17, 0xd2, + 0x17, 0xf7, 0x18, 0x1b, 0x18, 0x40, 0x18, 0x65, 0x18, 0x8a, 0x18, 0xaf, + 0x18, 0xd5, 0x18, 0xfa, 0x19, 0x20, 0x19, 0x45, 0x19, 0x6b, 0x19, 0x91, + 0x19, 0xb7, 0x19, 0xdd, 0x1a, 0x04, 0x1a, 0x2a, 0x1a, 0x51, 0x1a, 0x77, + 0x1a, 0x9e, 0x1a, 0xc5, 0x1a, 0xec, 0x1b, 0x14, 0x1b, 0x3b, 0x1b, 0x63, + 0x1b, 0x8a, 0x1b, 0xb2, 0x1b, 0xda, 0x1c, 0x02, 0x1c, 0x2a, 0x1c, 0x52, + 0x1c, 0x7b, 0x1c, 0xa3, 0x1c, 0xcc, 0x1c, 0xf5, 0x1d, 0x1e, 0x1d, 0x47, + 0x1d, 0x70, 0x1d, 0x99, 0x1d, 0xc3, 0x1d, 0xec, 0x1e, 0x16, 0x1e, 0x40, + 0x1e, 0x6a, 0x1e, 0x94, 0x1e, 0xbe, 0x1e, 0xe9, 0x1f, 0x13, 0x1f, 0x3e, + 0x1f, 0x69, 0x1f, 0x94, 0x1f, 0xbf, 0x1f, 0xea, 0x20, 0x15, 0x20, 0x41, + 0x20, 0x6c, 0x20, 0x98, 0x20, 0xc4, 0x20, 0xf0, 0x21, 0x1c, 0x21, 0x48, + 0x21, 0x75, 0x21, 0xa1, 0x21, 0xce, 0x21, 0xfb, 0x22, 0x27, 0x22, 0x55, + 0x22, 0x82, 0x22, 0xaf, 0x22, 0xdd, 0x23, 0x0a, 0x23, 0x38, 0x23, 0x66, + 0x23, 0x94, 0x23, 0xc2, 0x23, 0xf0, 0x24, 0x1f, 0x24, 0x4d, 0x24, 0x7c, + 0x24, 0xab, 0x24, 0xda, 0x25, 0x09, 0x25, 0x38, 0x25, 0x68, 0x25, 0x97, + 0x25, 0xc7, 0x25, 0xf7, 0x26, 0x27, 0x26, 0x57, 0x26, 0x87, 0x26, 0xb7, + 0x26, 0xe8, 0x27, 0x18, 0x27, 0x49, 0x27, 0x7a, 0x27, 0xab, 0x27, 0xdc, + 0x28, 0x0d, 0x28, 0x3f, 0x28, 0x71, 0x28, 0xa2, 0x28, 0xd4, 0x29, 0x06, + 0x29, 0x38, 0x29, 0x6b, 0x29, 0x9d, 0x29, 0xd0, 0x2a, 0x02, 0x2a, 0x35, + 0x2a, 0x68, 0x2a, 0x9b, 0x2a, 0xcf, 0x2b, 0x02, 0x2b, 0x36, 0x2b, 0x69, + 0x2b, 0x9d, 0x2b, 0xd1, 0x2c, 0x05, 0x2c, 0x39, 0x2c, 0x6e, 0x2c, 0xa2, + 0x2c, 0xd7, 0x2d, 0x0c, 0x2d, 0x41, 0x2d, 0x76, 0x2d, 0xab, 0x2d, 0xe1, + 0x2e, 0x16, 0x2e, 0x4c, 0x2e, 0x82, 0x2e, 0xb7, 0x2e, 0xee, 0x2f, 0x24, + 0x2f, 0x5a, 0x2f, 0x91, 0x2f, 0xc7, 0x2f, 0xfe, 0x30, 0x35, 0x30, 0x6c, + 0x30, 0xa4, 0x30, 0xdb, 0x31, 0x12, 0x31, 0x4a, 0x31, 0x82, 0x31, 0xba, + 0x31, 0xf2, 0x32, 0x2a, 0x32, 0x63, 0x32, 0x9b, 0x32, 0xd4, 0x33, 0x0d, + 0x33, 0x46, 0x33, 0x7f, 0x33, 0xb8, 0x33, 0xf1, 0x34, 0x2b, 0x34, 0x65, + 0x34, 0x9e, 0x34, 0xd8, 0x35, 0x13, 0x35, 0x4d, 0x35, 0x87, 0x35, 0xc2, + 0x35, 0xfd, 0x36, 0x37, 0x36, 0x72, 0x36, 0xae, 0x36, 0xe9, 0x37, 0x24, + 0x37, 0x60, 0x37, 0x9c, 0x37, 0xd7, 0x38, 0x14, 0x38, 0x50, 0x38, 0x8c, + 0x38, 0xc8, 0x39, 0x05, 0x39, 0x42, 0x39, 0x7f, 0x39, 0xbc, 0x39, 0xf9, + 0x3a, 0x36, 0x3a, 0x74, 0x3a, 0xb2, 0x3a, 0xef, 0x3b, 0x2d, 0x3b, 0x6b, + 0x3b, 0xaa, 0x3b, 0xe8, 0x3c, 0x27, 0x3c, 0x65, 0x3c, 0xa4, 0x3c, 0xe3, + 0x3d, 0x22, 0x3d, 0x61, 0x3d, 0xa1, 0x3d, 0xe0, 0x3e, 0x20, 0x3e, 0x60, + 0x3e, 0xa0, 0x3e, 0xe0, 0x3f, 0x21, 0x3f, 0x61, 0x3f, 0xa2, 0x3f, 0xe2, + 0x40, 0x23, 0x40, 0x64, 0x40, 0xa6, 0x40, 0xe7, 0x41, 0x29, 0x41, 0x6a, + 0x41, 0xac, 0x41, 0xee, 0x42, 0x30, 0x42, 0x72, 0x42, 0xb5, 0x42, 0xf7, + 0x43, 0x3a, 0x43, 0x7d, 0x43, 0xc0, 0x44, 0x03, 0x44, 0x47, 0x44, 0x8a, + 0x44, 0xce, 0x45, 0x12, 0x45, 0x55, 0x45, 0x9a, 0x45, 0xde, 0x46, 0x22, + 0x46, 0x67, 0x46, 0xab, 0x46, 0xf0, 0x47, 0x35, 0x47, 0x7b, 0x47, 0xc0, + 0x48, 0x05, 0x48, 0x4b, 0x48, 0x91, 0x48, 0xd7, 0x49, 0x1d, 0x49, 0x63, + 0x49, 0xa9, 0x49, 0xf0, 0x4a, 0x37, 0x4a, 0x7d, 0x4a, 0xc4, 0x4b, 0x0c, + 0x4b, 0x53, 0x4b, 0x9a, 0x4b, 0xe2, 0x4c, 0x2a, 0x4c, 0x72, 0x4c, 0xba, + 0x4d, 0x02, 0x4d, 0x4a, 0x4d, 0x93, 0x4d, 0xdc, 0x4e, 0x25, 0x4e, 0x6e, + 0x4e, 0xb7, 0x4f, 0x00, 0x4f, 0x49, 0x4f, 0x93, 0x4f, 0xdd, 0x50, 0x27, + 0x50, 0x71, 0x50, 0xbb, 0x51, 0x06, 0x51, 0x50, 0x51, 0x9b, 0x51, 0xe6, + 0x52, 0x31, 0x52, 0x7c, 0x52, 0xc7, 0x53, 0x13, 0x53, 0x5f, 0x53, 0xaa, + 0x53, 0xf6, 0x54, 0x42, 0x54, 0x8f, 0x54, 0xdb, 0x55, 0x28, 0x55, 0x75, + 0x55, 0xc2, 0x56, 0x0f, 0x56, 0x5c, 0x56, 0xa9, 0x56, 0xf7, 0x57, 0x44, + 0x57, 0x92, 0x57, 0xe0, 0x58, 0x2f, 0x58, 0x7d, 0x58, 0xcb, 0x59, 0x1a, + 0x59, 0x69, 0x59, 0xb8, 0x5a, 0x07, 0x5a, 0x56, 0x5a, 0xa6, 0x5a, 0xf5, + 0x5b, 0x45, 0x5b, 0x95, 0x5b, 0xe5, 0x5c, 0x35, 0x5c, 0x86, 0x5c, 0xd6, + 0x5d, 0x27, 0x5d, 0x78, 0x5d, 0xc9, 0x5e, 0x1a, 0x5e, 0x6c, 0x5e, 0xbd, + 0x5f, 0x0f, 0x5f, 0x61, 0x5f, 0xb3, 0x60, 0x05, 0x60, 0x57, 0x60, 0xaa, + 0x60, 0xfc, 0x61, 0x4f, 0x61, 0xa2, 0x61, 0xf5, 0x62, 0x49, 0x62, 0x9c, + 0x62, 0xf0, 0x63, 0x43, 0x63, 0x97, 0x63, 0xeb, 0x64, 0x40, 0x64, 0x94, + 0x64, 0xe9, 0x65, 0x3d, 0x65, 0x92, 0x65, 0xe7, 0x66, 0x3d, 0x66, 0x92, + 0x66, 0xe8, 0x67, 0x3d, 0x67, 0x93, 0x67, 0xe9, 0x68, 0x3f, 0x68, 0x96, + 0x68, 0xec, 0x69, 0x43, 0x69, 0x9a, 0x69, 0xf1, 0x6a, 0x48, 0x6a, 0x9f, + 0x6a, 0xf7, 0x6b, 0x4f, 0x6b, 0xa7, 0x6b, 0xff, 0x6c, 0x57, 0x6c, 0xaf, + 0x6d, 0x08, 0x6d, 0x60, 0x6d, 0xb9, 0x6e, 0x12, 0x6e, 0x6b, 0x6e, 0xc4, + 0x6f, 0x1e, 0x6f, 0x78, 0x6f, 0xd1, 0x70, 0x2b, 0x70, 0x86, 0x70, 0xe0, + 0x71, 0x3a, 0x71, 0x95, 0x71, 0xf0, 0x72, 0x4b, 0x72, 0xa6, 0x73, 0x01, + 0x73, 0x5d, 0x73, 0xb8, 0x74, 0x14, 0x74, 0x70, 0x74, 0xcc, 0x75, 0x28, + 0x75, 0x85, 0x75, 0xe1, 0x76, 0x3e, 0x76, 0x9b, 0x76, 0xf8, 0x77, 0x56, + 0x77, 0xb3, 0x78, 0x11, 0x78, 0x6e, 0x78, 0xcc, 0x79, 0x2a, 0x79, 0x89, + 0x79, 0xe7, 0x7a, 0x46, 0x7a, 0xa5, 0x7b, 0x04, 0x7b, 0x63, 0x7b, 0xc2, + 0x7c, 0x21, 0x7c, 0x81, 0x7c, 0xe1, 0x7d, 0x41, 0x7d, 0xa1, 0x7e, 0x01, + 0x7e, 0x62, 0x7e, 0xc2, 0x7f, 0x23, 0x7f, 0x84, 0x7f, 0xe5, 0x80, 0x47, + 0x80, 0xa8, 0x81, 0x0a, 0x81, 0x6b, 0x81, 0xcd, 0x82, 0x30, 0x82, 0x92, + 0x82, 0xf4, 0x83, 0x57, 0x83, 0xba, 0x84, 0x1d, 0x84, 0x80, 0x84, 0xe3, + 0x85, 0x47, 0x85, 0xab, 0x86, 0x0e, 0x86, 0x72, 0x86, 0xd7, 0x87, 0x3b, + 0x87, 0x9f, 0x88, 0x04, 0x88, 0x69, 0x88, 0xce, 0x89, 0x33, 0x89, 0x99, + 0x89, 0xfe, 0x8a, 0x64, 0x8a, 0xca, 0x8b, 0x30, 0x8b, 0x96, 0x8b, 0xfc, + 0x8c, 0x63, 0x8c, 0xca, 0x8d, 0x31, 0x8d, 0x98, 0x8d, 0xff, 0x8e, 0x66, + 0x8e, 0xce, 0x8f, 0x36, 0x8f, 0x9e, 0x90, 0x06, 0x90, 0x6e, 0x90, 0xd6, + 0x91, 0x3f, 0x91, 0xa8, 0x92, 0x11, 0x92, 0x7a, 0x92, 0xe3, 0x93, 0x4d, + 0x93, 0xb6, 0x94, 0x20, 0x94, 0x8a, 0x94, 0xf4, 0x95, 0x5f, 0x95, 0xc9, + 0x96, 0x34, 0x96, 0x9f, 0x97, 0x0a, 0x97, 0x75, 0x97, 0xe0, 0x98, 0x4c, + 0x98, 0xb8, 0x99, 0x24, 0x99, 0x90, 0x99, 0xfc, 0x9a, 0x68, 0x9a, 0xd5, + 0x9b, 0x42, 0x9b, 0xaf, 0x9c, 0x1c, 0x9c, 0x89, 0x9c, 0xf7, 0x9d, 0x64, + 0x9d, 0xd2, 0x9e, 0x40, 0x9e, 0xae, 0x9f, 0x1d, 0x9f, 0x8b, 0x9f, 0xfa, + 0xa0, 0x69, 0xa0, 0xd8, 0xa1, 0x47, 0xa1, 0xb6, 0xa2, 0x26, 0xa2, 0x96, + 0xa3, 0x06, 0xa3, 0x76, 0xa3, 0xe6, 0xa4, 0x56, 0xa4, 0xc7, 0xa5, 0x38, + 0xa5, 0xa9, 0xa6, 0x1a, 0xa6, 0x8b, 0xa6, 0xfd, 0xa7, 0x6e, 0xa7, 0xe0, + 0xa8, 0x52, 0xa8, 0xc4, 0xa9, 0x37, 0xa9, 0xa9, 0xaa, 0x1c, 0xaa, 0x8f, + 0xab, 0x02, 0xab, 0x75, 0xab, 0xe9, 0xac, 0x5c, 0xac, 0xd0, 0xad, 0x44, + 0xad, 0xb8, 0xae, 0x2d, 0xae, 0xa1, 0xaf, 0x16, 0xaf, 0x8b, 0xb0, 0x00, + 0xb0, 0x75, 0xb0, 0xea, 0xb1, 0x60, 0xb1, 0xd6, 0xb2, 0x4b, 0xb2, 0xc2, + 0xb3, 0x38, 0xb3, 0xae, 0xb4, 0x25, 0xb4, 0x9c, 0xb5, 0x13, 0xb5, 0x8a, + 0xb6, 0x01, 0xb6, 0x79, 0xb6, 0xf0, 0xb7, 0x68, 0xb7, 0xe0, 0xb8, 0x59, + 0xb8, 0xd1, 0xb9, 0x4a, 0xb9, 0xc2, 0xba, 0x3b, 0xba, 0xb5, 0xbb, 0x2e, + 0xbb, 0xa7, 0xbc, 0x21, 0xbc, 0x9b, 0xbd, 0x15, 0xbd, 0x8f, 0xbe, 0x0a, + 0xbe, 0x84, 0xbe, 0xff, 0xbf, 0x7a, 0xbf, 0xf5, 0xc0, 0x70, 0xc0, 0xec, + 0xc1, 0x67, 0xc1, 0xe3, 0xc2, 0x5f, 0xc2, 0xdb, 0xc3, 0x58, 0xc3, 0xd4, + 0xc4, 0x51, 0xc4, 0xce, 0xc5, 0x4b, 0xc5, 0xc8, 0xc6, 0x46, 0xc6, 0xc3, + 0xc7, 0x41, 0xc7, 0xbf, 0xc8, 0x3d, 0xc8, 0xbc, 0xc9, 0x3a, 0xc9, 0xb9, + 0xca, 0x38, 0xca, 0xb7, 0xcb, 0x36, 0xcb, 0xb6, 0xcc, 0x35, 0xcc, 0xb5, + 0xcd, 0x35, 0xcd, 0xb5, 0xce, 0x36, 0xce, 0xb6, 0xcf, 0x37, 0xcf, 0xb8, + 0xd0, 0x39, 0xd0, 0xba, 0xd1, 0x3c, 0xd1, 0xbe, 0xd2, 0x3f, 0xd2, 0xc1, + 0xd3, 0x44, 0xd3, 0xc6, 0xd4, 0x49, 0xd4, 0xcb, 0xd5, 0x4e, 0xd5, 0xd1, + 0xd6, 0x55, 0xd6, 0xd8, 0xd7, 0x5c, 0xd7, 0xe0, 0xd8, 0x64, 0xd8, 0xe8, + 0xd9, 0x6c, 0xd9, 0xf1, 0xda, 0x76, 0xda, 0xfb, 0xdb, 0x80, 0xdc, 0x05, + 0xdc, 0x8a, 0xdd, 0x10, 0xdd, 0x96, 0xde, 0x1c, 0xde, 0xa2, 0xdf, 0x29, + 0xdf, 0xaf, 0xe0, 0x36, 0xe0, 0xbd, 0xe1, 0x44, 0xe1, 0xcc, 0xe2, 0x53, + 0xe2, 0xdb, 0xe3, 0x63, 0xe3, 0xeb, 0xe4, 0x73, 0xe4, 0xfc, 0xe5, 0x84, + 0xe6, 0x0d, 0xe6, 0x96, 0xe7, 0x1f, 0xe7, 0xa9, 0xe8, 0x32, 0xe8, 0xbc, + 0xe9, 0x46, 0xe9, 0xd0, 0xea, 0x5b, 0xea, 0xe5, 0xeb, 0x70, 0xeb, 0xfb, + 0xec, 0x86, 0xed, 0x11, 0xed, 0x9c, 0xee, 0x28, 0xee, 0xb4, 0xef, 0x40, + 0xef, 0xcc, 0xf0, 0x58, 0xf0, 0xe5, 0xf1, 0x72, 0xf1, 0xff, 0xf2, 0x8c, + 0xf3, 0x19, 0xf3, 0xa7, 0xf4, 0x34, 0xf4, 0xc2, 0xf5, 0x50, 0xf5, 0xde, + 0xf6, 0x6d, 0xf6, 0xfb, 0xf7, 0x8a, 0xf8, 0x19, 0xf8, 0xa8, 0xf9, 0x38, + 0xf9, 0xc7, 0xfa, 0x57, 0xfa, 0xe7, 0xfb, 0x77, 0xfc, 0x07, 0xfc, 0x98, + 0xfd, 0x29, 0xfd, 0xba, 0xfe, 0x4b, 0xfe, 0xdc, 0xff, 0x6d, 0xff, 0xff, +}; + +static const char kSRGBPara[] = { + // sRGB profile with parametric gamma curves. + 0x00, 0x00, 0x02, 0x54, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x6d, 0x6e, 0x74, 0x72, 0x52, 0x47, 0x42, 0x20, 0x58, 0x59, 0x5a, 0x20, + 0x07, 0xe0, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x09, 0x00, 0x26, 0x00, 0x1c, + 0x61, 0x63, 0x73, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x47, 0x4f, 0x4f, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xd6, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d, 0x47, 0x4f, 0x4f, 0x47, + 0x75, 0xe1, 0xa6, 0xb1, 0x3c, 0x34, 0x37, 0x63, 0x10, 0xc8, 0xab, 0x66, + 0x06, 0x32, 0xa2, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x40, + 0x63, 0x70, 0x72, 0x74, 0x00, 0x00, 0x01, 0x48, 0x00, 0x00, 0x00, 0x5a, + 0x77, 0x74, 0x70, 0x74, 0x00, 0x00, 0x01, 0xa4, 0x00, 0x00, 0x00, 0x14, + 0x62, 0x6b, 0x70, 0x74, 0x00, 0x00, 0x01, 0xb8, 0x00, 0x00, 0x00, 0x14, + 0x72, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x01, 0xcc, 0x00, 0x00, 0x00, 0x14, + 0x67, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x14, + 0x62, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x01, 0xf4, 0x00, 0x00, 0x00, 0x14, + 0x72, 0x54, 0x52, 0x43, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x20, + 0x63, 0x68, 0x61, 0x64, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x00, 0x2c, + 0x62, 0x54, 0x52, 0x43, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x20, + 0x67, 0x54, 0x52, 0x43, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x20, + 0x6d, 0x6c, 0x75, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x0c, 0x65, 0x6e, 0x55, 0x53, 0x00, 0x00, 0x00, 0x24, + 0x00, 0x00, 0x00, 0x1c, 0x00, 0x73, 0x00, 0x52, 0x00, 0x47, 0x00, 0x42, + 0x00, 0x20, 0x00, 0x49, 0x00, 0x45, 0x00, 0x43, 0x00, 0x36, 0x00, 0x31, + 0x00, 0x39, 0x00, 0x36, 0x00, 0x36, 0x00, 0x2d, 0x00, 0x32, 0x00, 0x2e, + 0x00, 0x31, 0x00, 0x00, 0x6d, 0x6c, 0x75, 0x63, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x65, 0x6e, 0x55, 0x53, + 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x43, 0x00, 0x6f, + 0x00, 0x70, 0x00, 0x79, 0x00, 0x72, 0x00, 0x69, 0x00, 0x67, 0x00, 0x68, + 0x00, 0x74, 0x00, 0x20, 0x00, 0x28, 0x00, 0x63, 0x00, 0x29, 0x00, 0x20, + 0x00, 0x32, 0x00, 0x30, 0x00, 0x31, 0x00, 0x36, 0x00, 0x20, 0x00, 0x47, + 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x67, 0x00, 0x6c, 0x00, 0x65, 0x00, 0x20, + 0x00, 0x49, 0x00, 0x6e, 0x00, 0x63, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x00, + 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x51, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x16, 0xcc, 0x58, 0x59, 0x5a, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x6f, 0xa0, 0x00, 0x00, 0x38, 0xf5, 0x00, 0x00, 0x03, 0x90, + 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x97, + 0x00, 0x00, 0xb7, 0x87, 0x00, 0x00, 0x18, 0xd9, 0x58, 0x59, 0x5a, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x9f, 0x00, 0x00, 0x0f, 0x84, + 0x00, 0x00, 0xb6, 0xc3, 0x70, 0x61, 0x72, 0x61, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x66, 0x66, 0x00, 0x00, 0xf2, 0xa7, + 0x00, 0x00, 0x0d, 0x59, 0x00, 0x00, 0x13, 0xd0, 0x00, 0x00, 0x0a, 0x5b, + 0x73, 0x66, 0x33, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x42, + 0x00, 0x00, 0x05, 0xde, 0xff, 0xff, 0xf3, 0x27, 0x00, 0x00, 0x07, 0x93, + 0x00, 0x00, 0xfd, 0x90, 0xff, 0xff, 0xfb, 0xa3, 0xff, 0xff, 0xfd, 0xa4, + 0x00, 0x00, 0x03, 0xdc, 0x00, 0x00, 0xc0, 0x6e, +}; + +static const char kAdobeData[] = { + // Adobe 1998 profile with gamma 2.2 curves. + 0x00, 0x00, 0x02, 0x30, 0x41, 0x44, 0x42, 0x45, 0x02, 0x10, 0x00, 0x00, + 0x6d, 0x6e, 0x74, 0x72, 0x52, 0x47, 0x42, 0x20, 0x58, 0x59, 0x5a, 0x20, + 0x07, 0xd0, 0x00, 0x08, 0x00, 0x0b, 0x00, 0x13, 0x00, 0x33, 0x00, 0x3b, + 0x61, 0x63, 0x73, 0x70, 0x41, 0x50, 0x50, 0x4c, 0x00, 0x00, 0x00, 0x00, + 0x6e, 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xd6, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d, 0x41, 0x44, 0x42, 0x45, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, + 0x63, 0x70, 0x72, 0x74, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x32, + 0x64, 0x65, 0x73, 0x63, 0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x6b, + 0x77, 0x74, 0x70, 0x74, 0x00, 0x00, 0x01, 0x9c, 0x00, 0x00, 0x00, 0x14, + 0x62, 0x6b, 0x70, 0x74, 0x00, 0x00, 0x01, 0xb0, 0x00, 0x00, 0x00, 0x14, + 0x72, 0x54, 0x52, 0x43, 0x00, 0x00, 0x01, 0xc4, 0x00, 0x00, 0x00, 0x0e, + 0x67, 0x54, 0x52, 0x43, 0x00, 0x00, 0x01, 0xd4, 0x00, 0x00, 0x00, 0x0e, + 0x62, 0x54, 0x52, 0x43, 0x00, 0x00, 0x01, 0xe4, 0x00, 0x00, 0x00, 0x0e, + 0x72, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x01, 0xf4, 0x00, 0x00, 0x00, 0x14, + 0x67, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x14, + 0x62, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x00, 0x14, + 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x70, 0x79, + 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x30, 0x20, 0x41, + 0x64, 0x6f, 0x62, 0x65, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, + 0x20, 0x49, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x65, + 0x64, 0x00, 0x00, 0x00, 0x64, 0x65, 0x73, 0x63, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x11, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x20, 0x52, 0x47, + 0x42, 0x20, 0x28, 0x31, 0x39, 0x39, 0x38, 0x29, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf3, 0x51, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x16, 0xcc, + 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x75, 0x72, 0x76, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x33, 0x00, 0x00, + 0x63, 0x75, 0x72, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x33, 0x00, 0x00, 0x63, 0x75, 0x72, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x33, 0x00, 0x00, 0x58, 0x59, 0x5a, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x18, 0x00, 0x00, 0x4f, 0xa5, + 0x00, 0x00, 0x04, 0xfc, 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x34, 0x8d, 0x00, 0x00, 0xa0, 0x2c, 0x00, 0x00, 0x0f, 0x95, + 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x31, + 0x00, 0x00, 0x10, 0x2f, 0x00, 0x00, 0xbe, 0x9c, +}; + +#endif // TESTING_LIBFUZZER_FUZZERS_COLOR_SPACE_DATA_H
diff --git a/testing/libfuzzer/fuzzers/skia_color_space_fuzzer.cc b/testing/libfuzzer/fuzzers/skia_color_space_fuzzer.cc new file mode 100644 index 0000000..850f73f4 --- /dev/null +++ b/testing/libfuzzer/fuzzers/skia_color_space_fuzzer.cc
@@ -0,0 +1,89 @@ +// 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. + +#include <cstddef> +#include <cstdint> +#include <random> + +#include "base/logging.h" +#include "base/strings/string_piece.h" +#include "testing/libfuzzer/fuzzers/color_space_data.h" +#include "third_party/skia/include/core/SkColorSpace.h" +#include "third_party/skia/include/core/SkColorSpaceXform.h" + +static constexpr size_t kPixels = 2048 / 4; + +static uint32_t pixels[kPixels * 4]; + +static void GeneratePixels(size_t hash) { + static std::uniform_int_distribution<uint32_t> uniform(0u, ~0u); + + std::mt19937_64 random(hash); + for (size_t i = 0; i < arraysize(pixels); ++i) + pixels[i] = uniform(random); +} + +static sk_sp<SkColorSpace> test; +static sk_sp<SkColorSpace> srgb; + +static void ColorTransform(size_t hash, bool input) { + if (!test.get()) + return; + + auto transform = input ? SkColorSpaceXform::New(test.get(), srgb.get()) + : SkColorSpaceXform::New(srgb.get(), test.get()); + if (!transform) + return; + + static uint32_t output[kPixels * 4]; + + const auto color = SkColorSpaceXform::ColorFormat(hash & 7); + const auto alpha = SkAlphaType(hash >> 3 & 3); + + transform->apply(color, output, color, pixels, kPixels, alpha); +} + +static sk_sp<SkColorSpace> SelectProfile(size_t hash) { + static sk_sp<SkColorSpace> profiles[8] = { + SkColorSpace::MakeSRGB(), + SkColorSpace::MakeICC(kSRGBData, arraysize(kSRGBData)), + SkColorSpace::MakeICC(kSRGBPara, arraysize(kSRGBPara)), + SkColorSpace::MakeICC(kAdobeData, arraysize(kAdobeData)), + SkColorSpace::MakeSRGBLinear(), + SkColorSpace::MakeRGB( + SkColorSpace::RenderTargetGamma::kLinear_RenderTargetGamma, + SkColorSpace::Gamut::kAdobeRGB_Gamut), + SkColorSpace::MakeRGB( + SkColorSpace::RenderTargetGamma::kSRGB_RenderTargetGamma, + SkColorSpace::Gamut::kDCIP3_D65_Gamut), + SkColorSpace::MakeSRGB(), + }; + + return profiles[hash & 7]; +} + +inline size_t Hash(const char* data, size_t size) { + return base::StringPieceHash()(base::StringPiece(data, size)); +} + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + constexpr size_t kSizeLimit = 4 * 1024 * 1024; + if (size < 128 || size > kSizeLimit) + return 0; + + test = SkColorSpace::MakeICC(data, size); + if (!test.get()) + return 0; + + const size_t hash = Hash(reinterpret_cast<const char*>(data), size); + srgb = SelectProfile(hash); + GeneratePixels(hash); + + ColorTransform(hash, true); + ColorTransform(hash, false); + + test.reset(); + srgb.reset(); + return 0; +}
diff --git a/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp b/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp index 637e75f..59e20fe 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp +++ b/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp
@@ -207,21 +207,16 @@ v8::Local<v8::Function> compile_callback = v8::Function::New(isolate, CompileFromResponseCallback); - ScriptPromiseResolver* script_promise_resolver = - ScriptPromiseResolver::Create(script_state); // treat either case of parameter as // Promise.resolve(parameter) // as per https://www.w3.org/2001/tag/doc/promises-guide#resolve-arguments // Ending with: // return Promise.resolve(parameter).then(compileCallback); - ScriptPromise parameter_as_promise = script_promise_resolver->Promise(); V8SetReturnValue(args, ScriptPromise::Cast(script_state, args[0]) .Then(compile_callback) .V8Value()); - // resolve the first parameter promise. - script_promise_resolver->Resolve(ScriptValue::From(script_state, args[0])); return true; }
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFilePath.cpp b/third_party/WebKit/Source/modules/filesystem/DOMFilePath.cpp index 6cfa612..5c7ce69 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFilePath.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DOMFilePath.cpp
@@ -66,8 +66,8 @@ } bool DOMFilePath::IsParentOf(const String& parent, const String& may_be_child) { - ASSERT(DOMFilePath::IsAbsolute(parent)); - ASSERT(DOMFilePath::IsAbsolute(may_be_child)); + DCHECK(DOMFilePath::IsAbsolute(parent)); + DCHECK(DOMFilePath::IsAbsolute(may_be_child)); if (parent == DOMFilePath::kRoot && may_be_child != DOMFilePath::kRoot) return true; if (parent.length() >= may_be_child.length() || @@ -79,7 +79,7 @@ } String DOMFilePath::RemoveExtraParentReferences(const String& path) { - ASSERT(DOMFilePath::IsAbsolute(path)); + DCHECK(DOMFilePath::IsAbsolute(path)); Vector<String> components; Vector<String> canonicalized; path.Split(DOMFilePath::kSeparator, components);
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp index 730cee3a..9867972 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystem.cpp
@@ -120,12 +120,12 @@ } void DOMFileSystem::RemovePendingCallbacks() { - ASSERT(number_of_pending_callbacks_ > 0); + DCHECK_GT(number_of_pending_callbacks_, 0); --number_of_pending_callbacks_; } bool DOMFileSystem::HasPendingActivity() const { - ASSERT(number_of_pending_callbacks_ >= 0); + DCHECK_GE(number_of_pending_callbacks_, 0); return number_of_pending_callbacks_; } @@ -172,7 +172,7 @@ void DOMFileSystem::CreateWriter(const FileEntry* file_entry, FileWriterCallback* success_callback, ErrorCallbackBase* error_callback) { - ASSERT(file_entry); + DCHECK(file_entry); if (!FileSystem()) { ReportError(error_callback, FileError::kAbortErr);
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp index bcc0dce..d0a24ea 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemBase.cpp
@@ -108,7 +108,7 @@ } bool DOMFileSystemBase::SupportsToURL() const { - ASSERT(IsValidType(type_)); + DCHECK(IsValidType(type_)); return type_ != kFileSystemTypeIsolated; } @@ -117,7 +117,7 @@ } KURL DOMFileSystemBase::CreateFileSystemURL(const String& full_path) const { - ASSERT(DOMFilePath::IsAbsolute(full_path)); + DCHECK(DOMFilePath::IsAbsolute(full_path)); if (GetType() == kFileSystemTypeExternal) { // For external filesystem originString could be different from what we have @@ -136,7 +136,7 @@ // For regular types we can just append the entry's fullPath to the // m_filesystemRootURL that should look like // 'filesystem:<origin>/<typePrefix>'. - ASSERT(!filesystem_root_url_.IsEmpty()); + DCHECK(!filesystem_root_url_.IsEmpty()); KURL url = filesystem_root_url_; // Remove the extra leading slash. url.SetPath(url.GetPath() + @@ -148,7 +148,7 @@ const EntryBase* base, String path, String& absolute_path) { - ASSERT(base); + DCHECK(base); if (!DOMFilePath::IsAbsolute(path)) path = DOMFilePath::Append(base->fullPath(), path); @@ -227,7 +227,7 @@ EntryBase* parent, const String& new_name, String& destination_path) { - ASSERT(source); + DCHECK(source); if (!parent || !parent->isDirectory()) return false; @@ -327,7 +327,7 @@ return; } - ASSERT(entry); + DCHECK(entry); // We don't allow calling remove() on the root directory. if (entry->fullPath() == String(DOMFilePath::kRoot)) { ReportError(error_callback, FileError::kInvalidModificationErr); @@ -350,7 +350,8 @@ return; } - ASSERT(entry && entry->isDirectory()); + DCHECK(entry); + DCHECK(entry->isDirectory()); // We don't allow calling remove() on the root directory. if (entry->fullPath() == String(DOMFilePath::kRoot)) { ReportError(error_callback, FileError::kInvalidModificationErr); @@ -373,7 +374,7 @@ return; } - ASSERT(entry); + DCHECK(entry); String path = DOMFilePath::GetDirectory(entry->fullPath()); FileSystem()->DirectoryExists( @@ -450,7 +451,7 @@ return 0; } - ASSERT(DOMFilePath::IsAbsolute(path)); + DCHECK(DOMFilePath::IsAbsolute(path)); std::unique_ptr<AsyncFileSystemCallbacks> callbacks(EntriesCallbacks::Create( success_callback, error_callback, context_, reader, path));
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.cpp b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.cpp index 9a50f99..36dd003c 100644 --- a/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DOMFileSystemSync.cpp
@@ -190,7 +190,7 @@ FileWriterSync* DOMFileSystemSync::CreateWriter( const FileEntrySync* file_entry, ExceptionState& exception_state) { - ASSERT(file_entry); + DCHECK(file_entry); FileWriterSync* file_writer = FileWriterSync::Create(); ReceiveFileWriterCallback* success_callback =
diff --git a/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.cpp index 0e353681..2620c66 100644 --- a/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DataTransferItemFileSystem.cpp
@@ -57,7 +57,7 @@ // The clipboard may not be in a readable state. if (!file) return 0; - ASSERT(file->IsFile()); + DCHECK(file->IsFile()); DOMFileSystem* dom_file_system = DraggedIsolatedFileSystemImpl::GetDOMFileSystem(
diff --git a/third_party/WebKit/Source/modules/filesystem/DraggedIsolatedFileSystemImpl.cpp b/third_party/WebKit/Source/modules/filesystem/DraggedIsolatedFileSystemImpl.cpp index ee3cf21..6a49fe4 100644 --- a/third_party/WebKit/Source/modules/filesystem/DraggedIsolatedFileSystemImpl.cpp +++ b/third_party/WebKit/Source/modules/filesystem/DraggedIsolatedFileSystemImpl.cpp
@@ -58,7 +58,7 @@ // static const char* DraggedIsolatedFileSystemImpl::SupplementName() { - ASSERT(IsMainThread()); + DCHECK(IsMainThread()); return "DraggedIsolatedFileSystemImpl"; }
diff --git a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp index 9772e4bb..1760084 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp +++ b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
@@ -216,7 +216,7 @@ success_callback_(success_callback), directory_reader_(directory_reader), base_path_(base_path) { - ASSERT(directory_reader_); + DCHECK(directory_reader_); } void EntriesCallbacks::DidReadDirectoryEntry(const String& name,
diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp b/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp index a10308a..8dde7498 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp +++ b/third_party/WebKit/Source/modules/filesystem/FileWriter.cpp
@@ -60,7 +60,7 @@ last_progress_notification_time_ms_(0) {} FileWriter::~FileWriter() { - ASSERT(!recursion_depth_); + DCHECK(!recursion_depth_); DCHECK(!Writer()); } @@ -80,9 +80,9 @@ void FileWriter::write(Blob* data, ExceptionState& exception_state) { if (!GetExecutionContext()) return; - ASSERT(data); - ASSERT(Writer()); - ASSERT(truncate_length_ == -1); + DCHECK(data); + DCHECK(Writer()); + DCHECK_EQ(truncate_length_, -1); if (ready_state_ == kWriting) { SetError(FileError::kInvalidStateErr, exception_state); return; @@ -96,11 +96,11 @@ ready_state_ = kWriting; bytes_written_ = 0; bytes_to_write_ = data->size(); - ASSERT(queued_operation_ == kOperationNone); + DCHECK_EQ(queued_operation_, kOperationNone); if (operation_in_progress_ != kOperationNone) { // We must be waiting for an abort to complete, since m_readyState wasn't // kWriting. - ASSERT(operation_in_progress_ == kOperationAbort); + DCHECK_EQ(operation_in_progress_, kOperationAbort); queued_operation_ = kOperationWrite; } else DoOperation(kOperationWrite); @@ -111,22 +111,22 @@ void FileWriter::seek(long long position, ExceptionState& exception_state) { if (!GetExecutionContext()) return; - ASSERT(Writer()); + DCHECK(Writer()); if (ready_state_ == kWriting) { SetError(FileError::kInvalidStateErr, exception_state); return; } - ASSERT(truncate_length_ == -1); - ASSERT(queued_operation_ == kOperationNone); + DCHECK_EQ(truncate_length_, -1); + DCHECK_EQ(queued_operation_, kOperationNone); SeekInternal(position); } void FileWriter::truncate(long long position, ExceptionState& exception_state) { if (!GetExecutionContext()) return; - ASSERT(Writer()); - ASSERT(truncate_length_ == -1); + DCHECK(Writer()); + DCHECK_EQ(truncate_length_, -1); if (ready_state_ == kWriting || position < 0) { SetError(FileError::kInvalidStateErr, exception_state); return; @@ -140,11 +140,11 @@ bytes_written_ = 0; bytes_to_write_ = 0; truncate_length_ = position; - ASSERT(queued_operation_ == kOperationNone); + DCHECK_EQ(queued_operation_, kOperationNone); if (operation_in_progress_ != kOperationNone) { // We must be waiting for an abort to complete, since m_readyState wasn't // kWriting. - ASSERT(operation_in_progress_ == kOperationAbort); + DCHECK_EQ(operation_in_progress_, kOperationAbort); queued_operation_ = kOperationTruncate; } else DoOperation(kOperationTruncate); @@ -154,7 +154,7 @@ void FileWriter::abort(ExceptionState& exception_state) { if (!GetExecutionContext()) return; - ASSERT(Writer()); + DCHECK(Writer()); if (ready_state_ != kWriting) return; ++num_aborts_; @@ -205,8 +205,8 @@ CompleteAbort(); return; } - ASSERT(operation_in_progress_ == kOperationTruncate); - ASSERT(truncate_length_ >= 0); + DCHECK_EQ(operation_in_progress_, kOperationTruncate); + DCHECK_GE(truncate_length_, 0); SetLength(truncate_length_); if (position() > length()) SetPosition(length()); @@ -229,7 +229,7 @@ } void FileWriter::CompleteAbort() { - ASSERT(operation_in_progress_ == kOperationAbort); + DCHECK_EQ(operation_in_progress_, kOperationAbort); operation_in_progress_ = kOperationNone; Operation operation = queued_operation_; queued_operation_ = kOperationNone; @@ -269,7 +269,7 @@ truncate_length_ = -1; break; } - ASSERT(queued_operation_ == kOperationNone); + DCHECK_EQ(queued_operation_, kOperationNone); operation_in_progress_ = operation; } @@ -295,12 +295,12 @@ DispatchEvent( ProgressEvent::Create(type, true, bytes_written_, bytes_to_write_)); --recursion_depth_; - ASSERT(recursion_depth_ >= 0); + DCHECK_GE(recursion_depth_, 0); } void FileWriter::SetError(FileError::ErrorCode error_code, ExceptionState& exception_state) { - ASSERT(error_code); + DCHECK(error_code); FileError::ThrowDOMException(exception_state, error_code); error_ = FileError::CreateDOMException(error_code); }
diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriterBase.cpp b/third_party/WebKit/Source/modules/filesystem/FileWriterBase.cpp index 5c265e5f..107bc74d 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileWriterBase.cpp +++ b/third_party/WebKit/Source/modules/filesystem/FileWriterBase.cpp
@@ -42,8 +42,8 @@ void FileWriterBase::Initialize(std::unique_ptr<WebFileWriter> writer, long long length) { - ASSERT(!writer_); - ASSERT(length >= 0); + DCHECK(!writer_); + DCHECK_GE(length, 0); writer_ = std::move(writer); length_ = length; }
diff --git a/third_party/WebKit/Source/modules/filesystem/FileWriterSync.cpp b/third_party/WebKit/Source/modules/filesystem/FileWriterSync.cpp index 8bc2b380c..d3e451d8 100644 --- a/third_party/WebKit/Source/modules/filesystem/FileWriterSync.cpp +++ b/third_party/WebKit/Source/modules/filesystem/FileWriterSync.cpp
@@ -39,8 +39,8 @@ namespace blink { void FileWriterSync::write(Blob* data, ExceptionState& exception_state) { - ASSERT(data); - ASSERT(Writer()); + DCHECK(data); + DCHECK(Writer()); DCHECK(complete_); PrepareForWrite(); @@ -56,14 +56,14 @@ } void FileWriterSync::seek(long long position, ExceptionState& exception_state) { - ASSERT(Writer()); + DCHECK(Writer()); DCHECK(complete_); SeekInternal(position); } void FileWriterSync::truncate(long long offset, ExceptionState& exception_state) { - ASSERT(Writer()); + DCHECK(Writer()); DCHECK(complete_); if (offset < 0) { exception_state.ThrowDOMException(kInvalidStateError,
diff --git a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp index 65178c6..20ed96f 100644 --- a/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp +++ b/third_party/WebKit/Source/modules/filesystem/LocalFileSystem.cpp
@@ -202,7 +202,7 @@ } WorkerClients* clients = ToWorkerGlobalScope(context).Clients(); - ASSERT(clients); + DCHECK(clients); LocalFileSystem* file_system = static_cast<LocalFileSystem*>( Supplement<WorkerClients>::From(clients, SupplementName())); DCHECK(file_system);
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc index e89ff7d..3f37fc2 100644 --- a/ui/gl/gl_surface_egl.cc +++ b/ui/gl/gl_surface_egl.cc
@@ -15,6 +15,7 @@ #include "base/lazy_instance.h" #include "base/logging.h" #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_number_conversions.h" @@ -708,7 +709,9 @@ return g_display; } -NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(EGLNativeWindowType window) +NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL( + EGLNativeWindowType window, + std::unique_ptr<gfx::VSyncProvider> vsync_provider) : window_(window), size_(1, 1), enable_fixed_size_angle_(false), @@ -716,6 +719,7 @@ supports_post_sub_buffer_(false), supports_swap_buffer_with_damage_(false), flips_vertically_(false), + vsync_provider_external_(std::move(vsync_provider)), swap_interval_(1) { #if defined(OS_ANDROID) if (window) @@ -732,13 +736,8 @@ } bool NativeViewGLSurfaceEGL::Initialize(GLSurfaceFormat format) { - format_ = format; - return Initialize(nullptr); -} - -bool NativeViewGLSurfaceEGL::Initialize( - std::unique_ptr<gfx::VSyncProvider> sync_provider) { DCHECK(!surface_); + format_ = format; if (!GetDisplay()) { LOG(ERROR) << "Trying to create surface with invalid display."; @@ -810,10 +809,10 @@ supports_swap_buffer_with_damage_ = g_driver_egl.ext.b_EGL_KHR_swap_buffers_with_damage; - if (sync_provider) - vsync_provider_ = std::move(sync_provider); - else if (EGLSyncControlVSyncProvider::IsSupported()) - vsync_provider_.reset(new EGLSyncControlVSyncProvider(surface_)); + if (!vsync_provider_external_ && EGLSyncControlVSyncProvider::IsSupported()) { + vsync_provider_internal_ = + base::MakeUnique<EGLSyncControlVSyncProvider>(surface_); + } return true; } @@ -822,6 +821,8 @@ } void NativeViewGLSurfaceEGL::Destroy() { + vsync_provider_internal_ = nullptr; + if (surface_) { if (!eglDestroySurface(GetDisplay(), surface_)) { LOG(ERROR) << "eglDestroySurface failed with error " @@ -1022,7 +1023,8 @@ } gfx::VSyncProvider* NativeViewGLSurfaceEGL::GetVSyncProvider() { - return vsync_provider_.get(); + return vsync_provider_external_ ? vsync_provider_external_.get() + : vsync_provider_internal_.get(); } bool NativeViewGLSurfaceEGL::ScheduleOverlayPlane(
diff --git a/ui/gl/gl_surface_egl.h b/ui/gl/gl_surface_egl.h index d9caa8fe..ad51451 100644 --- a/ui/gl/gl_surface_egl.h +++ b/ui/gl/gl_surface_egl.h
@@ -88,7 +88,8 @@ // Encapsulates an EGL surface bound to a view. class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { public: - explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window); + NativeViewGLSurfaceEGL(EGLNativeWindowType window, + std::unique_ptr<gfx::VSyncProvider> vsync_provider); // Implement GLSurface. using GLSurfaceEGL::Initialize; @@ -115,10 +116,6 @@ bool FlipsVertically() const override; bool BuffersFlipped() const override; - // Create a NativeViewGLSurfaceEGL with an externally provided - // gfx::VSyncProvider. Takes ownership of the gfx::VSyncProvider. - virtual bool Initialize(std::unique_ptr<gfx::VSyncProvider> sync_provider); - // Takes care of the platform dependant bits, of any, for creating the window. virtual bool InitializeNativeWindow(); @@ -143,7 +140,8 @@ bool supports_swap_buffer_with_damage_; bool flips_vertically_; - std::unique_ptr<gfx::VSyncProvider> vsync_provider_; + std::unique_ptr<gfx::VSyncProvider> vsync_provider_external_; + std::unique_ptr<gfx::VSyncProvider> vsync_provider_internal_; int swap_interval_;
diff --git a/ui/gl/gl_surface_egl_x11.cc b/ui/gl/gl_surface_egl_x11.cc index 3dcaf70..a72b45b 100644 --- a/ui/gl/gl_surface_egl_x11.cc +++ b/ui/gl/gl_surface_egl_x11.cc
@@ -18,9 +18,7 @@ namespace gl { NativeViewGLSurfaceEGLX11::NativeViewGLSurfaceEGLX11(EGLNativeWindowType window) - : NativeViewGLSurfaceEGL(0), - parent_window_(window) { -} + : NativeViewGLSurfaceEGL(0, nullptr), parent_window_(window) {} bool NativeViewGLSurfaceEGLX11::InitializeNativeWindow() { Display* x11_display = GetNativeDisplay();
diff --git a/ui/gl/init/gl_factory_android.cc b/ui/gl/init/gl_factory_android.cc index 91f728b..dff62b1 100644 --- a/ui/gl/init/gl_factory_android.cc +++ b/ui/gl/init/gl_factory_android.cc
@@ -127,7 +127,7 @@ return InitializeGLSurface(new GLSurfaceOSMesaHeadless()); case kGLImplementationEGLGLES2: if (window != gfx::kNullAcceleratedWidget) { - return InitializeGLSurface(new NativeViewGLSurfaceEGL(window)); + return InitializeGLSurface(new NativeViewGLSurfaceEGL(window, nullptr)); } else { return InitializeGLSurface(new GLSurfaceStub()); }
diff --git a/ui/gl/init/gl_factory_win.cc b/ui/gl/init/gl_factory_win.cc index 198147d..06263a1 100644 --- a/ui/gl/init/gl_factory_win.cc +++ b/ui/gl/init/gl_factory_win.cc
@@ -103,13 +103,8 @@ DCHECK_EQ(kGLImplementationEGLGLES2, GetGLImplementation()); DCHECK(window != gfx::kNullAcceleratedWidget); - scoped_refptr<NativeViewGLSurfaceEGL> surface( - new NativeViewGLSurfaceEGL(window)); - - if (!surface->Initialize(std::move(sync_provider))) - return nullptr; - - return surface; + return InitializeGLSurface( + new NativeViewGLSurfaceEGL(window, std::move(sync_provider))); } scoped_refptr<GLSurface> CreateOffscreenGLSurfaceWithFormat(
diff --git a/ui/ozone/platform/cast/gl_surface_cast.cc b/ui/ozone/platform/cast/gl_surface_cast.cc index 5f50ee8..04d7d64 100644 --- a/ui/ozone/platform/cast/gl_surface_cast.cc +++ b/ui/ozone/platform/cast/gl_surface_cast.cc
@@ -4,14 +4,26 @@ #include "ui/ozone/platform/cast/gl_surface_cast.h" +#include "base/memory/ptr_util.h" +#include "ui/gfx/vsync_provider.h" #include "ui/ozone/common/egl_util.h" #include "ui/ozone/platform/cast/gl_ozone_egl_cast.h" +namespace { +// Target fixed 30fps. +// TODO(halliwell): We might need to customize this value on various devices +// or make it dynamic that throttles framerate if device is overheating. +const base::TimeDelta kVSyncInterval = base::TimeDelta::FromSeconds(2) / 59.9; +} // namespace + namespace ui { GLSurfaceCast::GLSurfaceCast(gfx::AcceleratedWidget widget, GLOzoneEglCast* parent) - : NativeViewGLSurfaceEGL(parent->GetNativeWindow()), + : NativeViewGLSurfaceEGL( + parent->GetNativeWindow(), + base::MakeUnique<gfx::FixedVSyncProvider>(base::TimeTicks(), + kVSyncInterval)), widget_(widget), parent_(parent), supports_swap_buffer_with_bounds_(
diff --git a/ui/ozone/platform/wayland/gl_surface_wayland.cc b/ui/ozone/platform/wayland/gl_surface_wayland.cc index a828ac50..d1e64cc2 100644 --- a/ui/ozone/platform/wayland/gl_surface_wayland.cc +++ b/ui/ozone/platform/wayland/gl_surface_wayland.cc
@@ -27,7 +27,8 @@ GLSurfaceWayland::GLSurfaceWayland(WaylandEglWindowPtr egl_window) : NativeViewGLSurfaceEGL( - reinterpret_cast<EGLNativeWindowType>(egl_window.get())), + reinterpret_cast<EGLNativeWindowType>(egl_window.get()), + nullptr), egl_window_(std::move(egl_window)) { DCHECK(egl_window_); }
diff --git a/ui/ozone/platform/x11/x11_surface_factory.cc b/ui/ozone/platform/x11/x11_surface_factory.cc index 27570cc..b06ecb3 100644 --- a/ui/ozone/platform/x11/x11_surface_factory.cc +++ b/ui/ozone/platform/x11/x11_surface_factory.cc
@@ -38,7 +38,7 @@ }; GLSurfaceEGLOzoneX11::GLSurfaceEGLOzoneX11(EGLNativeWindowType window) - : NativeViewGLSurfaceEGL(window) {} + : NativeViewGLSurfaceEGL(window, nullptr) {} EGLConfig GLSurfaceEGLOzoneX11::GetConfig() { // Try matching the window depth with an alpha channel, because we're worried
diff --git a/ui/views/controls/button/label_button.h b/ui/views/controls/button/label_button.h index e063d8c0..6dade72 100644 --- a/ui/views/controls/button/label_button.h +++ b/ui/views/controls/button/label_button.h
@@ -156,13 +156,6 @@ } private: - FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Init); - FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Label); - FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Image); - FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, LabelAndImage); - FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, FontList); - FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, ResetColorsFromNativeTheme); - void SetTextInternal(const base::string16& text); // View:
diff --git a/ui/views/controls/button/label_button_unittest.cc b/ui/views/controls/button/label_button_unittest.cc index 8e7a1dd..f87f198 100644 --- a/ui/views/controls/button/label_button_unittest.cc +++ b/ui/views/controls/button/label_button_unittest.cc
@@ -44,9 +44,12 @@ // Testing button that exposes protected methods. class TestLabelButton : public LabelButton { public: - TestLabelButton() : LabelButton(nullptr, base::string16()) {} + explicit TestLabelButton(const base::string16& text = base::string16()) + : LabelButton(nullptr, text) {} using LabelButton::label; + using LabelButton::image; + using LabelButton::ResetColorsFromNativeTheme; private: DISALLOW_COPY_AND_ASSIGN(TestLabelButton); @@ -120,7 +123,7 @@ TEST_F(LabelButtonTest, Init) { const base::string16 text(ASCIIToUTF16("abc")); - LabelButton button(NULL, text); + TestLabelButton button(text); EXPECT_TRUE(button.GetImage(Button::STATE_NORMAL).isNull()); EXPECT_TRUE(button.GetImage(Button::STATE_HOVERED).isNull()); @@ -138,8 +141,8 @@ EXPECT_EQ(button.style(), Button::STYLE_TEXTBUTTON); EXPECT_EQ(Button::STATE_NORMAL, button.state()); - EXPECT_EQ(button.image_->parent(), &button); - EXPECT_EQ(button.label_->parent(), &button); + EXPECT_EQ(button.image()->parent(), &button); + EXPECT_EQ(button.label()->parent(), &button); } TEST_F(LabelButtonTest, Label) { @@ -263,16 +266,17 @@ button_size.Enlarge(50, 0); button_->SetSize(button_size); button_->Layout(); - EXPECT_LT(button_->image_->bounds().right(), button_->label_->bounds().x()); - int left_align_label_midpoint = button_->label_->bounds().CenterPoint().x(); + EXPECT_LT(button_->image()->bounds().right(), button_->label()->bounds().x()); + int left_align_label_midpoint = button_->label()->bounds().CenterPoint().x(); button_->SetHorizontalAlignment(gfx::ALIGN_CENTER); button_->Layout(); - EXPECT_LT(button_->image_->bounds().right(), button_->label_->bounds().x()); - int center_align_label_midpoint = button_->label_->bounds().CenterPoint().x(); + EXPECT_LT(button_->image()->bounds().right(), button_->label()->bounds().x()); + int center_align_label_midpoint = + button_->label()->bounds().CenterPoint().x(); EXPECT_LT(left_align_label_midpoint, center_align_label_midpoint); button_->SetHorizontalAlignment(gfx::ALIGN_RIGHT); button_->Layout(); - EXPECT_LT(button_->label_->bounds().right(), button_->image_->bounds().x()); + EXPECT_LT(button_->label()->bounds().right(), button_->image()->bounds().x()); button_->SetText(base::string16()); EXPECT_GT(button_->GetPreferredSize().width(), text_width + image_size);