diff --git a/DEPS b/DEPS index 87decfab..e3c095c 100644 --- a/DEPS +++ b/DEPS
@@ -40,11 +40,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '29437eb5c782ff49b9c2a23ef5dd4a54e9e45c44', + 'skia_revision': 'e2d4141679805b4c2a711d113f2b7360cb50924c', # 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': 'ea41bdf04435ffb17bee19a4d97b7083da0cd63e', + 'v8_revision': 'd689ef2e187e8755649680d75bb97be04b507daf', # 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/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc index bd74a18..cc34930 100644 --- a/chrome/browser/safe_browsing/download_protection_service.cc +++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -1358,10 +1358,9 @@ *(request.add_alternate_extensions()) = base::FilePath(default_file_path_.FinalExtension()).AsUTF8Unsafe(); } - service_->AddReferrerChainToClientDownloadRequest( - requestor_url_, - nullptr, - &request); + + // TODO(676691): We should add reliable download referrer chain for PPAPI + // downloads too. if (!request.SerializeToString(&client_download_request_data_)) { // More of an internal error than anything else. Note that the UNKNOWN @@ -1821,7 +1820,7 @@ "SafeBrowsing.ReferrerAttributionResult.DownloadAttribution", result, SafeBrowsingNavigationObserverManager::ATTRIBUTION_FAILURE_TYPE_MAX); for (auto entry : attribution_chain) - *out_request->add_referrer_chain() = std::move(entry); + out_request->add_referrer_chain()->Swap(&entry); } } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc index 0d14f7827..2ebc790a 100644 --- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc +++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc
@@ -394,7 +394,7 @@ nav_event->target_tab_id); referrer_chain_entry.set_navigation_time_msec( nav_event->last_updated.ToJavaTime()); - referrer_chain->push_back(referrer_chain_entry); + referrer_chain->push_back(std::move(referrer_chain_entry)); } } // namespace safe_browsing
diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc index 9acf3918..cf9eeb76 100644 --- a/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc +++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc
@@ -116,6 +116,16 @@ password_manager::BuildPasswordStore< content::BrowserContext, testing::StrictMock<password_manager::MockPasswordStore>>); +#if !defined(OS_MACOSX) + // TODO(crbug.com/668155): Remove conditional compilation when + // PasswordReuseDetector initialization will be implemented for Mac. + // The call of FillAutofillableLogins is caused by a posted task for an + // initialization of PasswordReuseDetector in the call of + // BuildPasswordStore() in the previous code. There is no thread race since + // unit tests run in one thread, and any post task will be executed after + // finishing the current function. + EXPECT_CALL(*GetStore(), FillAutofillableLogins(_)); +#endif } void TearDown() override {
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc index ce444efd..91b12dd6 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc
@@ -192,6 +192,7 @@ } #if defined(OS_LINUX) && !defined(OS_CHROMEOS) +// TODO(crbug.com/676746): Fix and re-enable this test. IN_PROC_BROWSER_TEST_F(OmniboxViewViewsTest, DISABLED_SelectionClipboard) { OmniboxView* omnibox_view = NULL; ASSERT_NO_FATAL_FAILURE(GetOmniboxViewForBrowser(browser(), &omnibox_view));
diff --git a/components/filesystem/directory_impl.cc b/components/filesystem/directory_impl.cc index 5174477a..8577078a 100644 --- a/components/filesystem/directory_impl.cc +++ b/components/filesystem/directory_impl.cc
@@ -224,7 +224,8 @@ } void DirectoryImpl::Flush(const FlushCallback& callback) { - base::File file(directory_path_, base::File::FLAG_READ); + base::File file(directory_path_, + base::File::FLAG_OPEN | base::File::FLAG_READ); if (!file.IsValid()) { callback.Run(GetError(file)); return;
diff --git a/components/filesystem/directory_impl_unittest.cc b/components/filesystem/directory_impl_unittest.cc index 250c6de2..771749704 100644 --- a/components/filesystem/directory_impl_unittest.cc +++ b/components/filesystem/directory_impl_unittest.cc
@@ -276,6 +276,18 @@ } } +TEST_F(DirectoryImplTest, Flush) { + mojom::DirectoryPtr directory; + GetTemporaryRoot(&directory); + mojom::FileError error; + + { + bool handled = directory->Flush(&error); + ASSERT_TRUE(handled); + EXPECT_EQ(mojom::FileError::OK, error); + } +} + // TODO(vtl): Test delete flags. } // namespace
diff --git a/components/network_session_configurator/network_session_configurator.cc b/components/network_session_configurator/network_session_configurator.cc index 6074c56..6100395 100644 --- a/components/network_session_configurator/network_session_configurator.cc +++ b/components/network_session_configurator/network_session_configurator.cc
@@ -5,6 +5,7 @@ #include "components/network_session_configurator/network_session_configurator.h" #include <map> +#include <unordered_set> #include "base/metrics/field_trial.h" #include "base/strings/string_number_conversions.h" @@ -17,6 +18,7 @@ #include "net/http/http_stream_factory.h" #include "net/quic/chromium/quic_utils_chromium.h" #include "net/quic/core/quic_packets.h" +#include "net/spdy/spdy_protocol.h" #include "net/url_request/url_fetcher.h" namespace { @@ -53,11 +55,40 @@ params->enable_tcp_fast_open_for_ssl = true; } +net::SettingsMap GetHttp2Settings( + const VariationParameters& http2_trial_params) { + net::SettingsMap http2_settings; + + const std::string settings_string = + GetVariationParam(http2_trial_params, "http2_settings"); + + base::StringPairs key_value_pairs; + if (!base::SplitStringIntoKeyValuePairs(settings_string, ':', ',', + &key_value_pairs)) { + return http2_settings; + } + + for (auto key_value : key_value_pairs) { + uint32_t key; + if (!base::StringToUint(key_value.first, &key)) + continue; + uint32_t value; + if (!base::StringToUint(key_value.second, &value)) + continue; + http2_settings[static_cast<net::SpdySettingsIds>(key)] = value; + } + + return http2_settings; +} + void ConfigureHttp2Params(base::StringPiece http2_trial_group, + const VariationParameters& http2_trial_params, net::HttpNetworkSession::Params* params) { if (http2_trial_group.starts_with(kHttp2FieldTrialDisablePrefix)) { params->enable_http2 = false; + return; } + params->http2_settings = GetHttp2Settings(http2_trial_params); } bool ShouldEnableQuic(base::StringPiece quic_trial_group, @@ -211,16 +242,13 @@ bool ShouldQuicRaceCertVerification( const VariationParameters& quic_trial_params) { - return base::LowerCaseEqualsASCII( - GetVariationParam(quic_trial_params, "race_cert_verification"), - "true"); + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "race_cert_verification"), "true"); } -bool ShouldQuicDoNotFragment( - const VariationParameters& quic_trial_params) { - return base::LowerCaseEqualsASCII( - GetVariationParam(quic_trial_params, "do_not_fragment"), - "true"); +bool ShouldQuicDoNotFragment(const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "do_not_fragment"), "true"); } bool ShouldQuicDisablePreConnectIfZeroRtt( @@ -399,7 +427,11 @@ std::string http2_trial_group = base::FieldTrialList::FindFullName(kHttp2FieldTrialName); - ConfigureHttp2Params(http2_trial_group, params); + VariationParameters http2_trial_params; + if (!variations::GetVariationParams(kHttp2FieldTrialName, + &http2_trial_params)) + http2_trial_params.clear(); + ConfigureHttp2Params(http2_trial_group, http2_trial_params, params); const std::string tfo_trial_group = base::FieldTrialList::FindFullName(kTCPFastOpenFieldTrialName);
diff --git a/components/network_session_configurator/network_session_configurator_unittest.cc b/components/network_session_configurator/network_session_configurator_unittest.cc index ccea4fb..09fd360 100644 --- a/components/network_session_configurator/network_session_configurator_unittest.cc +++ b/components/network_session_configurator/network_session_configurator_unittest.cc
@@ -13,6 +13,7 @@ #include "components/variations/variations_associated_data.h" #include "net/http/http_stream_factory.h" #include "net/quic/core/quic_packets.h" +#include "net/spdy/spdy_protocol.h" #include "testing/gtest/include/gtest/gtest.h" namespace test { @@ -46,6 +47,7 @@ EXPECT_EQ(0u, params_.testing_fixed_http_port); EXPECT_EQ(0u, params_.testing_fixed_https_port); EXPECT_TRUE(params_.enable_http2); + EXPECT_TRUE(params_.http2_settings.empty()); EXPECT_FALSE(params_.enable_tcp_fast_open_for_ssl); EXPECT_TRUE(params_.enable_quic_alternative_service_with_different_host); EXPECT_FALSE(params_.enable_quic); @@ -295,6 +297,20 @@ EXPECT_EQ(options, params_.quic_connection_options); } +TEST_F(NetworkSessionConfiguratorTest, Http2SettingsFromFieldTrialParams) { + std::map<std::string, std::string> field_trial_params; + field_trial_params["http2_settings"] = "7:1234,25:5678"; + variations::AssociateVariationParams("HTTP2", "Enabled", field_trial_params); + base::FieldTrialList::CreateFieldTrial("HTTP2", "Enabled"); + + ParseFieldTrials(); + + net::SettingsMap expected_settings; + expected_settings[static_cast<net::SpdySettingsIds>(7)] = 1234; + expected_settings[static_cast<net::SpdySettingsIds>(25)] = 5678; + EXPECT_EQ(expected_settings, params_.http2_settings); +} + TEST_F(NetworkSessionConfiguratorTest, QuicAlwaysRequireHandshakeConfirmationFromFieldTrialParams) { std::map<std::string, std::string> field_trial_params;
diff --git a/components/password_manager/core/browser/BUILD.gn b/components/password_manager/core/browser/BUILD.gn index 59b6188f..e83ebe7 100644 --- a/components/password_manager/core/browser/BUILD.gn +++ b/components/password_manager/core/browser/BUILD.gn
@@ -99,6 +99,8 @@ "password_reuse_detection_manager.h", "password_reuse_detector.cc", "password_reuse_detector.h", + "password_reuse_detector_consumer.cc", + "password_reuse_detector_consumer.h", "password_store.cc", "password_store.h", "password_store_change.cc",
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc index ac7f358..2278bff 100644 --- a/components/password_manager/core/browser/password_form_manager.cc +++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -299,16 +299,16 @@ OtherPossibleUsernamesAction action) { DCHECK_NE(RESULT_NO_MATCH, DoesManage(credentials)); - std::unique_ptr<autofill::PasswordForm> mutable_provisionally_saved_form( + std::unique_ptr<autofill::PasswordForm> mutable_submitted_form( new PasswordForm(credentials)); if (credentials.IsPossibleChangePasswordForm() && !credentials.username_value.empty() && IsProbablyNotUsername(credentials.username_value)) { - mutable_provisionally_saved_form->username_value.clear(); - mutable_provisionally_saved_form->username_element.clear(); + mutable_submitted_form->username_value.clear(); + mutable_submitted_form->username_element.clear(); is_possible_change_password_form_without_username_ = true; } - provisionally_saved_form_ = std::move(mutable_provisionally_saved_form); + submitted_form_ = std::move(mutable_submitted_form); other_possible_username_action_ = action; does_look_like_signup_form_ = credentials.does_look_like_signup_form; @@ -486,7 +486,7 @@ // If password store was slow and provisionally saved form is already here // then create pending credentials (see http://crbug.com/470322). - if (provisionally_saved_form_) + if (submitted_form_) CreatePendingCredentials(); for (auto const& driver : drivers_) @@ -684,8 +684,7 @@ autofill::ServerFieldTypeSet available_field_types; if (has_autofill_vote) { if (is_update) { - if (!provisionally_saved_form_ || - provisionally_saved_form_->new_password_element.empty()) + if (!submitted_form_ || submitted_form_->new_password_element.empty()) return false; SetAutofillTypesOnUpdate(password_type, &form_structure, &available_field_types); @@ -726,19 +725,17 @@ password_type == autofill::PROBABLY_NEW_PASSWORD || password_type == autofill::NOT_NEW_PASSWORD) << password_type; - DCHECK(!provisionally_saved_form_->new_password_element.empty()); + DCHECK(!submitted_form_->new_password_element.empty()); // Create a map from field names to field types. std::map<base::string16, autofill::ServerFieldType> field_types; - if (!provisionally_saved_form_->username_element.empty()) { - field_types[provisionally_saved_form_->username_element] = - autofill::USERNAME; + if (!submitted_form_->username_element.empty()) { + field_types[submitted_form_->username_element] = autofill::USERNAME; } - if (!provisionally_saved_form_->password_element.empty()) { - field_types[provisionally_saved_form_->password_element] = - autofill::PASSWORD; + if (!submitted_form_->password_element.empty()) { + field_types[submitted_form_->password_element] = autofill::PASSWORD; } - field_types[provisionally_saved_form_->new_password_element] = password_type; + field_types[submitted_form_->new_password_element] = password_type; // Find all password fields after |new_password_element| and set their type to // |password_type|. They are considered to be confirmation fields. @@ -752,7 +749,7 @@ field_types[field.name] = password_type; // We don't care about password fields after a confirmation field. break; - } else if (field.name == provisionally_saved_form_->new_password_element) { + } else if (field.name == submitted_form_->new_password_element) { is_new_password_field_found = true; } } @@ -868,15 +865,14 @@ } void PasswordFormManager::CreatePendingCredentials() { - DCHECK(provisionally_saved_form_); - base::string16 password_to_save(PasswordToSave(*provisionally_saved_form_)); + DCHECK(submitted_form_); + base::string16 password_to_save(PasswordToSave(*submitted_form_)); // Make sure the important fields stay the same as the initially observed or // autofilled ones, as they may have changed if the user experienced a login // failure. // Look for these credentials in the list containing auto-fill entries. - const PasswordForm* saved_form = - FindBestSavedMatch(provisionally_saved_form_.get()); + const PasswordForm* saved_form = FindBestSavedMatch(submitted_form_.get()); if (saved_form != nullptr) { // The user signed in with a login we autofilled. pending_credentials_ = *saved_form; @@ -906,9 +902,8 @@ UpdateMetadataForUsage(&pending_credentials_); // Update |pending_credentials_| in order to be able correctly save it. - pending_credentials_.origin = provisionally_saved_form_->origin; - pending_credentials_.signon_realm = - provisionally_saved_form_->signon_realm; + pending_credentials_.origin = submitted_form_->origin; + pending_credentials_.signon_realm = submitted_form_->signon_realm; // Normally, the copy of the PSL matched credentials, adapted for the // current domain, is saved automatically without asking the user, because @@ -916,7 +911,7 @@ // the user already agreed to store a password. // // However, if the user changes the suggested password, it might indicate - // that the autofilled credentials and |provisionally_saved_form_| + // that the autofilled credentials and |submitted_form_| // actually correspond to two different accounts (see // http://crbug.com/385619). In that case the user should be asked again // before saving the password. This is ensured by setting @@ -924,9 +919,9 @@ // |origin| and |signon_realm| to correct values. // // There is still the edge case when the autofilled credentials represent - // the same account as |provisionally_saved_form_| but the stored password + // the same account as |submitted_form_| but the stored password // was out of date. In that case, the user just had to manually enter the - // new password, which is now in |provisionally_saved_form_|. The best + // new password, which is now in |submitted_form_|. The best // thing would be to save automatically, and also update the original // credentials. However, we have no way to tell if this is the case. // This will likely happen infrequently, and the inconvenience put on the @@ -944,25 +939,23 @@ } else if (other_possible_username_action_ == ALLOW_OTHER_POSSIBLE_USERNAMES && UpdatePendingCredentialsIfOtherPossibleUsername( - provisionally_saved_form_->username_value)) { + submitted_form_->username_value)) { // |pending_credentials_| is now set. Note we don't update // |pending_credentials_.username_value| to |credentials.username_value| // yet because we need to keep the original username to modify the stored // credential. - selected_username_ = provisionally_saved_form_->username_value; + selected_username_ = submitted_form_->username_value; is_new_login_ = false; } else if (!best_matches_.empty() && - provisionally_saved_form_->type != - autofill::PasswordForm::TYPE_API && - (provisionally_saved_form_ - ->IsPossibleChangePasswordFormWithoutUsername() || - provisionally_saved_form_->username_element.empty())) { - const PasswordForm* best_update_match = FindBestMatchForUpdatePassword( - provisionally_saved_form_->password_value); + submitted_form_->type != autofill::PasswordForm::TYPE_API && + (submitted_form_->IsPossibleChangePasswordFormWithoutUsername() || + submitted_form_->username_element.empty())) { + const PasswordForm* best_update_match = + FindBestMatchForUpdatePassword(submitted_form_->password_value); retry_password_form_password_update_ = - provisionally_saved_form_->username_element.empty() && - provisionally_saved_form_->new_password_element.empty(); + submitted_form_->username_element.empty() && + submitted_form_->new_password_element.empty(); is_new_login_ = false; if (best_update_match) { @@ -975,14 +968,14 @@ } else { // We don't care about |pending_credentials_| if we didn't find the best // match, since the user will select the correct one. - pending_credentials_.origin = provisionally_saved_form_->origin; + pending_credentials_.origin = submitted_form_->origin; } } else { CreatePendingCredentialsForNewCredentials(); } if (!IsValidAndroidFacetURI(pending_credentials_.signon_realm)) { - pending_credentials_.action = provisionally_saved_form_->action; + pending_credentials_.action = submitted_form_->action; // If the user selected credentials we autofilled from a PasswordForm // that contained no action URL (IE6/7 imported passwords, for example), // bless it with the action URL from the observed form. See bug 1107719. @@ -991,21 +984,19 @@ } pending_credentials_.password_value = password_to_save; - pending_credentials_.preferred = provisionally_saved_form_->preferred; - CopyFieldPropertiesMasks(*provisionally_saved_form_, &pending_credentials_); + pending_credentials_.preferred = submitted_form_->preferred; + CopyFieldPropertiesMasks(*submitted_form_, &pending_credentials_); // If we're dealing with an API-driven provisionally saved form, then take // the server provided values. We don't do this for non-API forms, as // those will never have those members set. - if (provisionally_saved_form_->type == autofill::PasswordForm::TYPE_API) { - pending_credentials_.skip_zero_click = - provisionally_saved_form_->skip_zero_click; - pending_credentials_.display_name = provisionally_saved_form_->display_name; - pending_credentials_.federation_origin = - provisionally_saved_form_->federation_origin; - pending_credentials_.icon_url = provisionally_saved_form_->icon_url; + if (submitted_form_->type == autofill::PasswordForm::TYPE_API) { + pending_credentials_.skip_zero_click = submitted_form_->skip_zero_click; + pending_credentials_.display_name = submitted_form_->display_name; + pending_credentials_.federation_origin = submitted_form_->federation_origin; + pending_credentials_.icon_url = submitted_form_->icon_url; // Take the correct signon_realm for federated credentials. - pending_credentials_.signon_realm = provisionally_saved_form_->signon_realm; + pending_credentials_.signon_realm = submitted_form_->signon_realm; } if (user_action_ == kUserActionOverridePassword && @@ -1153,13 +1144,11 @@ // User typed in a new, unknown username. SetUserAction(kUserActionOverrideUsernameAndPassword); pending_credentials_ = observed_form_; - if (provisionally_saved_form_->was_parsed_using_autofill_predictions) - pending_credentials_.username_element = - provisionally_saved_form_->username_element; - pending_credentials_.username_value = - provisionally_saved_form_->username_value; + if (submitted_form_->was_parsed_using_autofill_predictions) + pending_credentials_.username_element = submitted_form_->username_element; + pending_credentials_.username_value = submitted_form_->username_value; pending_credentials_.other_possible_usernames = - provisionally_saved_form_->other_possible_usernames; + submitted_form_->other_possible_usernames; // The password value will be filled in later, remove any garbage for now. pending_credentials_.password_value.clear(); @@ -1169,7 +1158,7 @@ // are likely different than those on a login form, so do not bother saving // them. We will fill them with meaningful values during update when the user // goes onto a real login form for the first time. - if (!provisionally_saved_form_->new_password_element.empty()) { + if (!submitted_form_->new_password_element.empty()) { pending_credentials_.password_element.clear(); } }
diff --git a/components/password_manager/core/browser/password_form_manager.h b/components/password_manager/core/browser/password_form_manager.h index a8368830..6f599b6 100644 --- a/components/password_manager/core/browser/password_form_manager.h +++ b/components/password_manager/core/browser/password_form_manager.h
@@ -177,8 +177,8 @@ void MarkGenerationAvailable() { generation_available_ = true; } // Returns the provisionally saved form, if it exists, otherwise nullptr. - const autofill::PasswordForm* provisionally_saved_form() const { - return provisionally_saved_form_.get(); + const autofill::PasswordForm* submitted_form() const { + return submitted_form_.get(); } // Returns the pending credentials. @@ -470,7 +470,7 @@ const autofill::PasswordForm observed_form_; // Stores a submitted form. - std::unique_ptr<const autofill::PasswordForm> provisionally_saved_form_; + std::unique_ptr<const autofill::PasswordForm> submitted_form_; // Stores if for creating |pending_credentials_| other possible usernames // option should apply. @@ -483,7 +483,7 @@ // Stores updated credentials when the form was submitted but success is still // unknown. This variable contains credentials that are ready to be written // (saved or updated) to a password store. It is calculated based on - // |provisionally_saved_form_| and |best_matches_|. + // |submitted_form_| and |best_matches_|. autofill::PasswordForm pending_credentials_; // Whether pending_credentials_ stores a new login or is an update @@ -541,7 +541,7 @@ // |observed_form_| but also on the credentials that the user submitted. bool is_possible_change_password_form_without_username_; - // True if |provisionally_saved_form_| looks like SignUp form according to + // True if |submitted_form_| looks like SignUp form according to // local heuristics. bool does_look_like_signup_form_ = false;
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index dae3950..dc06e20 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc
@@ -333,11 +333,11 @@ manager.swap(*matched_manager_it); pending_login_managers_.erase(matched_manager_it); - PasswordForm provisionally_saved_form(form); - provisionally_saved_form.preferred = true; + PasswordForm submitted_form(form); + submitted_form.preferred = true; if (logger) { logger->LogPasswordForm(Logger::STRING_PROVISIONALLY_SAVED_FORM, - provisionally_saved_form); + submitted_form); } PasswordFormManager::OtherPossibleUsernamesAction action = PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES; @@ -348,7 +348,7 @@ Logger::STRING_IGNORE_POSSIBLE_USERNAMES, action == PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); } - manager->ProvisionallySave(provisionally_saved_form, action); + manager->ProvisionallySave(submitted_form, action); provisional_save_manager_.swap(manager); // Cache the user-visible URL (i.e., the one seen in the omnibox). Once the @@ -678,9 +678,9 @@ *provisional_save_manager_); if (base::FeatureList::IsEnabled(features::kDropSyncCredential)) { - DCHECK(provisional_save_manager_->provisionally_saved_form()); + DCHECK(provisional_save_manager_->submitted_form()); if (!client_->GetStoreResultFilter()->ShouldSave( - *provisional_save_manager_->provisionally_saved_form())) { + *provisional_save_manager_->submitted_form())) { provisional_save_manager_->WipeStoreCopyIfOutdated(); RecordFailure(SYNC_CREDENTIAL, provisional_save_manager_->observed_form().origin,
diff --git a/components/password_manager/core/browser/password_manager_test_utils.cc b/components/password_manager/core/browser/password_manager_test_utils.cc index 3e0817d..4fd5193 100644 --- a/components/password_manager/core/browser/password_manager_test_utils.cc +++ b/components/password_manager/core/browser/password_manager_test_utils.cc
@@ -104,4 +104,8 @@ MockPasswordStoreObserver::~MockPasswordStoreObserver() {} +MockPasswordReuseDetectorConsumer::MockPasswordReuseDetectorConsumer() {} + +MockPasswordReuseDetectorConsumer::~MockPasswordReuseDetectorConsumer() {} + } // namespace password_manager
diff --git a/components/password_manager/core/browser/password_manager_test_utils.h b/components/password_manager/core/browser/password_manager_test_utils.h index 4f49d56..3f7cbdd 100644 --- a/components/password_manager/core/browser/password_manager_test_utils.h +++ b/components/password_manager/core/browser/password_manager_test_utils.h
@@ -83,6 +83,14 @@ MOCK_METHOD1(OnLoginsChanged, void(const PasswordStoreChangeList& changes)); }; +class MockPasswordReuseDetectorConsumer : public PasswordReuseDetectorConsumer { + public: + MockPasswordReuseDetectorConsumer(); + ~MockPasswordReuseDetectorConsumer() override; + + MOCK_METHOD2(OnReuseFound, void(const base::string16&, const std::string&)); +}; + } // namespace password_manager #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_TEST_UTILS_H_
diff --git a/components/password_manager/core/browser/password_reuse_detector.cc b/components/password_manager/core/browser/password_reuse_detector.cc index cde8904e2..bcb4790 100644 --- a/components/password_manager/core/browser/password_reuse_detector.cc +++ b/components/password_manager/core/browser/password_reuse_detector.cc
@@ -5,6 +5,7 @@ #include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/autofill/core/common/password_form.h" +#include "components/password_manager/core/browser/password_reuse_detector_consumer.h" #include "components/password_manager/core/browser/psl_matching_helper.h" namespace password_manager { @@ -22,14 +23,16 @@ void PasswordReuseDetector::OnGetPasswordStoreResults( std::vector<std::unique_ptr<autofill::PasswordForm>> results) { - passwords_.clear(); - for (const auto& form : results) { - const base::string16& password = form->password_value; - if (password.size() < kMinPasswordLengthToCheck) - continue; - GURL signon_realm(form->signon_realm); - const std::string domain = GetRegistryControlledDomain(signon_realm); - passwords_[password].insert(domain); + for (const auto& form : results) + AddPassword(*form); +} + +void PasswordReuseDetector::OnLoginsChanged( + const PasswordStoreChangeList& changes) { + for (const auto& change : changes) { + if (change.type() == PasswordStoreChange::ADD || + change.type() == PasswordStoreChange::UPDATE) + AddPassword(change.form()); } } @@ -59,4 +62,13 @@ } } +void PasswordReuseDetector::AddPassword(const autofill::PasswordForm& form) { + const base::string16& password = form.password_value; + if (password.size() < kMinPasswordLengthToCheck) + return; + GURL signon_realm(form.signon_realm); + const std::string domain = GetRegistryControlledDomain(signon_realm); + passwords_[password].insert(domain); +} + } // namespace password_manager
diff --git a/components/password_manager/core/browser/password_reuse_detector.h b/components/password_manager/core/browser/password_reuse_detector.h index 91b2bdb..9cc36147 100644 --- a/components/password_manager/core/browser/password_reuse_detector.h +++ b/components/password_manager/core/browser/password_reuse_detector.h
@@ -13,18 +13,12 @@ #include "base/macros.h" #include "base/strings/string16.h" +#include "components/password_manager/core/browser/password_store_change.h" #include "components/password_manager/core/browser/password_store_consumer.h" namespace password_manager { -// Callback interface for receiving a password reuse event. -class PasswordReuseDetectorConsumer { - public: - // Called when a password reuse is found. - // |saved_domain| is the domain on which |password| is saved. - virtual void OnReuseFound(const base::string16& password, - const std::string& saved_domain) = 0; -}; +class PasswordReuseDetectorConsumer; // Per-profile class responsible for detection of password reuse, i.e. that the // user input on some site contains the password saved on another site. @@ -40,6 +34,9 @@ void OnGetPasswordStoreResults( std::vector<std::unique_ptr<autofill::PasswordForm>> results) override; + // Add new or updated passwords from |changes| to internal password index. + void OnLoginsChanged(const PasswordStoreChangeList& changes); + // Checks that some suffix of |input| equals to a password saved on another // registry controlled domain than |domain|. // If such suffix is found, |consumer|->OnReuseFound() is called on the same @@ -50,6 +47,9 @@ PasswordReuseDetectorConsumer* consumer); private: + // Add password from |form| to |passwords_|. + void AddPassword(const autofill::PasswordForm& form); + // Contains all passwords. // A key is a password. // A value is a set of registry controlled domains on which the password
diff --git a/components/password_manager/core/browser/password_reuse_detector_consumer.cc b/components/password_manager/core/browser/password_reuse_detector_consumer.cc new file mode 100644 index 0000000..9f64c86 --- /dev/null +++ b/components/password_manager/core/browser/password_reuse_detector_consumer.cc
@@ -0,0 +1,13 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/password_manager/core/browser/password_reuse_detector_consumer.h" + +namespace password_manager { + +PasswordReuseDetectorConsumer::PasswordReuseDetectorConsumer() {} + +PasswordReuseDetectorConsumer::~PasswordReuseDetectorConsumer() {} + +} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_reuse_detector_consumer.h b/components/password_manager/core/browser/password_reuse_detector_consumer.h new file mode 100644 index 0000000..170fe6e2 --- /dev/null +++ b/components/password_manager/core/browser/password_reuse_detector_consumer.h
@@ -0,0 +1,30 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_REUSE_DETECTOR_CONSUMER_H_ +#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_REUSE_DETECTOR_CONSUMER_H_ + +#include <string> + +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "base/strings/string16.h" + +namespace password_manager { + +// Callback interface for receiving a password reuse event. +class PasswordReuseDetectorConsumer + : public base::SupportsWeakPtr<PasswordReuseDetectorConsumer> { + public: + PasswordReuseDetectorConsumer(); + virtual ~PasswordReuseDetectorConsumer(); + + // Called when a password reuse is found. + // |saved_domain| is the domain on which |password| is saved. + virtual void OnReuseFound(const base::string16& password, + const std::string& saved_domain) = 0; +}; + +} // namespace password_manager +#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_REUSE_DETECTOR_CONSUMER_H_
diff --git a/components/password_manager/core/browser/password_reuse_detector_unittest.cc b/components/password_manager/core/browser/password_reuse_detector_unittest.cc index af8b769..24e40f9e 100644 --- a/components/password_manager/core/browser/password_reuse_detector_unittest.cc +++ b/components/password_manager/core/browser/password_reuse_detector_unittest.cc
@@ -10,6 +10,7 @@ #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/common/password_form.h" +#include "components/password_manager/core/browser/password_manager_test_utils.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -21,11 +22,6 @@ namespace { -class MockPasswordReuseDetectorConsumer : public PasswordReuseDetectorConsumer { - public: - MOCK_METHOD2(OnReuseFound, void(const base::string16&, const std::string&)); -}; - std::vector<std::unique_ptr<PasswordForm>> GetSavedForms() { std::vector<std::unique_ptr<PasswordForm>> result; std::vector<std::pair<std::string, std::string>> domains_passwords = { @@ -44,6 +40,16 @@ return result; } +PasswordStoreChangeList GetChangeList( + PasswordStoreChange::Type type, + const std::vector<std::unique_ptr<PasswordForm>>& forms) { + PasswordStoreChangeList changes; + for (const auto& form : forms) + changes.push_back(PasswordStoreChange(type, *form)); + + return changes; +} + TEST(PasswordReuseDetectorTest, TypingPasswordOnDifferentSite) { PasswordReuseDetector reuse_detector; reuse_detector.OnGetPasswordStoreResults(GetSavedForms()); @@ -106,6 +112,26 @@ &mockConsumer); } +TEST(PasswordReuseDetectorTest, OnLoginsChanged) { + for (PasswordStoreChange::Type type : + {PasswordStoreChange::ADD, PasswordStoreChange::UPDATE, + PasswordStoreChange::REMOVE}) { + PasswordReuseDetector reuse_detector; + PasswordStoreChangeList changes = GetChangeList(type, GetSavedForms()); + reuse_detector.OnLoginsChanged(changes); + MockPasswordReuseDetectorConsumer mockConsumer; + + if (type == PasswordStoreChange::REMOVE) { + EXPECT_CALL(mockConsumer, OnReuseFound(_, _)).Times(0); + } else { + EXPECT_CALL(mockConsumer, + OnReuseFound(ASCIIToUTF16("password"), "google.com")); + } + reuse_detector.CheckReuse(ASCIIToUTF16("123password"), "https://evil.com", + &mockConsumer); + } +} + } // namespace } // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc index b5a8a136..aa1bc8f 100644 --- a/components/password_manager/core/browser/password_store.cc +++ b/components/password_manager/core/browser/password_store.cc
@@ -59,6 +59,21 @@ consumer_weak_, base::Passed(&stats))); } +PasswordStore::CheckReuseRequest::CheckReuseRequest( + PasswordReuseDetectorConsumer* consumer) + : origin_task_runner_(base::ThreadTaskRunnerHandle::Get()), + consumer_weak_(consumer->AsWeakPtr()) {} + +PasswordStore::CheckReuseRequest::~CheckReuseRequest() {} + +void PasswordStore::CheckReuseRequest::OnReuseFound( + const base::string16& password, + const std::string& saved_domain) { + origin_task_runner_->PostTask( + FROM_HERE, base::Bind(&PasswordReuseDetectorConsumer::OnReuseFound, + consumer_weak_, password, saved_domain)); +} + PasswordStore::FormDigest::FormDigest(autofill::PasswordForm::Scheme new_scheme, const std::string& new_signon_realm, const GURL& new_origin) @@ -91,11 +106,10 @@ db_thread_runner_(db_thread_runner), observers_(new base::ObserverListThreadSafe<Observer>()), is_propagating_password_changes_to_web_credentials_enabled_(false), - shutdown_called_(false) { -} + shutdown_called_(false) {} bool PasswordStore::Init(const syncer::SyncableService::StartSyncFlare& flare) { - ScheduleTask(base::Bind(&PasswordStore::InitSyncableService, this, flare)); + ScheduleTask(base::Bind(&PasswordStore::InitOnBackgroundThread, this, flare)); return true; } @@ -272,7 +286,7 @@ } void PasswordStore::ShutdownOnUIThread() { - ScheduleTask(base::Bind(&PasswordStore::DestroySyncableService, this)); + ScheduleTask(base::Bind(&PasswordStore::DestroyOnBackgroundThread, this)); // The AffiliationService must be destroyed from the main thread. affiliated_match_helper_.reset(); shutdown_called_ = true; @@ -285,6 +299,14 @@ return syncable_service_->AsWeakPtr(); } +void PasswordStore::CheckReuse(const base::string16& input, + const std::string& domain, + PasswordReuseDetectorConsumer* consumer) { + auto check_reuse_request = base::MakeUnique<CheckReuseRequest>(consumer); + ScheduleTask(base::Bind(&PasswordStore::CheckReuseImpl, this, + base::Passed(&check_reuse_request), input, domain)); +} + PasswordStore::~PasswordStore() { DCHECK(shutdown_called_); } @@ -349,9 +371,18 @@ observers_->Notify(FROM_HERE, &Observer::OnLoginsChanged, changes); if (syncable_service_) syncable_service_->ActOnPasswordStoreChanges(changes); + if (reuse_detector_) + reuse_detector_->OnLoginsChanged(changes); } } +void PasswordStore::CheckReuseImpl(std::unique_ptr<CheckReuseRequest> request, + const base::string16& input, + const std::string& domain) { + if (reuse_detector_) + reuse_detector_->CheckReuse(input, domain, request.get()); +} + void PasswordStore::Schedule( void (PasswordStore::*func)(std::unique_ptr<GetLoginsRequest>), PasswordStoreConsumer* consumer) { @@ -653,17 +684,25 @@ updated_android_form, affiliated_web_realms)); } -void PasswordStore::InitSyncableService( +void PasswordStore::InitOnBackgroundThread( const syncer::SyncableService::StartSyncFlare& flare) { DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); DCHECK(!syncable_service_); syncable_service_.reset(new PasswordSyncableService(this)); syncable_service_->InjectStartSyncFlare(flare); + reuse_detector_.reset(new PasswordReuseDetector); +#if !defined(OS_MACOSX) + // TODO(crbug.com/668155): For non-migrated keychain users it can lead to + // hundreds of requests to unlock keychain. + GetAutofillableLoginsImpl( + base::MakeUnique<GetLoginsRequest>(reuse_detector_.get())); +#endif } -void PasswordStore::DestroySyncableService() { +void PasswordStore::DestroyOnBackgroundThread() { DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); syncable_service_.reset(); + reuse_detector_.reset(); } std::ostream& operator<<(std::ostream& os,
diff --git a/components/password_manager/core/browser/password_store.h b/components/password_manager/core/browser/password_store.h index 28a7046..4c24357 100644 --- a/components/password_manager/core/browser/password_store.h +++ b/components/password_manager/core/browser/password_store.h
@@ -17,6 +17,8 @@ #include "base/single_thread_task_runner.h" #include "base/time/time.h" #include "components/keyed_service/core/refcounted_keyed_service.h" +#include "components/password_manager/core/browser/password_reuse_detector.h" +#include "components/password_manager/core/browser/password_reuse_detector_consumer.h" #include "components/password_manager/core/browser/password_store_change.h" #include "components/password_manager/core/browser/password_store_sync.h" #include "components/sync/model/syncable_service.h" @@ -221,6 +223,15 @@ base::WeakPtr<syncer::SyncableService> GetPasswordSyncableService(); + // Checks that some suffix of |input| equals to a password saved on another + // registry controlled domain than |domain|. + // If such suffix is found, |consumer|->OnReuseFound() is called on the same + // thread on which this method is called. + // |consumer| must not be null. + void CheckReuse(const base::string16& input, + const std::string& domain, + PasswordReuseDetectorConsumer* consumer); + protected: friend class base::RefCountedThreadSafe<PasswordStore>; @@ -256,6 +267,26 @@ DISALLOW_COPY_AND_ASSIGN(GetLoginsRequest); }; + // Represents a single CheckReuse() request. Implements functionality to + // listen to reuse events and propagate them to |consumer| on the thread on + // which CheckReuseRequest is created. + class CheckReuseRequest : public PasswordReuseDetectorConsumer { + public: + // |consumer| must not be null. + explicit CheckReuseRequest(PasswordReuseDetectorConsumer* consumer); + ~CheckReuseRequest() override; + + // PasswordReuseDetectorConsumer + void OnReuseFound(const base::string16& password, + const std::string& saved_domain) override; + + private: + const scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_; + const base::WeakPtr<PasswordReuseDetectorConsumer> consumer_weak_; + + DISALLOW_COPY_AND_ASSIGN(CheckReuseRequest); + }; + ~PasswordStore() override; // Get the TaskRunner to use for PasswordStore background tasks. @@ -348,6 +379,11 @@ // may have been changed. void NotifyLoginsChanged(const PasswordStoreChangeList& changes) override; + // Synchronous implementation of CheckReuse(). + void CheckReuseImpl(std::unique_ptr<CheckReuseRequest> request, + const base::string16& input, + const std::string& domain); + // TaskRunner for tasks that run on the main thread (usually the UI thread). scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner_; @@ -482,18 +518,20 @@ const autofill::PasswordForm& updated_android_form, const std::vector<std::string>& affiliated_web_realms); - // Creates PasswordSyncableService instance on the background thread. - void InitSyncableService( + // Creates PasswordSyncableService and PasswordReuseDetector instances on the + // background thread. + void InitOnBackgroundThread( const syncer::SyncableService::StartSyncFlare& flare); - // Deletes PasswordSyncableService instance on the background thread. - void DestroySyncableService(); + // Deletes objest that should be destroyed on the background thread. + void DestroyOnBackgroundThread(); // The observers. scoped_refptr<base::ObserverListThreadSafe<Observer>> observers_; std::unique_ptr<PasswordSyncableService> syncable_service_; std::unique_ptr<AffiliatedMatchHelper> affiliated_match_helper_; + std::unique_ptr<PasswordReuseDetector> reuse_detector_; bool is_propagating_password_changes_to_web_credentials_enabled_; bool shutdown_called_;
diff --git a/components/password_manager/core/browser/password_store_unittest.cc b/components/password_manager/core/browser/password_store_unittest.cc index c811bb4..e546994 100644 --- a/components/password_manager/core/browser/password_store_unittest.cc +++ b/components/password_manager/core/browser/password_store_unittest.cc
@@ -840,4 +840,56 @@ } } +#if !defined(OS_MACOSX) +// TODO(crbug.com/668155): Enable this test after fixing issues with +// initialization PasswordStore with MockKeyChain in tests on MacOS. +TEST_F(PasswordStoreTest, CheckPasswordReuse) { + static constexpr PasswordFormData kTestCredentials[] = { + {PasswordForm::SCHEME_HTML, "https://www.google.com", + "https://www.google.com", "", L"", L"", L"", L"", L"password", true, 1}, + {PasswordForm::SCHEME_HTML, "https://facebook.com", + "https://facebook.com", "", L"", L"", L"", L"", L"topsecret", true, 1}}; + + scoped_refptr<PasswordStoreDefault> store(new PasswordStoreDefault( + base::ThreadTaskRunnerHandle::Get(), base::ThreadTaskRunnerHandle::Get(), + base::MakeUnique<LoginDatabase>(test_login_db_file_path()))); + store->Init(syncer::SyncableService::StartSyncFlare()); + + for (const auto& test_credentials : kTestCredentials) { + auto credentials = CreatePasswordFormFromDataForTesting(test_credentials); + store->AddLogin(*credentials); + base::RunLoop().RunUntilIdle(); + } + + static constexpr struct { + const wchar_t* input; + const char* domain; + const wchar_t* reused_password; // Set to nullptr if no reuse is expected. + const char* reuse_domain; + } kReuseTestData[] = { + {L"12345password", "https://evil.com", L"password", "google.com"}, + {L"1234567890", "https://evil.com", nullptr, nullptr}, + {L"topsecret", "https://m.facebook.com", nullptr, nullptr}, + }; + + for (const auto& test_data : kReuseTestData) { + MockPasswordReuseDetectorConsumer mock_consumer; + if (test_data.reused_password) { + EXPECT_CALL(mock_consumer, + OnReuseFound(base::WideToUTF16(test_data.reused_password), + std::string(test_data.reuse_domain))); + } else { + EXPECT_CALL(mock_consumer, OnReuseFound(_, _)).Times(0); + } + + store->CheckReuse(base::WideToUTF16(test_data.input), test_data.domain, + &mock_consumer); + base::RunLoop().RunUntilIdle(); + } + + store->ShutdownOnUIThread(); + base::RunLoop().RunUntilIdle(); +} +#endif + } // namespace password_manager
diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm index 2857c87..283fe19 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm +++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
@@ -158,8 +158,12 @@ @"AXAccessKey", @"AXARIAAtomic", @"AXARIABusy", + @"AXARIAColumnCount", + @"AXARIAColumnIndex", @"AXARIALive", @"AXARIARelevant", + @"AXARIARowCount", + @"AXARIARowIndex", @"AXARIASetSize", @"AXARIAPosInSet", NSAccessibilityColumnIndexRangeAttribute,
diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc index 69f4e3c..69d3743 100644 --- a/content/browser/accessibility/browser_accessibility.cc +++ b/content/browser/accessibility/browser_accessibility.cc
@@ -991,6 +991,12 @@ GetRole() == ui::AX_ROLE_ROW_HEADER); } +bool BrowserAccessibility::IsTableOrGridOrTreeGridRole() const { + return (GetRole() == ui::AX_ROLE_TABLE || + GetRole() == ui::AX_ROLE_GRID || + GetRole() == ui::AX_ROLE_TREE_GRID); +} + bool BrowserAccessibility::HasCaret() const { if (IsSimpleTextControl() && HasIntAttribute(ui::AX_ATTR_TEXT_SEL_START) && HasIntAttribute(ui::AX_ATTR_TEXT_SEL_END)) {
diff --git a/content/browser/accessibility/browser_accessibility.h b/content/browser/accessibility/browser_accessibility.h index 322444231..4c888908 100644 --- a/content/browser/accessibility/browser_accessibility.h +++ b/content/browser/accessibility/browser_accessibility.h
@@ -330,9 +330,12 @@ // Returns true if the bit corresponding to the given state enum is 1. bool HasState(ui::AXState state_enum) const; - // Returns true if this node is an cell or an table header. + // Returns true if this node is a cell or a table header. bool IsCellOrTableHeaderRole() const; + // Returns true if this node is a table, a grid or a treegrid. + bool IsTableOrGridOrTreeGridRole() const; + // Returns true if the caret is active on this object. bool HasCaret() const;
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm index 545a8d42..041793a 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -51,9 +51,13 @@ // Private WebKit accessibility attributes. NSString* const NSAccessibilityARIAAtomicAttribute = @"AXARIAAtomic"; NSString* const NSAccessibilityARIABusyAttribute = @"AXARIABusy"; +NSString* const NSAccessibilityARIAColumnCountAttribute = @"AXARIAColumnCount"; +NSString* const NSAccessibilityARIAColumnIndexAttribute = @"AXARIAColumnIndex"; NSString* const NSAccessibilityARIALiveAttribute = @"AXARIALive"; NSString* const NSAccessibilityARIAPosInSetAttribute = @"AXARIAPosInSet"; NSString* const NSAccessibilityARIARelevantAttribute = @"AXARIARelevant"; +NSString* const NSAccessibilityARIARowCountAttribute = @"AXARIARowCount"; +NSString* const NSAccessibilityARIARowIndexAttribute = @"AXARIARowIndex"; NSString* const NSAccessibilityARIASetSizeAttribute = @"AXARIASetSize"; NSString* const NSAccessibilityAccessKeyAttribute = @"AXAccessKey"; NSString* const NSAccessibilityDropEffectsAttribute = @"AXDropEffects"; @@ -528,9 +532,13 @@ } attributeToMethodNameContainer[] = { {NSAccessibilityARIAAtomicAttribute, @"ariaAtomic"}, {NSAccessibilityARIABusyAttribute, @"ariaBusy"}, + {NSAccessibilityARIAColumnCountAttribute, @"ariaColumnCount"}, + {NSAccessibilityARIAColumnIndexAttribute, @"ariaColumnIndex"}, {NSAccessibilityARIALiveAttribute, @"ariaLive"}, {NSAccessibilityARIAPosInSetAttribute, @"ariaPosInSet"}, {NSAccessibilityARIARelevantAttribute, @"ariaRelevant"}, + {NSAccessibilityARIARowCountAttribute, @"ariaRowCount"}, + {NSAccessibilityARIARowIndexAttribute, @"ariaRowIndex"}, {NSAccessibilityARIASetSizeAttribute, @"ariaSetSize"}, {NSAccessibilityAccessKeyAttribute, @"accessKey"}, {NSAccessibilityChildrenAttribute, @"children"}, @@ -647,6 +655,26 @@ GetState(browserAccessibility_, ui::AX_STATE_BUSY)]; } +- (NSNumber*)ariaColumnCount { + if (!browserAccessibility_->IsTableOrGridOrTreeGridRole()) + return nil; + int count = -1; + if (!browserAccessibility_->GetIntAttribute( + ui::AX_ATTR_ARIA_COL_COUNT, &count)) + return nil; + return [NSNumber numberWithInt:count]; +} + +- (NSNumber*)ariaColumnIndex { + if (!browserAccessibility_->IsCellOrTableHeaderRole()) + return nil; + int index = -1; + if (!browserAccessibility_->GetIntAttribute( + ui::AX_ATTR_ARIA_COL_INDEX, &index)) + return nil; + return [NSNumber numberWithInt:index]; +} + - (NSString*)ariaLive { if (![self instanceActive]) return nil; @@ -668,6 +696,26 @@ ui::AX_ATTR_LIVE_RELEVANT); } +- (NSNumber*)ariaRowCount { + if (!browserAccessibility_->IsTableOrGridOrTreeGridRole()) + return nil; + int count = -1; + if (!browserAccessibility_->GetIntAttribute( + ui::AX_ATTR_ARIA_ROW_COUNT, &count)) + return nil; + return [NSNumber numberWithInt:count]; +} + +- (NSNumber*)ariaRowIndex { + if (!browserAccessibility_->IsCellOrTableHeaderRole()) + return nil; + int index = -1; + if (!browserAccessibility_->GetIntAttribute( + ui::AX_ATTR_ARIA_ROW_INDEX, &index)) + return nil; + return [NSNumber numberWithInt:index]; +} + - (NSNumber*)ariaSetSize { if (![self instanceActive]) return nil; @@ -2474,7 +2522,9 @@ NSAccessibilityRowsAttribute, NSAccessibilityVisibleRowsAttribute, NSAccessibilityVisibleCellsAttribute, NSAccessibilityHeaderAttribute, NSAccessibilityColumnHeaderUIElementsAttribute, - NSAccessibilityRowHeaderUIElementsAttribute + NSAccessibilityRowHeaderUIElementsAttribute, + NSAccessibilityARIAColumnCountAttribute, + NSAccessibilityARIARowCountAttribute, ]]; } else if ([role isEqualToString:NSAccessibilityColumnRole]) { [ret addObjectsFromArray:@[ @@ -2484,7 +2534,10 @@ } else if ([role isEqualToString:NSAccessibilityCellRole]) { [ret addObjectsFromArray:@[ NSAccessibilityColumnIndexRangeAttribute, - NSAccessibilityRowIndexRangeAttribute, @"AXSortDirection" + NSAccessibilityRowIndexRangeAttribute, + NSAccessibilityARIAColumnIndexAttribute, + NSAccessibilityARIARowIndexAttribute, + @"AXSortDirection", ]]; } else if ([role isEqualToString:@"AXWebArea"]) { [ret addObjectsFromArray:@[
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc index 53cd159..6331c616 100644 --- a/content/browser/accessibility/browser_accessibility_win.cc +++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -3968,6 +3968,19 @@ } } + // Expose aria-colcount and aria-rowcount in a table, grid or treegrid. + if (IsTableOrGridOrTreeGridRole()) { + IntAttributeToIA2(ui::AX_ATTR_ARIA_COL_COUNT, "colcount"); + IntAttributeToIA2(ui::AX_ATTR_ARIA_ROW_COUNT, "rowcount"); + } + + // Expose aria-colindex and aria-rowindex in a cell or row. + if (IsCellOrTableHeaderRole() || GetRole() == ui::AX_ROLE_ROW) { + if (GetRole() != ui::AX_ROLE_ROW) + IntAttributeToIA2(ui::AX_ATTR_ARIA_COL_INDEX, "colindex"); + IntAttributeToIA2(ui::AX_ATTR_ARIA_ROW_INDEX, "rowindex"); + } + // Expose row or column header sort direction. int32_t sort_direction; if ((ia_role() == ROLE_SYSTEM_COLUMNHEADER || @@ -4023,6 +4036,15 @@ if (GetIntAttribute(ui::AX_ATTR_MEMBER_OF_ID, &member_of_id)) AddRelation(IA2_RELATION_MEMBER_OF, member_of_id); + // Expose slider value. + if (ia_role() == ROLE_SYSTEM_PROGRESSBAR || + ia_role() == ROLE_SYSTEM_SCROLLBAR || + ia_role() == ROLE_SYSTEM_SLIDER) { + base::string16 value_text = GetValueText(); + SanitizeStringAttributeForIA2(value_text, &value_text); + win_attributes_->ia2_attributes.push_back(L"valuetext:" + value_text); + } + UpdateRequiredAttributes(); // If this is a web area for a presentational iframe, give it a role of // something other than DOCUMENT so that the fact that it's a separate doc @@ -5037,13 +5059,19 @@ } void BrowserAccessibilityWin::UpdateRequiredAttributes() { - // Expose slider value. - if (ia_role() == ROLE_SYSTEM_PROGRESSBAR || - ia_role() == ROLE_SYSTEM_SCROLLBAR || - ia_role() == ROLE_SYSTEM_SLIDER) { - base::string16 value_text = GetValueText(); - SanitizeStringAttributeForIA2(value_text, &value_text); - win_attributes_->ia2_attributes.push_back(L"valuetext:" + value_text); + if (IsCellOrTableHeaderRole()) { + // Expose colspan attribute. + base::string16 colspan; + if (GetHtmlAttribute("aria-colspan", &colspan)) { + SanitizeStringAttributeForIA2(colspan, &colspan); + win_attributes_->ia2_attributes.push_back(L"colspan:" + colspan); + } + // Expose rowspan attribute. + base::string16 rowspan; + if (GetHtmlAttribute("aria-rowspan", &rowspan)) { + SanitizeStringAttributeForIA2(rowspan, &rowspan); + win_attributes_->ia2_attributes.push_back(L"rowspan:" + rowspan); + } } // Expose dropeffect attribute.
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 766f201..7bcb594 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -224,6 +224,10 @@ RunAriaTest(FILE_PATH_LITERAL("aria-checked.html")); } +IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaColAttr) { + RunAriaTest(FILE_PATH_LITERAL("aria-col-attr.html")); +} + IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaColumnHeader) { RunAriaTest(FILE_PATH_LITERAL("aria-columnheader.html")); @@ -517,6 +521,10 @@ RunAriaTest(FILE_PATH_LITERAL("aria-row.html")); } +IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaRowAttr) { + RunAriaTest(FILE_PATH_LITERAL("aria-row-attr.html")); +} + IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaRowGroup) { RunAriaTest(FILE_PATH_LITERAL("aria-rowgroup.html")); }
diff --git a/content/browser/dom_storage/local_storage_context_mojo.cc b/content/browser/dom_storage/local_storage_context_mojo.cc index 9763625..241daedd 100644 --- a/content/browser/dom_storage/local_storage_context_mojo.cc +++ b/content/browser/dom_storage/local_storage_context_mojo.cc
@@ -5,6 +5,8 @@ #include "content/browser/dom_storage/local_storage_context_mojo.h" #include "base/memory/ptr_util.h" +#include "base/strings/string_number_conversions.h" +#include "components/leveldb/public/cpp/util.h" #include "content/browser/leveldb_wrapper_impl.h" #include "content/common/dom_storage/dom_storage_types.h" #include "services/file/public/interfaces/constants.mojom.h" @@ -13,8 +15,22 @@ namespace content { +// LevelDB database schema +// ======================= +// +// Version 1 (in sorted order): +// key: "VERSION" +// value: "1" +// +// key: "_" + <url::Origin> 'origin'> + '\x00' + <script controlled key> +// value: <script controlled value> + namespace { +const char kVersionKey[] = "VERSION"; const char kOriginSeparator = '\x00'; +const char kDataPrefix[] = "_"; +const int64_t kMinSchemaVersion = 1; +const int64_t kCurrentSchemaVersion = 1; } LocalStorageContextMojo::LocalStorageContextMojo( @@ -61,9 +77,9 @@ if (connection_state_ == CONNECTION_IN_PROGRESS) { // Queue this OpenLocalStorage call for when we have a level db pointer. - on_database_opened_callbacks_.push_back(base::Bind( + on_database_opened_callbacks_.push_back(base::BindOnce( &LocalStorageContextMojo::BindLocalStorage, - weak_ptr_factory_.GetWeakPtr(), origin, base::Passed(&request))); + weak_ptr_factory_.GetWeakPtr(), origin, std::move(request))); return; } @@ -72,6 +88,8 @@ void LocalStorageContextMojo::SetDatabaseForTesting( leveldb::mojom::LevelDBDatabasePtr database) { + DCHECK_EQ(connection_state_, NO_CONNECTION); + connection_state_ = CONNECTION_IN_PROGRESS; database_ = std::move(database); OnDatabaseOpened(leveldb::mojom::DatabaseError::OK); } @@ -82,6 +100,24 @@ level_db_wrappers_.erase(origin); } +std::vector<leveldb::mojom::BatchedOperationPtr> +LocalStorageContextMojo::OnLevelDBWrapperPrepareToCommit() { + std::vector<leveldb::mojom::BatchedOperationPtr> operations; + + // Write schema version if not already done so before. + if (!database_initialized_) { + leveldb::mojom::BatchedOperationPtr item = + leveldb::mojom::BatchedOperation::New(); + item->key = leveldb::StdStringToUint8Vector(kVersionKey); + item->value = leveldb::StdStringToUint8Vector( + base::Int64ToString(kCurrentSchemaVersion)); + operations.push_back(std::move(item)); + database_initialized_ = true; + } + + return operations; +} + void LocalStorageContextMojo::OnUserServiceConnectionComplete() { CHECK_EQ(service_manager::mojom::ConnectResult::SUCCEEDED, file_service_connection_->GetResult()); @@ -125,11 +161,47 @@ directory_.reset(); file_system_.reset(); - // |leveldb_| should be known to either be valid or invalid by now. Run our + // Verify DB schema version. + if (database_) { + database_->Get(leveldb::StdStringToUint8Vector(kVersionKey), + base::Bind(&LocalStorageContextMojo::OnGotDatabaseVersion, + weak_ptr_factory_.GetWeakPtr())); + return; + } + + OnGotDatabaseVersion(leveldb::mojom::DatabaseError::IO_ERROR, + std::vector<uint8_t>()); +} + +void LocalStorageContextMojo::OnGotDatabaseVersion( + leveldb::mojom::DatabaseError status, + const std::vector<uint8_t>& value) { + if (status == leveldb::mojom::DatabaseError::NOT_FOUND) { + // New database, nothing more to do. Current version will get written + // when first data is committed. + } else if (status == leveldb::mojom::DatabaseError::OK) { + // Existing database, check if version number matches current schema + // version. + int64_t db_version; + if (!base::StringToInt64(leveldb::Uint8VectorToStdString(value), + &db_version) || + db_version < kMinSchemaVersion || db_version > kCurrentSchemaVersion) { + // TODO(mek): delete and recreate database, rather than failing outright. + database_ = nullptr; + } + + database_initialized_ = true; + } else { + // Other read error. Possibly database corruption. + // TODO(mek): delete and recreate database, rather than failing outright. + database_ = nullptr; + } + + // |database_| should be known to either be valid or invalid by now. Run our // delayed bindings. connection_state_ = CONNECTION_FINISHED; for (size_t i = 0; i < on_database_opened_callbacks_.size(); ++i) - on_database_opened_callbacks_[i].Run(); + std::move(on_database_opened_callbacks_[i]).Run(); on_database_opened_callbacks_.clear(); } @@ -150,12 +222,14 @@ auto found = level_db_wrappers_.find(origin); if (found == level_db_wrappers_.end()) { level_db_wrappers_[origin] = base::MakeUnique<LevelDBWrapperImpl>( - database_.get(), origin.Serialize() + kOriginSeparator, + database_.get(), kDataPrefix + origin.Serialize() + kOriginSeparator, kPerStorageAreaQuota + kPerStorageAreaOverQuotaAllowance, base::TimeDelta::FromSeconds(kCommitDefaultDelaySecs), kMaxBytesPerHour, kMaxCommitsPerHour, base::Bind(&LocalStorageContextMojo::OnLevelDBWrapperHasNoBindings, - base::Unretained(this), origin)); + base::Unretained(this), origin), + base::Bind(&LocalStorageContextMojo::OnLevelDBWrapperPrepareToCommit, + base::Unretained(this))); found = level_db_wrappers_.find(origin); }
diff --git a/content/browser/dom_storage/local_storage_context_mojo.h b/content/browser/dom_storage/local_storage_context_mojo.h index 6ca0df4..b8b9fb1d 100644 --- a/content/browser/dom_storage/local_storage_context_mojo.h +++ b/content/browser/dom_storage/local_storage_context_mojo.h
@@ -37,12 +37,16 @@ private: void OnLevelDBWrapperHasNoBindings(const url::Origin& origin); + std::vector<leveldb::mojom::BatchedOperationPtr> + OnLevelDBWrapperPrepareToCommit(); void OnUserServiceConnectionComplete(); void OnUserServiceConnectionError(); // Part of our asynchronous directory opening called from OpenLocalStorage(). void OnDirectoryOpened(filesystem::mojom::FileError err); void OnDatabaseOpened(leveldb::mojom::DatabaseError status); + void OnGotDatabaseVersion(leveldb::mojom::DatabaseError status, + const std::vector<uint8_t>& value); // The (possibly delayed) implementation of OpenLocalStorage(). Can be called // directly from that function, or through |on_database_open_callbacks_|. @@ -57,6 +61,7 @@ CONNECTION_IN_PROGRESS, CONNECTION_FINISHED } connection_state_ = NO_CONNECTION; + bool database_initialized_ = false; std::unique_ptr<service_manager::Connection> file_service_connection_; @@ -66,7 +71,7 @@ leveldb::mojom::LevelDBServicePtr leveldb_service_; leveldb::mojom::LevelDBDatabasePtr database_; - std::vector<base::Closure> on_database_opened_callbacks_; + std::vector<base::OnceClosure> on_database_opened_callbacks_; // Maps between an origin and its prefixed LevelDB view. std::map<url::Origin, std::unique_ptr<LevelDBWrapperImpl>> level_db_wrappers_;
diff --git a/content/browser/dom_storage/local_storage_context_mojo_unittest.cc b/content/browser/dom_storage/local_storage_context_mojo_unittest.cc index df2242f..0da3bd6 100644 --- a/content/browser/dom_storage/local_storage_context_mojo_unittest.cc +++ b/content/browser/dom_storage/local_storage_context_mojo_unittest.cc
@@ -20,29 +20,45 @@ void NoOpSuccess(bool success) {} +void GetCallback(const base::Closure& callback, + bool* success_out, + std::vector<uint8_t>* value_out, + bool success, + const std::vector<uint8_t>& value) { + *success_out = success; + *value_out = value; + callback.Run(); +} + } // namespace class LocalStorageContextMojoTest : public testing::Test { public: - LocalStorageContextMojoTest() - : db_(&mock_data_), - db_binding_(&db_), - context_(nullptr, base::FilePath()) { - context_.SetDatabaseForTesting(db_binding_.CreateInterfacePtrAndBind()); - } + LocalStorageContextMojoTest() : db_(&mock_data_), db_binding_(&db_) {} - LocalStorageContextMojo* context() { return &context_; } + LocalStorageContextMojo* context() { + if (!context_) { + context_ = + base::MakeUnique<LocalStorageContextMojo>(nullptr, base::FilePath()); + context_->SetDatabaseForTesting(db_binding_.CreateInterfacePtrAndBind()); + } + return context_.get(); + } const std::map<std::vector<uint8_t>, std::vector<uint8_t>>& mock_data() { return mock_data_; } + void set_mock_data(const std::string& key, const std::string& value) { + mock_data_[StdStringToUint8Vector(key)] = StdStringToUint8Vector(value); + } + private: TestBrowserThreadBundle thread_bundle_; std::map<std::vector<uint8_t>, std::vector<uint8_t>> mock_data_; MockLevelDBDatabase db_; mojo::Binding<leveldb::mojom::LevelDBDatabase> db_binding_; - LocalStorageContextMojo context_; + std::unique_ptr<LocalStorageContextMojo> context_; }; TEST_F(LocalStorageContextMojoTest, Basic) { @@ -56,8 +72,9 @@ wrapper.reset(); base::RunLoop().RunUntilIdle(); - ASSERT_EQ(1u, mock_data().size()); - EXPECT_EQ(value, mock_data().begin()->second); + + ASSERT_EQ(2u, mock_data().size()); + EXPECT_EQ(value, mock_data().rbegin()->second); } TEST_F(LocalStorageContextMojoTest, OriginsAreIndependent) { @@ -77,8 +94,64 @@ wrapper.reset(); base::RunLoop().RunUntilIdle(); - ASSERT_EQ(2u, mock_data().size()); - EXPECT_EQ(value, mock_data().begin()->second); + ASSERT_EQ(3u, mock_data().size()); + EXPECT_EQ(value, mock_data().rbegin()->second); +} + +TEST_F(LocalStorageContextMojoTest, ValidVersion) { + set_mock_data("VERSION", "1"); + set_mock_data(std::string("_http://foobar.com") + '\x00' + "key", "value"); + + mojom::LevelDBWrapperPtr wrapper; + context()->OpenLocalStorage(url::Origin(GURL("http://foobar.com")), + MakeRequest(&wrapper)); + + base::RunLoop run_loop; + bool success = false; + std::vector<uint8_t> result; + wrapper->Get( + StdStringToUint8Vector("key"), + base::Bind(&GetCallback, run_loop.QuitClosure(), &success, &result)); + run_loop.Run(); + EXPECT_TRUE(success); + EXPECT_EQ(StdStringToUint8Vector("value"), result); +} + +TEST_F(LocalStorageContextMojoTest, InvalidVersion) { + set_mock_data("VERSION", "foobar"); + set_mock_data(std::string("_http://foobar.com") + '\x00' + "key", "value"); + + mojom::LevelDBWrapperPtr wrapper; + context()->OpenLocalStorage(url::Origin(GURL("http://foobar.com")), + MakeRequest(&wrapper)); + + base::RunLoop run_loop; + bool success = false; + std::vector<uint8_t> result; + wrapper->Get( + StdStringToUint8Vector("key"), + base::Bind(&GetCallback, run_loop.QuitClosure(), &success, &result)); + run_loop.Run(); + EXPECT_FALSE(success); +} + +TEST_F(LocalStorageContextMojoTest, VersionOnlyWrittenOnCommit) { + mojom::LevelDBWrapperPtr wrapper; + context()->OpenLocalStorage(url::Origin(GURL("http://foobar.com")), + MakeRequest(&wrapper)); + + base::RunLoop run_loop; + bool success = false; + std::vector<uint8_t> result; + wrapper->Get( + StdStringToUint8Vector("key"), + base::Bind(&GetCallback, run_loop.QuitClosure(), &success, &result)); + run_loop.Run(); + EXPECT_FALSE(success); + wrapper.reset(); + + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(mock_data().empty()); } } // namespace content
diff --git a/content/browser/leveldb_wrapper_impl.cc b/content/browser/leveldb_wrapper_impl.cc index e60426a2..15ee20d 100644 --- a/content/browser/leveldb_wrapper_impl.cc +++ b/content/browser/leveldb_wrapper_impl.cc
@@ -41,9 +41,11 @@ base::TimeDelta default_commit_delay, int max_bytes_per_hour, int max_commits_per_hour, - const base::Closure& no_bindings_callback) + const base::Closure& no_bindings_callback, + const PrepareToCommitCallback& prepare_to_commit_callback) : prefix_(leveldb::StdStringToUint8Vector(prefix)), no_bindings_callback_(no_bindings_callback), + prepare_to_commit_callback_(prepare_to_commit_callback), database_(database), bytes_used_(0), max_size_(max_size), @@ -243,6 +245,12 @@ if (on_load_complete_tasks_.size() > 1) return; + if (!database_) { + OnLoadComplete(leveldb::mojom::DatabaseError::IO_ERROR, + std::vector<leveldb::mojom::KeyValuePtr>()); + return; + } + // TODO(michaeln): Import from sqlite localstorage db. database_->GetPrefixed(prefix_, base::Bind(&LevelDBWrapperImpl::OnLoadComplete, @@ -328,7 +336,8 @@ commit_rate_limiter_.add_samples(1); // Commit all our changes in a single batch. - std::vector<leveldb::mojom::BatchedOperationPtr> operations; + std::vector<leveldb::mojom::BatchedOperationPtr> operations = + prepare_to_commit_callback_.Run(); if (commit_batch_->clear_all_first) { leveldb::mojom::BatchedOperationPtr item = leveldb::mojom::BatchedOperation::New();
diff --git a/content/browser/leveldb_wrapper_impl.h b/content/browser/leveldb_wrapper_impl.h index df6104ae..d350f9b2 100644 --- a/content/browser/leveldb_wrapper_impl.h +++ b/content/browser/leveldb_wrapper_impl.h
@@ -32,6 +32,9 @@ // 4) Throttles requests to avoid overwhelming the disk. class CONTENT_EXPORT LevelDBWrapperImpl : public mojom::LevelDBWrapper { public: + using PrepareToCommitCallback = + base::Callback<std::vector<leveldb::mojom::BatchedOperationPtr>()>; + // |no_bindings_callback| will be called when this object has no more // bindings and all pending modifications have been processed. LevelDBWrapperImpl(leveldb::mojom::LevelDBDatabase* database, @@ -40,7 +43,8 @@ base::TimeDelta default_commit_delay, int max_bytes_per_hour, int max_commits_per_hour, - const base::Closure& no_bindings_callback); + const base::Closure& no_bindings_callback, + const PrepareToCommitCallback& prepare_to_commit_callback); ~LevelDBWrapperImpl() override; void Bind(mojom::LevelDBWrapperRequest request); @@ -118,6 +122,7 @@ mojo::BindingSet<mojom::LevelDBWrapper> bindings_; mojo::AssociatedInterfacePtrSet<mojom::LevelDBObserver> observers_; base::Closure no_bindings_callback_; + PrepareToCommitCallback prepare_to_commit_callback_; leveldb::mojom::LevelDBDatabase* database_; std::unique_ptr<ValueMap> map_; std::vector<base::Closure> on_load_complete_tasks_;
diff --git a/content/browser/leveldb_wrapper_impl_unittest.cc b/content/browser/leveldb_wrapper_impl_unittest.cc index eee1359..78fc9b17 100644 --- a/content/browser/leveldb_wrapper_impl_unittest.cc +++ b/content/browser/leveldb_wrapper_impl_unittest.cc
@@ -53,6 +53,9 @@ }; void NoOp() {} +std::vector<leveldb::mojom::BatchedOperationPtr> PrepareToCommitNoOp() { + return std::vector<leveldb::mojom::BatchedOperationPtr>(); +} void GetCallback(const base::Closure& callback, bool* success_out, @@ -92,7 +95,8 @@ base::TimeDelta::FromSeconds(5), 10 * 1024 * 1024 /* max_bytes_per_hour */, 60 /* max_commits_per_hour */, - base::Bind(&NoOp)), + base::Bind(&NoOp), + base::Bind(&PrepareToCommitNoOp)), observer_binding_(this) { set_mock_data(std::string(kTestPrefix) + "def", "defdata"); set_mock_data(std::string(kTestPrefix) + "123", "123data");
diff --git a/content/browser/media/capture/desktop_capture_device.cc b/content/browser/media/capture/desktop_capture_device.cc index 02e46a5..18a0934 100644 --- a/content/browser/media/capture/desktop_capture_device.cc +++ b/content/browser/media/capture/desktop_capture_device.cc
@@ -64,7 +64,7 @@ #if defined(OS_WIN) const base::Feature kDirectXCapturer{"DirectXCapturer", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; #endif class DesktopCaptureDevice::Core : public webrtc::DesktopCapturer::Callback {
diff --git a/content/renderer/accessibility/blink_ax_tree_source.cc b/content/renderer/accessibility/blink_ax_tree_source.cc index a0c4bc2..0b86f3b 100644 --- a/content/renderer/accessibility/blink_ax_tree_source.cc +++ b/content/renderer/accessibility/blink_ax_tree_source.cc
@@ -100,6 +100,8 @@ return "region"; case ui::AX_ROLE_SLIDER: return "slider"; + case ui::AX_ROLE_TIME: + return "time"; default: break; } @@ -609,6 +611,18 @@ } } + if (dst->role == ui::AX_ROLE_TABLE || + dst->role == ui::AX_ROLE_GRID || + dst->role == ui::AX_ROLE_TREE_GRID) { + int aria_colcount = src.ariaColumnCount(); + if (aria_colcount) + dst->AddIntAttribute(ui::AX_ATTR_ARIA_COL_COUNT, aria_colcount); + + int aria_rowcount = src.ariaRowCount(); + if (aria_rowcount) + dst->AddIntAttribute(ui::AX_ATTR_ARIA_ROW_COUNT, aria_rowcount); + } + if (dst->role == ui::AX_ROLE_ROW) { dst->AddIntAttribute(ui::AX_ATTR_TABLE_ROW_INDEX, src.rowIndex()); WebAXObject header = src.rowHeader(); @@ -625,18 +639,29 @@ if (dst->role == ui::AX_ROLE_CELL || dst->role == ui::AX_ROLE_ROW_HEADER || - dst->role == ui::AX_ROLE_COLUMN_HEADER) { - dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, - src.cellColumnIndex()); - dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, - src.cellColumnSpan()); - dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, - src.cellRowIndex()); - dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan()); + dst->role == ui::AX_ROLE_COLUMN_HEADER || + dst->role == ui::AX_ROLE_ROW) { + if (dst->role != ui::AX_ROLE_ROW) { + dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, + src.cellColumnIndex()); + dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, + src.cellColumnSpan()); + dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, + src.cellRowIndex()); + dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN,src.cellRowSpan()); + + int aria_colindex = src.ariaColumnIndex(); + if (aria_colindex) + dst->AddIntAttribute(ui::AX_ATTR_ARIA_COL_INDEX, aria_colindex); + } + + int aria_rowindex = src.ariaRowIndex(); + if (aria_rowindex) + dst->AddIntAttribute(ui::AX_ATTR_ARIA_ROW_INDEX, aria_rowindex); } if ((dst->role == ui::AX_ROLE_ROW_HEADER || - dst->role == ui::AX_ROLE_COLUMN_HEADER) && src.sortDirection()) { + dst->role == ui::AX_ROLE_COLUMN_HEADER) && src.sortDirection()) { dst->AddIntAttribute(ui::AX_ATTR_SORT_DIRECTION, AXSortDirectionFromBlink(src.sortDirection())); } @@ -694,8 +719,6 @@ std::string role = GetEquivalentAriaRoleString(dst->role); if (!role.empty()) dst->AddStringAttribute(ui::AX_ATTR_ROLE, role); - else if (dst->role == ui::AX_ROLE_TIME) - dst->AddStringAttribute(ui::AX_ATTR_ROLE, "time"); } // Browser plugin (used in a <webview>).
diff --git a/content/test/data/accessibility/aria/aria-col-attr-expected-android.txt b/content/test/data/accessibility/aria/aria-col-attr-expected-android.txt new file mode 100644 index 0000000..5386067 --- /dev/null +++ b/content/test/data/accessibility/aria/aria-col-attr-expected-android.txt
@@ -0,0 +1,16 @@ +android.webkit.WebView focusable focused scrollable +++android.widget.GridView role_description='table' collection row_count=2 column_count=4 +++++android.view.View +++++++android.view.View role_description='column header' collection_item heading name='cell 2' row_span=1 column_span=1 +++++++android.view.View role_description='column header' collection_item heading name='cell 4' row_span=1 column_index=1 column_span=1 +++++++android.view.View role_description='column header' collection_item heading name='cell 5' row_span=1 column_index=2 column_span=1 +++++android.view.View +++++++android.view.View role_description='cell' collection_item name='cell 2' row_index=1 row_span=1 column_span=1 +++++++android.view.View role_description='cell' collection_item name='cell 3' row_index=1 row_span=1 column_index=1 column_span=1 +++++++android.view.View role_description='cell' collection_item name='cell 4' row_index=1 row_span=1 column_index=2 column_span=1 +++++++android.view.View role_description='cell' collection_item name='cell 5' row_index=1 row_span=1 column_index=3 column_span=1 +++++android.view.View +++++android.view.View +++++android.view.View +++++android.view.View +++++android.view.View \ No newline at end of file
diff --git a/content/test/data/accessibility/aria/aria-col-attr-expected-blink.txt b/content/test/data/accessibility/aria/aria-col-attr-expected-blink.txt new file mode 100644 index 0000000..57c2c66 --- /dev/null +++ b/content/test/data/accessibility/aria/aria-col-attr-expected-blink.txt
@@ -0,0 +1,31 @@ +rootWebArea +++table ariaColCount=5 +++++row +++++++columnHeader ariaColIndex=2 +++++++++staticText name='cell 2' +++++++++++inlineTextBox name='cell 2' +++++++columnHeader ariaColIndex=4 +++++++++staticText name='cell 4' +++++++++++inlineTextBox name='cell 4' +++++++columnHeader ariaColIndex=5 +++++++++staticText name='cell 5' +++++++++++inlineTextBox name='cell 5' +++++row +++++++cell ariaColIndex=2 +++++++++staticText name='cell 2' +++++++++++inlineTextBox name='cell 2' +++++++cell ariaColIndex=3 +++++++++staticText name='cell 3' +++++++++++inlineTextBox name='cell 3' +++++++cell ariaColIndex=4 +++++++++staticText name='cell 4' +++++++++++inlineTextBox name='cell 4' +++++++cell ariaColIndex=5 +++++++++staticText name='cell 5' +++++++++++inlineTextBox name='cell 5' +++++column +++++column +++++column +++++column +++++tableHeaderContainer +<-- End-of-file --> \ No newline at end of file
diff --git a/content/test/data/accessibility/aria/aria-col-attr-expected-mac.txt b/content/test/data/accessibility/aria/aria-col-attr-expected-mac.txt new file mode 100644 index 0000000..96c51ad2 --- /dev/null +++ b/content/test/data/accessibility/aria/aria-col-attr-expected-mac.txt
@@ -0,0 +1,23 @@ +AXWebArea +++AXTable AXARIAColumnCount='5' +++++AXRow +++++++AXCell AXARIAColumnIndex='2' +++++++++AXStaticText AXValue='cell 2' +++++++AXCell AXARIAColumnIndex='4' +++++++++AXStaticText AXValue='cell 4' +++++++AXCell AXARIAColumnIndex='5' +++++++++AXStaticText AXValue='cell 5' +++++AXRow +++++++AXCell AXARIAColumnIndex='2' +++++++++AXStaticText AXValue='cell 2' +++++++AXCell AXARIAColumnIndex='3' +++++++++AXStaticText AXValue='cell 3' +++++++AXCell AXARIAColumnIndex='4' +++++++++AXStaticText AXValue='cell 4' +++++++AXCell AXARIAColumnIndex='5' +++++++++AXStaticText AXValue='cell 5' +++++AXColumn +++++AXColumn +++++AXColumn +++++AXColumn +++++AXGroup \ No newline at end of file
diff --git a/content/test/data/accessibility/aria/aria-col-attr-expected-win.txt b/content/test/data/accessibility/aria/aria-col-attr-expected-win.txt new file mode 100644 index 0000000..bd10684 --- /dev/null +++ b/content/test/data/accessibility/aria/aria-col-attr-expected-win.txt
@@ -0,0 +1,23 @@ +ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE +++ROLE_SYSTEM_TABLE colcount:5 +++++ROLE_SYSTEM_ROW +++++++ROLE_SYSTEM_COLUMNHEADER colindex:2 colspan:2 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 2' +++++++ROLE_SYSTEM_COLUMNHEADER colindex:4 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 4' +++++++ROLE_SYSTEM_COLUMNHEADER colindex:5 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 5' +++++ROLE_SYSTEM_ROW +++++++ROLE_SYSTEM_CELL colindex:2 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 2' +++++++ROLE_SYSTEM_CELL colindex:3 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 3' +++++++ROLE_SYSTEM_CELL colindex:4 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 4' +++++++ROLE_SYSTEM_CELL colindex:5 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 5' +++++ROLE_SYSTEM_COLUMN +++++ROLE_SYSTEM_COLUMN +++++ROLE_SYSTEM_COLUMN +++++ROLE_SYSTEM_COLUMN +++++IA2_ROLE_SECTION \ No newline at end of file
diff --git a/content/test/data/accessibility/aria/aria-col-attr.html b/content/test/data/accessibility/aria/aria-col-attr.html new file mode 100644 index 0000000..a77b5f63 --- /dev/null +++ b/content/test/data/accessibility/aria/aria-col-attr.html
@@ -0,0 +1,20 @@ +<!-- +@WIN-ALLOW:colcount* +@WIN-ALLOW:colindex* +@WIN-ALLOW:colspan* +@MAC-ALLOW:AXARIAColumn* +@BLINK-ALLOW:ariaCol* +--> +<div role="grid" aria-colcount="5"> + <div role="row"> + <span role="columnheader" aria-colindex="2" aria-colspan="2">cell 2</span> + <span role="columnheader" aria-colindex="4">cell 4</span> + <span role="columnheader" aria-colindex="5">cell 5</span> + </div> + <div role="row" aria-colindex="2"> + <span role="gridcell">cell 2</span> + <span role="gridcell">cell 3</span> + <span role="gridcell">cell 4</span> + <span role="gridcell">cell 5</span> + </div> +</div>
diff --git a/content/test/data/accessibility/aria/aria-row-attr-expected-android.txt b/content/test/data/accessibility/aria/aria-row-attr-expected-android.txt new file mode 100644 index 0000000..d1a00a7 --- /dev/null +++ b/content/test/data/accessibility/aria/aria-row-attr-expected-android.txt
@@ -0,0 +1,13 @@ +android.webkit.WebView focusable focused scrollable +++android.widget.GridView role_description='table' collection row_count=2 column_count=3 +++++android.view.View +++++++android.view.View role_description='column header' collection_item heading name='cell 2' row_span=1 column_span=1 +++++++android.view.View role_description='column header' collection_item heading name='cell 3' row_span=1 column_index=1 column_span=1 +++++++android.view.View role_description='column header' collection_item heading name='cell 4' row_span=1 column_index=2 column_span=1 +++++android.view.View +++++++android.view.View role_description='cell' collection_item name='cell 2' row_index=1 row_span=1 column_span=1 +++++++android.view.View role_description='cell' collection_item name='cell 3' row_index=1 row_span=1 column_index=1 column_span=1 +++++android.view.View +++++android.view.View +++++android.view.View +++++android.view.View \ No newline at end of file
diff --git a/content/test/data/accessibility/aria/aria-row-attr-expected-blink.txt b/content/test/data/accessibility/aria/aria-row-attr-expected-blink.txt new file mode 100644 index 0000000..10f2ad99 --- /dev/null +++ b/content/test/data/accessibility/aria/aria-row-attr-expected-blink.txt
@@ -0,0 +1,24 @@ +rootWebArea +++table ariaRowCount=5 +++++row +++++++columnHeader ariaRowIndex=3 +++++++++staticText name='cell 2' +++++++++++inlineTextBox name='cell 2' +++++++columnHeader ariaRowIndex=3 +++++++++staticText name='cell 3' +++++++++++inlineTextBox name='cell 3' +++++++columnHeader ariaRowIndex=3 +++++++++staticText name='cell 4' +++++++++++inlineTextBox name='cell 4' +++++row ariaRowIndex=4 +++++++cell ariaRowIndex=4 +++++++++staticText name='cell 2' +++++++++++inlineTextBox name='cell 2' +++++++cell ariaRowIndex=4 +++++++++staticText name='cell 3' +++++++++++inlineTextBox name='cell 3' +++++column +++++column +++++column +++++tableHeaderContainer +<-- End-of-file --> \ No newline at end of file
diff --git a/content/test/data/accessibility/aria/aria-row-attr-expected-mac.txt b/content/test/data/accessibility/aria/aria-row-attr-expected-mac.txt new file mode 100644 index 0000000..ae87e0d --- /dev/null +++ b/content/test/data/accessibility/aria/aria-row-attr-expected-mac.txt
@@ -0,0 +1,18 @@ +AXWebArea +++AXTable AXARIARowCount='5' +++++AXRow +++++++AXCell AXARIARowIndex='3' +++++++++AXStaticText AXValue='cell 2' +++++++AXCell AXARIARowIndex='3' +++++++++AXStaticText AXValue='cell 3' +++++++AXCell AXARIARowIndex='3' +++++++++AXStaticText AXValue='cell 4' +++++AXRow +++++++AXCell AXARIARowIndex='4' +++++++++AXStaticText AXValue='cell 2' +++++++AXCell AXARIARowIndex='4' +++++++++AXStaticText AXValue='cell 3' +++++AXColumn +++++AXColumn +++++AXColumn +++++AXGroup \ No newline at end of file
diff --git a/content/test/data/accessibility/aria/aria-row-attr-expected-win.txt b/content/test/data/accessibility/aria/aria-row-attr-expected-win.txt new file mode 100644 index 0000000..a606e21 --- /dev/null +++ b/content/test/data/accessibility/aria/aria-row-attr-expected-win.txt
@@ -0,0 +1,18 @@ +ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE +++ROLE_SYSTEM_TABLE rowcount:5 +++++ROLE_SYSTEM_ROW +++++++ROLE_SYSTEM_COLUMNHEADER rowindex:3 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 2' +++++++ROLE_SYSTEM_COLUMNHEADER rowindex:3 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 3' +++++++ROLE_SYSTEM_COLUMNHEADER rowindex:3 rowspan:2 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 4' +++++ROLE_SYSTEM_ROW rowindex:4 +++++++ROLE_SYSTEM_CELL rowindex:4 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 2' +++++++ROLE_SYSTEM_CELL rowindex:4 +++++++++ROLE_SYSTEM_STATICTEXT name='cell 3' +++++ROLE_SYSTEM_COLUMN +++++ROLE_SYSTEM_COLUMN +++++ROLE_SYSTEM_COLUMN +++++IA2_ROLE_SECTION \ No newline at end of file
diff --git a/content/test/data/accessibility/aria/aria-row-attr.html b/content/test/data/accessibility/aria/aria-row-attr.html new file mode 100644 index 0000000..d6b47f04 --- /dev/null +++ b/content/test/data/accessibility/aria/aria-row-attr.html
@@ -0,0 +1,18 @@ +<!-- +@WIN-ALLOW:rowcount* +@WIN-ALLOW:rowindex* +@WIN-ALLOW:rowspan* +@MAC-ALLOW:AXARIARow* +@BLINK-ALLOW:ariaRow* +--> +<div role="grid" aria-rowcount="5"> + <div role="row"> + <span role="columnheader" aria-rowindex="3">cell 2</span> + <span role="columnheader" aria-rowindex="3">cell 3</span> + <span role="columnheader" aria-rowindex="3" aria-rowspan="2">cell 4</span> + </div> + <div role="row" aria-rowindex="4"> + <span role="gridcell">cell 2</span> + <span role="gridcell">cell 3</span> + </div> +</div>
diff --git a/ios/chrome/app/DEPS b/ios/chrome/app/DEPS index d1625701..d9f00c2 100644 --- a/ios/chrome/app/DEPS +++ b/ios/chrome/app/DEPS
@@ -37,8 +37,5 @@ "+ios/web/net/request_tracker_factory_impl.h", "+ios/web/net/request_tracker_impl.h", "+ios/web/net/web_http_protocol_handler_delegate.h", - - # TODO(crbug.com/616288): Remove this exception. - "+ios/web/web_state/ui/crw_web_controller.h", ], }
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm index ea0326e..b88d59b 100644 --- a/ios/chrome/app/main_controller.mm +++ b/ios/chrome/app/main_controller.mm
@@ -137,11 +137,11 @@ #include "ios/web/net/request_tracker_factory_impl.h" #include "ios/web/net/request_tracker_impl.h" #include "ios/web/net/web_http_protocol_handler_delegate.h" +#import "ios/web/public/navigation_manager.h" #include "ios/web/public/web_capabilities.h" #include "ios/web/public/web_state/web_state.h" #import "ios/web/public/web_view_creation_util.h" #include "ios/web/public/webui/web_ui_ios_controller_factory.h" -#import "ios/web/web_state/ui/crw_web_controller.h" #include "mojo/edk/embedder/embedder.h" #import "net/base/mac/url_conversions.h" #include "net/url_request/url_request_context.h" @@ -2317,7 +2317,7 @@ #pragma mark - Tab opening utility methods. - (Tab*)openOrReuseTabInMode:(ApplicationMode)targetMode - withURL:(const GURL&)url + withURL:(const GURL&)URL transition:(ui::PageTransition)transition { BrowserViewController* targetBVC = targetMode == ApplicationMode::NORMAL ? self.mainBVC : self.otrBVC; @@ -2328,16 +2328,16 @@ currentURL = [currentTabInTargetBVC url]; if (!(currentTabInTargetBVC && IsURLNtp(currentURL))) { - return [targetBVC addSelectedTabWithURL:url + return [targetBVC addSelectedTabWithURL:URL atIndex:NSNotFound transition:transition]; } Tab* newTab = currentTabInTargetBVC; // Don't call loadWithParams for chrome://newtab, it's already loaded. - if (!(IsURLNtp(url))) { - web::NavigationManager::WebLoadParams params(url); - [[newTab webController] loadWithParams:params]; + if (!(IsURLNtp(URL))) { + web::NavigationManager::WebLoadParams params(URL); + [newTab webState]->GetNavigationManager()->LoadURLWithParams(params); } return newTab; }
diff --git a/ios/chrome/browser/ui/actions/BUILD.gn b/ios/chrome/browser/ui/actions/BUILD.gn index 361b2424..801952d 100644 --- a/ios/chrome/browser/ui/actions/BUILD.gn +++ b/ios/chrome/browser/ui/actions/BUILD.gn
@@ -6,6 +6,7 @@ sources = [ "settings_actions.h", "tab_grid_actions.h", + "tab_strip_actions.h", "tools_menu_actions.h", ]
diff --git a/ios/chrome/browser/ui/actions/tab_strip_actions.h b/ios/chrome/browser/ui/actions/tab_strip_actions.h new file mode 100644 index 0000000..a238c23 --- /dev/null +++ b/ios/chrome/browser/ui/actions/tab_strip_actions.h
@@ -0,0 +1,21 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ====== New Architecture ===== +// = This code is only used in the new iOS Chrome architecture. = +// ============================================================================ + +#ifndef IOS_CHROME_BROWSER_UI_ACTIONS_TAB_STRIP_ACTIONS_H_ +#define IOS_CHROME_BROWSER_UI_ACTIONS_TAB_STRIP_ACTIONS_H_ + +#import <Foundation/Foundation.h> + +// Target/Action methods relating to the tab strip. +@protocol TabStripActions +@optional +// Reveals or hides the tab strip. +- (void)toggleTabStrip:(id)sender; +@end + +#endif // IOS_CHROME_BROWSER_UI_ACTIONS_TAB_STRIP_ACTIONS_H_
diff --git a/ios/chrome/browser/ui/static_content/static_html_view_controller.mm b/ios/chrome/browser/ui/static_content/static_html_view_controller.mm index e2ee4d3..cd2e6331 100644 --- a/ios/chrome/browser/ui/static_content/static_html_view_controller.mm +++ b/ios/chrome/browser/ui/static_content/static_html_view_controller.mm
@@ -84,8 +84,10 @@ - (NSURL*)resourceURL; // Ensures that webView_ has been created, creating it if necessary. - (void)ensureWebViewCreated; -// Determines if the page load should begin based on the current |resourceURL|. -- (BOOL)shouldStartLoadWithRequest:(NSURLRequest*)request; +// Determines if the page load should begin based on the current |resourceURL| +// and if the request is issued by the main frame (|fromMainFrame|). +- (BOOL)shouldStartLoadWithRequest:(NSURLRequest*)request + fromMainFrame:(BOOL)fromMainFrame; @end @implementation StaticHtmlViewController @@ -199,9 +201,12 @@ decidePolicyForNavigationAction:(WKNavigationAction*)navigationAction decisionHandler: (void (^)(WKNavigationActionPolicy))decisionHandler { - decisionHandler([self shouldStartLoadWithRequest:navigationAction.request] - ? WKNavigationActionPolicyAllow - : WKNavigationActionPolicyCancel); + decisionHandler( + [self + shouldStartLoadWithRequest:navigationAction.request + fromMainFrame:[navigationAction.sourceFrame isMainFrame]] + ? WKNavigationActionPolicyAllow + : WKNavigationActionPolicyCancel); } #pragma mark - @@ -222,13 +227,15 @@ #pragma mark - #pragma mark Private -- (BOOL)shouldStartLoadWithRequest:(NSURLRequest*)request { +- (BOOL)shouldStartLoadWithRequest:(NSURLRequest*)request + fromMainFrame:(BOOL)fromMainFrame { // Only allow displaying the URL which correspond to the authorized resource. if ([[request URL] isEqual:[self resourceURL]]) return YES; - // All other URLs will be loaded by our UrlLoader if we have one. - if (loader_) { + // All other navigation URLs will be loaded by our UrlLoader if one exists and + // if they are issued by the main frame. + if (loader_ && fromMainFrame) { dispatch_async(dispatch_get_main_queue(), ^{ [loader_ loadURL:net::GURLWithNSURL([request URL]) referrer:referrer_
diff --git a/ios/chrome/browser/ui/strip/BUILD.gn b/ios/chrome/browser/ui/strip/BUILD.gn new file mode 100644 index 0000000..5819bc7 --- /dev/null +++ b/ios/chrome/browser/ui/strip/BUILD.gn
@@ -0,0 +1,16 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("strip_ui") { + sources = [ + "strip_container_view_controller.h", + "strip_container_view_controller.mm", + ] + deps = [ + "//ios/chrome/browser/ui:ui_clean_skeleton", + "//ios/chrome/browser/ui/actions", + ] + libs = [ "UIKit.framework" ] + configs += [ "//build/config/compiler:enable_arc" ] +}
diff --git a/ios/chrome/browser/ui/strip/strip_container_view_controller.h b/ios/chrome/browser/ui/strip/strip_container_view_controller.h new file mode 100644 index 0000000..17b6693 --- /dev/null +++ b/ios/chrome/browser/ui/strip/strip_container_view_controller.h
@@ -0,0 +1,31 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ====== New Architecture ===== +// = This code is only used in the new iOS Chrome architecture. = +// ============================================================================ + +#ifndef IOS_CHROME_BROWSER_UI_STRIP_STRIP_CONTAINER_VIEW_CONTROLLER_H_ +#define IOS_CHROME_BROWSER_UI_STRIP_STRIP_CONTAINER_VIEW_CONTROLLER_H_ + +#import <UIKit/UIKit.h> + +// Base class for a view controller that contains a content view (generally a +// web view with toolbar, but nothing in this class assumes that) and a strip +// view, each managed by their own view controllers. +@interface StripContainerViewController : UIViewController + +// View controller showing the main content. If there is no strip view +// controller set, the contents of this view controller will fill all of the +// strip container's view. +@property(nonatomic, strong) UIViewController* contentViewController; + +// View controller showing the strip. It will be of a fixed +// height (determined internally by the strip container), but will span the +// width of the tab. +@property(nonatomic, strong) UIViewController* stripViewController; + +@end + +#endif // IOS_CHROME_BROWSER_UI_STRIP_STRIP_CONTAINER_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/strip/strip_container_view_controller.mm b/ios/chrome/browser/ui/strip/strip_container_view_controller.mm new file mode 100644 index 0000000..2a0817fb --- /dev/null +++ b/ios/chrome/browser/ui/strip/strip_container_view_controller.mm
@@ -0,0 +1,229 @@ +// 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. + +// ====== New Architecture ===== +// = This code is only used in the new iOS Chrome architecture. = +// ============================================================================ + +#import "ios/chrome/browser/ui/strip/strip_container_view_controller.h" + +#import "ios/chrome/browser/ui/ui_types.h" +#import "ios/chrome/browser/ui/actions/tab_strip_actions.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { +CGFloat kStripHeight = 200.0; +} + +@interface StripContainerViewController ()<TabStripActions> + +// Whichever view controller is at the top of the screen. This view controller +// controls the status bar. +@property(nonatomic, weak) UIViewController* topmostViewController; + +@property(nonatomic, strong) Constraints* contentConstraintsWithStrip; +@property(nonatomic, strong) Constraints* contentConstraintsWithoutStrip; +@property(nonatomic, strong) Constraints* stripConstraints; + +// Cache for forwarding methods to child view controllers. +@property(nonatomic, assign) SEL actionToForward; +@property(nonatomic, weak) UIResponder* forwardingTarget; + +@property(nonatomic, strong) NSLayoutConstraint* stripHeightConstraint; + +// Contained view controller utility methods. +- (void)removeChildViewController:(UIViewController*)viewController; + +// Called after a new content view controller is set, but before +// |-didMoveToParentViewController:| is called on that view controller. +- (void)didAddContentViewController; + +// Called after a new strip view controller is set, but before +// |-didMoveToParentViewController:| is called on that view controller. +- (void)didAddStripViewController; + +// Methods to populate the constraint properties. +- (void)updateContentConstraintsWithStrip; +- (void)updateContentConstraintsWithoutStrip; +- (void)updateStripConstraints; + +@end + +@implementation StripContainerViewController + +@synthesize contentViewController = _contentViewController; +@synthesize stripViewController = _stripViewController; +@synthesize topmostViewController = _topmostViewController; +@synthesize contentConstraintsWithStrip = _contentConstraintsWithStrip; +@synthesize contentConstraintsWithoutStrip = _contentConstraintsWithoutStrip; +@synthesize stripConstraints = _stripConstraints; +@synthesize actionToForward = _actionToForward; +@synthesize forwardingTarget = _forwardingTarget; +@synthesize stripHeightConstraint = _stripHeightConstraint; + +#pragma mark - Public properties + +- (void)setContentViewController:(UIViewController*)contentViewController { + if (self.contentViewController == contentViewController) + return; + + // Remove the current content view controller, if any. + [NSLayoutConstraint + deactivateConstraints:self.contentConstraintsWithoutStrip]; + [NSLayoutConstraint deactivateConstraints:self.contentConstraintsWithStrip]; + [self removeChildViewController:self.contentViewController]; + + // Add the new content view controller. + [self addChildViewController:contentViewController]; + contentViewController.view.translatesAutoresizingMaskIntoConstraints = NO; + [self.view addSubview:contentViewController.view]; + _contentViewController = contentViewController; + [self didAddContentViewController]; + [self.view setNeedsUpdateConstraints]; + [self.contentViewController didMoveToParentViewController:self]; +} + +- (void)setStripViewController:(UIViewController*)stripViewController { + if (self.stripViewController == stripViewController) + return; + + // Remove the current strip view controller, if any. + [NSLayoutConstraint deactivateConstraints:self.stripConstraints]; + [NSLayoutConstraint deactivateConstraints:self.contentConstraintsWithStrip]; + [self removeChildViewController:self.stripViewController]; + + // Add the new strip view controller. + [self addChildViewController:stripViewController]; + stripViewController.view.translatesAutoresizingMaskIntoConstraints = NO; + [self.view addSubview:stripViewController.view]; + _stripViewController = stripViewController; + [self didAddStripViewController]; + [self.view setNeedsUpdateConstraints]; + [self.stripViewController didMoveToParentViewController:self]; +} + +#pragma mark - UIViewController + +- (void)updateViewConstraints { + if (self.stripViewController) { + [NSLayoutConstraint activateConstraints:self.stripConstraints]; + [NSLayoutConstraint activateConstraints:self.contentConstraintsWithStrip]; + } else { + [NSLayoutConstraint + activateConstraints:self.contentConstraintsWithoutStrip]; + } + [super updateViewConstraints]; +} + +- (UIViewController*)childViewControllerForStatusBarHidden { + return self.topmostViewController; +} + +- (UIViewController*)childViewControllerForStatusBarStyle { + return self.topmostViewController; +} + +#pragma mark - UIResponder + +// Before forwarding actions up the responder chain, give both contained +// view controllers a chance to handle them. +- (BOOL)canPerformAction:(SEL)action withSender:(id)sender { + self.actionToForward = nullptr; + self.forwardingTarget = nil; + for (UIResponder* responder in + @[ self.contentViewController, self.stripViewController ]) { + if ([responder canPerformAction:action withSender:sender]) { + self.actionToForward = action; + self.forwardingTarget = responder; + return YES; + } + } + return [super canPerformAction:action withSender:sender]; +} + +#pragma mark - NSObject method forwarding + +- (id)forwardingTargetForSelector:(SEL)aSelector { + if (aSelector == self.actionToForward) { + return self.forwardingTarget; + } + return nil; +} + +#pragma mark - TabStripActions + +// Action to toggle visibility of tab strip. +- (void)toggleTabStrip:(id)sender { + self.stripHeightConstraint.constant = + self.stripHeightConstraint.constant > 0 ? 0.0 : kStripHeight; +} + +#pragma mark - Private methods + +- (void)removeChildViewController:(UIViewController*)viewController { + if (viewController.parentViewController != self) + return; + [viewController willMoveToParentViewController:nil]; + [viewController.view removeFromSuperview]; + [viewController removeFromParentViewController]; +} + +- (void)didAddContentViewController { + if (self.stripViewController) { + [self updateContentConstraintsWithStrip]; + } else { + self.topmostViewController = self.contentViewController; + [self updateContentConstraintsWithoutStrip]; + } +} + +- (void)didAddStripViewController { + [self updateStripConstraints]; + // If there's already a content view controller, update the constraints for + // that, too. + if (self.contentViewController) { + [self updateContentConstraintsWithStrip]; + } + self.topmostViewController = self.stripViewController; +} + +- (void)updateContentConstraintsWithoutStrip { + UIView* contentView = self.contentViewController.view; + self.contentConstraintsWithoutStrip = @[ + [contentView.topAnchor constraintEqualToAnchor:self.view.topAnchor], + [contentView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor], + [contentView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor], + [contentView.trailingAnchor + constraintEqualToAnchor:self.view.trailingAnchor], + ]; +} + +- (void)updateContentConstraintsWithStrip { + UIView* contentView = self.contentViewController.view; + self.contentConstraintsWithStrip = @[ + [contentView.topAnchor + constraintEqualToAnchor:self.stripViewController.view.bottomAnchor], + [contentView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor], + [contentView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor], + [contentView.trailingAnchor + constraintEqualToAnchor:self.view.trailingAnchor], + ]; +} + +- (void)updateStripConstraints { + UIView* stripView = self.stripViewController.view; + self.stripHeightConstraint = + [stripView.heightAnchor constraintEqualToConstant:0.0]; + self.stripConstraints = @[ + [stripView.topAnchor constraintEqualToAnchor:self.view.topAnchor], + [stripView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor], + [stripView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor], + self.stripHeightConstraint, + ]; +} + +@end
diff --git a/ios/net/cookies/cookie_store_ios.h b/ios/net/cookies/cookie_store_ios.h index 6d37364..2c8218f1 100644 --- a/ios/net/cookies/cookie_store_ios.h +++ b/ios/net/cookies/cookie_store_ios.h
@@ -41,24 +41,16 @@ // The CookieStoreIOS is an implementation of CookieStore relying on // NSHTTPCookieStorage, ensuring that the cookies are consistent between the -// network stack and the UIWebViews. -// On iOS, the Chrome CookieMonster is not used in conjunction with UIWebView, -// because UIWebView expects the cookies to be in the shared -// NSHTTPCookieStorage. In particular, javascript may read and write cookies -// there. +// network stack and NSHTTPCookieStorage. // CookieStoreIOS is not thread safe. // -// At any given time, a CookieStoreIOS can either be synchronized with the -// system cookie store or not. If a CookieStoreIOS is not synchronized with the -// system store, changes are written back to the backing CookieStore. If a -// CookieStoreIOS is synchronized with the system store, changes are written -// directly to the system cookie store, then propagated to the backing store by -// OnSystemCookiesChanged, which is called by the system store once the change -// to the system store is written back. -// -// To unsynchronize, CookieStoreIOS copies the system cookie store into its -// backing CookieStore. To synchronize, CookieStoreIOS clears the system cookie -// store, copies its backing CookieStore into the system cookie store. +// CookieStoreIOS can be created synchronized with the system cookie store (via +// CreateCookieStore) or not (other constructors). If a CookieStoreIOS is not +// synchronized with the system store, changes are written back to the backing +// CookieStore. If a CookieStoreIOS is synchronized with the system store, +// changes are written directly to the system cookie store, then propagated to +// the backing store by OnSystemCookiesChanged, which is called by the system +// store once the change to the system store is written back. class CookieStoreIOS : public net::CookieStore, public CookieNotificationObserver { public:
diff --git a/ios/net/cookies/cookie_store_ios_unittest.mm b/ios/net/cookies/cookie_store_ios_unittest.mm index 378d50c..8830bb9f 100644 --- a/ios/net/cookies/cookie_store_ios_unittest.mm +++ b/ios/net/cookies/cookie_store_ios_unittest.mm
@@ -69,160 +69,6 @@ base::MessageLoop loop_; }; -// RoundTripTestCookieStore is un-synchronized and re-synchronized after all -// cookie operations. This means all system cookies are converted to Chrome -// cookies and converted back. -// The purpose of this class is to test that cookie conversions do not break the -// cookie store. -class RoundTripTestCookieStore : public net::CookieStore { - public: - RoundTripTestCookieStore() - : store_(new CookieStoreIOS(nullptr)), - dummy_store_(new CookieStoreIOS(nullptr)) { - store_->SetSynchronizedWithSystemStore(true); - } - - ~RoundTripTestCookieStore() override { - store_->SetSynchronizedWithSystemStore(false); - } - - // Inherited CookieStore methods. - void SetCookieWithOptionsAsync(const GURL& url, - const std::string& cookie_line, - const net::CookieOptions& options, - const SetCookiesCallback& callback) override { - RoundTrip(); - store_->SetCookieWithOptionsAsync(url, cookie_line, options, callback); - } - - void SetCookieWithDetailsAsync(const GURL& url, - const std::string& name, - const std::string& value, - const std::string& domain, - const std::string& path, - base::Time creation_time, - base::Time expiration_time, - base::Time last_access_time, - bool secure, - bool http_only, - CookieSameSite same_site, - bool enforce_strict_secure, - CookiePriority priority, - const SetCookiesCallback& callback) override { - RoundTrip(); - store_->SetCookieWithDetailsAsync( - url, name, value, domain, path, creation_time, expiration_time, - last_access_time, secure, http_only, same_site, enforce_strict_secure, - priority, callback); - } - - void GetCookiesWithOptionsAsync(const GURL& url, - const net::CookieOptions& options, - const GetCookiesCallback& callback) override { - RoundTrip(); - store_->GetCookiesWithOptionsAsync(url, options, callback); - } - - void GetCookieListWithOptionsAsync( - const GURL& url, - const net::CookieOptions& options, - const GetCookieListCallback& callback) override { - RoundTrip(); - store_->GetCookieListWithOptionsAsync(url, options, callback); - } - - void GetAllCookiesAsync(const GetCookieListCallback& callback) override { - RoundTrip(); - store_->GetAllCookiesAsync(callback); - } - - void DeleteCookieAsync(const GURL& url, - const std::string& cookie_name, - const base::Closure& callback) override { - RoundTrip(); - store_->DeleteCookieAsync(url, cookie_name, callback); - } - - void DeleteCanonicalCookieAsync( - const CanonicalCookie& cookie, - const DeleteCallback& callback) override { - RoundTrip(); - store_->DeleteCanonicalCookieAsync(cookie, callback); - } - - void DeleteAllCreatedBetweenAsync(const base::Time& delete_begin, - const base::Time& delete_end, - const DeleteCallback& callback) override { - RoundTrip(); - store_->DeleteAllCreatedBetweenAsync(delete_begin, delete_end, callback); - } - - void DeleteAllCreatedBetweenWithPredicateAsync( - const base::Time& delete_begin, - const base::Time& delete_end, - const CookiePredicate& predicate, - const DeleteCallback& callback) override { - RoundTrip(); - store_->DeleteAllCreatedBetweenWithPredicateAsync(delete_begin, delete_end, - predicate, callback); - } - - void DeleteSessionCookiesAsync(const DeleteCallback& callback) override { - RoundTrip(); - store_->DeleteSessionCookiesAsync(callback); - } - - void FlushStore(const base::Closure& callback) override { - RoundTrip(); - store_->FlushStore(callback); - } - - std::unique_ptr<CookieStore::CookieChangedSubscription> AddCallbackForCookie( - const GURL& url, - const std::string& name, - const CookieChangedCallback& callback) override { - return std::unique_ptr<CookieStore::CookieChangedSubscription>(); - } - - bool IsEphemeral() override { - return store_->IsEphemeral(); - } - - private: - void RoundTrip() { - store_->SetSynchronizedWithSystemStore(false); - dummy_store_->SetSynchronizedWithSystemStore(true); - // Check that the system store is empty, because it is synchronized with - // |dummy_store_| which is empty. - NSHTTPCookieStorage* store = [NSHTTPCookieStorage sharedHTTPCookieStorage]; - EXPECT_EQ(0u, [[store cookies] count]); - dummy_store_->SetSynchronizedWithSystemStore(false); - store_->SetSynchronizedWithSystemStore(true); - } - - std::unique_ptr<CookieStoreIOS> store_; - // |dummy_store_| is not directly used, but is needed to make |store_| - // inactive. - std::unique_ptr<CookieStoreIOS> dummy_store_; -}; - -struct RoundTripTestCookieStoreTraits { - static std::unique_ptr<net::CookieStore> Create() { - ClearCookies(); - return base::MakeUnique<RoundTripTestCookieStore>(); - } - - static const bool is_cookie_monster = false; - static const bool supports_http_only = false; - static const bool supports_non_dotted_domains = false; - static const bool preserves_trailing_dots = false; - static const bool filters_schemes = false; - static const bool has_path_prefix_bug = true; - static const int creation_time_granularity_in_ms = 1000; - static const int enforces_prefixes = true; - static const bool enforce_strict_secure = false; -}; - } // namespace net namespace net { @@ -235,10 +81,6 @@ CookieStoreTest, InactiveCookieStoreIOSTestTraits); -INSTANTIATE_TYPED_TEST_CASE_P(RoundTripTestCookieStore, - CookieStoreTest, - RoundTripTestCookieStoreTraits); - } // namespace net namespace { @@ -583,81 +425,6 @@ store_->SetSynchronizedWithSystemStore(false); } -// Tests that Synchronization can be "aborted" (i.e. the cookie store is -// unsynchronized while synchronization is in progress). -TEST_F(CookieStoreIOSWithBackend, SyncThenUnsync) { - ClearCookies(); - std::unique_ptr<CookieStoreIOS> dummy_store(new CookieStoreIOS(nullptr)); - // Switch back and forth before synchronization can complete. - store_->SetSynchronizedWithSystemStore(true); - store_->SetSynchronizedWithSystemStore(false); - dummy_store->SetSynchronizedWithSystemStore(true); - backend_->RunLoadedCallback(); - // No cookie leak in the system store. - NSHTTPCookieStorage* store = [NSHTTPCookieStorage sharedHTTPCookieStorage]; - EXPECT_EQ(0u, [[store cookies] count]); - // No cookie lost. - GetCookieCallback callback; - GetCookies(base::Bind(&GetCookieCallback::Run, base::Unretained(&callback))); - EXPECT_TRUE(callback.did_run()); - EXPECT_EQ("a=b", callback.cookie_line()); - dummy_store->SetSynchronizedWithSystemStore(false); -} - -// Tests that Synchronization can be "aborted" while there are pending tasks -// (i.e. the cookie store is unsynchronized while synchronization is in progress -// and there are pending tasks). -TEST_F(CookieStoreIOSWithBackend, SyncThenUnsyncWithPendingTasks) { - ClearCookies(); - std::unique_ptr<CookieStoreIOS> dummy_store(new CookieStoreIOS(nullptr)); - // Start synchornization. - store_->SetSynchronizedWithSystemStore(true); - // Create a pending task while synchronization is in progress. - GetCookieCallback callback; - GetCookies(base::Bind(&GetCookieCallback::Run, base::Unretained(&callback))); - // Cancel the synchronization. - store_->SetSynchronizedWithSystemStore(false); - dummy_store->SetSynchronizedWithSystemStore(true); - // Synchronization completes after being cancelled. - backend_->RunLoadedCallback(); - // The task is not lost. - EXPECT_TRUE(callback.did_run()); - EXPECT_EQ("a=b", callback.cookie_line()); - dummy_store->SetSynchronizedWithSystemStore(false); -} - -TEST_F(CookieStoreIOSWithBackend, UnSynchronizeBeforeLoadComplete) { - ClearCookies(); - // Switch back and forth before synchronization can complete. - store_->SetSynchronizedWithSystemStore(true); - store_->SetSynchronizedWithSystemStore(false); - backend_->RunLoadedCallback(); - // No cookie lost. - GetCookieCallback callback; - GetCookies(base::Bind(&GetCookieCallback::Run, base::Unretained(&callback))); - EXPECT_TRUE(callback.did_run()); - EXPECT_EQ("a=b", callback.cookie_line()); -} - -TEST_F(CookieStoreIOSWithBackend, UnSynchronize) { - ClearCookies(); - store_->SetSynchronizedWithSystemStore(true); - backend_->RunLoadedCallback(); - store_->SetSynchronizedWithSystemStore(false); - // No cookie lost. - GetCookieCallback callback; - GetCookies(base::Bind(&GetCookieCallback::Run, base::Unretained(&callback))); - EXPECT_TRUE(callback.did_run()); - EXPECT_EQ("a=b", callback.cookie_line()); -} - -TEST_F(CookieStoreIOSWithBackend, FlushOnUnSynchronize) { - store_->SetSynchronizedWithSystemStore(true); - EXPECT_FALSE(backend_->flushed()); - store_->SetSynchronizedWithSystemStore(false); - EXPECT_TRUE(backend_->flushed()); -} - TEST_F(CookieStoreIOSWithBackend, FlushOnCookieChanged) { store_->SetSynchronizedWithSystemStore(true); store_->set_flush_delay_for_testing(base::TimeDelta());
diff --git a/ios/showcase/BUILD.gn b/ios/showcase/BUILD.gn index 019fad1..ff70d5fd 100644 --- a/ios/showcase/BUILD.gn +++ b/ios/showcase/BUILD.gn
@@ -27,6 +27,7 @@ deps = [ "//ios/chrome/browser/ui/tools:tools_ui", "//ios/showcase/settings", + "//ios/showcase/strip", "//ios/showcase/tab_grid", "//ios/showcase/uikit_table_view_cell", ]
diff --git a/ios/showcase/core/showcase_model.mm b/ios/showcase/core/showcase_model.mm index 158a897..6185b51 100644 --- a/ios/showcase/core/showcase_model.mm +++ b/ios/showcase/core/showcase_model.mm
@@ -36,6 +36,11 @@ showcase::kClassForInstantiationKey : @"SCTabGridCoordinator", showcase::kUseCaseKey : @"Tab grid", }, + @{ + showcase::kClassForDisplayKey : @"StripContainerViewController", + showcase::kClassForInstantiationKey : @"SCStripCoordinator", + showcase::kUseCaseKey : @"Tab strip container", + }, ]; }
diff --git a/ios/showcase/strip/BUILD.gn b/ios/showcase/strip/BUILD.gn new file mode 100644 index 0000000..1f6d40e --- /dev/null +++ b/ios/showcase/strip/BUILD.gn
@@ -0,0 +1,17 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("strip") { + sources = [ + "sc_strip_coordinator.h", + "sc_strip_coordinator.mm", + ] + deps = [ + "//ios/chrome/browser/ui/actions", + "//ios/chrome/browser/ui/strip:strip_ui", + "//ios/showcase/common", + ] + libs = [ "UIKit.framework" ] + configs += [ "//build/config/compiler:enable_arc" ] +}
diff --git a/ios/showcase/strip/sc_strip_coordinator.h b/ios/showcase/strip/sc_strip_coordinator.h new file mode 100644 index 0000000..9f171c2 --- /dev/null +++ b/ios/showcase/strip/sc_strip_coordinator.h
@@ -0,0 +1,17 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_SHOWCASE_STRIP_SC_STRIP_COORDINATOR_H_ +#define IOS_SHOWCASE_STRIP_SC_STRIP_COORDINATOR_H_ + +#import <UIKit/UIKit.h> + +#import "ios/showcase/common/coordinator.h" + +@interface SCStripCoordinator : NSObject<Coordinator> +// Redefined to be a UINavigationController. +@property(nonatomic, weak) UINavigationController* baseViewController; +@end + +#endif // IOS_SHOWCASE_STRIP_SC_STRIP_COORDINATOR_H_
diff --git a/ios/showcase/strip/sc_strip_coordinator.mm b/ios/showcase/strip/sc_strip_coordinator.mm new file mode 100644 index 0000000..c0657d4 --- /dev/null +++ b/ios/showcase/strip/sc_strip_coordinator.mm
@@ -0,0 +1,52 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/showcase/strip/sc_strip_coordinator.h" + +#import "ios/chrome/browser/ui/actions/tab_strip_actions.h" +#import "ios/chrome/browser/ui/strip/strip_container_view_controller.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@interface SCStripCoordinator () +@property(nonatomic, strong) StripContainerViewController* viewController; +@end + +@implementation SCStripCoordinator +@synthesize baseViewController = _baseViewController; +@synthesize viewController = _viewController; + +- (void)start { + UIViewController* blackViewController = [[UIViewController alloc] init]; + blackViewController.view.backgroundColor = [UIColor blackColor]; + + UIViewController* greenViewController = + [self viewControllerWithButtonTitle:@"toggleStrip" + action:@selector(toggleTabStrip:)]; + greenViewController.view.backgroundColor = [UIColor greenColor]; + + self.viewController = [[StripContainerViewController alloc] init]; + self.viewController.title = @"Tab strip container"; + self.viewController.stripViewController = blackViewController; + self.viewController.contentViewController = greenViewController; + self.baseViewController.navigationBar.translucent = NO; + [self.baseViewController pushViewController:self.viewController animated:YES]; +} + +- (UIViewController*)viewControllerWithButtonTitle:(NSString*)title + action:(SEL)action { + UIViewController* viewController = [[UIViewController alloc] init]; + UIButton* button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; + [button setFrame:CGRectMake(10, 10, 80, 50)]; + [button setTitle:title forState:UIControlStateNormal]; + [viewController.view addSubview:button]; + [button addTarget:nil + action:action + forControlEvents:UIControlEventTouchUpInside]; + return viewController; +} + +@end
diff --git a/ios/web/app/web_main_loop.mm b/ios/web/app/web_main_loop.mm index 806e8ad..d155fbcc 100644 --- a/ios/web/app/web_main_loop.mm +++ b/ios/web/app/web_main_loop.mm
@@ -23,9 +23,9 @@ #include "base/task_scheduler/task_scheduler.h" #include "base/task_scheduler/task_traits.h" #include "base/threading/thread_restrictions.h" -#include "ios/web/net/cookie_notification_bridge.h" +#import "ios/web/net/cookie_notification_bridge.h" #include "ios/web/public/app/web_main_parts.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "ios/web/web_thread_impl.h" #include "ios/web/webui/url_data_manager_ios.h" #include "net/base/network_change_notifier.h"
diff --git a/ios/web/app/web_main_runner.mm b/ios/web/app/web_main_runner.mm index 03040fe..9217f78 100644 --- a/ios/web/app/web_main_runner.mm +++ b/ios/web/app/web_main_runner.mm
@@ -12,7 +12,7 @@ #include "base/metrics/statistics_recorder.h" #include "ios/web/app/web_main_loop.h" #include "ios/web/public/url_schemes.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "ui/base/ui_base_paths.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/browser_state_web_view_partition_inttest.mm b/ios/web/browser_state_web_view_partition_inttest.mm index f8fb5e9..8ce0297 100644 --- a/ios/web/browser_state_web_view_partition_inttest.mm +++ b/ios/web/browser_state_web_view_partition_inttest.mm
@@ -10,16 +10,16 @@ #include "base/mac/foundation_util.h" #import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" -#include "base/test/ios/wait_util.h" +#import "base/test/ios/wait_util.h" #include "ios/web/public/browser_state.h" #import "ios/web/public/test/http_server.h" #import "ios/web/public/test/js_test_util.h" -#include "ios/web/public/test/response_providers/string_response_provider.h" +#import "ios/web/public/test/response_providers/string_response_provider.h" #import "ios/web/public/web_view_creation_util.h" #import "ios/web/test/web_int_test.h" #import "net/base/mac/url_conversions.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" // A WKNavigationDelegate that is used to check if a WKWebView has finished // a navigation. Used for testing purposes.
diff --git a/ios/web/browser_url_rewriter_impl.mm b/ios/web/browser_url_rewriter_impl.mm index 0adc2bf..37f65c6 100644 --- a/ios/web/browser_url_rewriter_impl.mm +++ b/ios/web/browser_url_rewriter_impl.mm
@@ -7,7 +7,7 @@ #include "base/logging.h" #include "base/strings/string_util.h" #include "ios/web/public/browser_state.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "url/gurl.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/history_state_util.cc b/ios/web/history_state_util.cc index 1b10554..b04286dd 100644 --- a/ios/web/history_state_util.cc +++ b/ios/web/history_state_util.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "ios/web/history_state_util.h" +#include "ios/web/history_state_util.h" #include "base/logging.h" #include "url/gurl.h"
diff --git a/ios/web/history_state_util_unittest.mm b/ios/web/history_state_util_unittest.mm index 5efbfd3..a859b59b 100644 --- a/ios/web/history_state_util_unittest.mm +++ b/ios/web/history_state_util_unittest.mm
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "ios/web/history_state_util.h" +#include "ios/web/history_state_util.h" #include <stddef.h> #include "base/macros.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "url/gurl.h" namespace web {
diff --git a/ios/web/interstitials/html_web_interstitial_impl.h b/ios/web/interstitials/html_web_interstitial_impl.h index 2c1ff77..9dccfd4 100644 --- a/ios/web/interstitials/html_web_interstitial_impl.h +++ b/ios/web/interstitials/html_web_interstitial_impl.h
@@ -9,8 +9,8 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" -#include "ios/web/interstitials/web_interstitial_impl.h" +#import "base/mac/scoped_nsobject.h" +#import "ios/web/interstitials/web_interstitial_impl.h" namespace web {
diff --git a/ios/web/interstitials/html_web_interstitial_impl.mm b/ios/web/interstitials/html_web_interstitial_impl.mm index 59da38ab..950dd59 100644 --- a/ios/web/interstitials/html_web_interstitial_impl.mm +++ b/ios/web/interstitials/html_web_interstitial_impl.mm
@@ -9,11 +9,11 @@ #include "base/logging.h" #include "base/strings/sys_string_conversions.h" #include "ios/web/interstitials/web_interstitial_facade_delegate.h" -#include "ios/web/public/interstitials/web_interstitial_delegate.h" -#include "ios/web/public/web_state/ui/crw_web_view_content_view.h" +#import "ios/web/public/interstitials/web_interstitial_delegate.h" +#import "ios/web/public/web_state/ui/crw_web_view_content_view.h" #import "ios/web/public/web_view_creation_util.h" #import "ios/web/web_state/ui/web_view_js_utils.h" -#include "ios/web/web_state/web_state_impl.h" +#import "ios/web/web_state/web_state_impl.h" #import "net/base/mac/url_conversions.h" #include "ui/gfx/geometry/size.h"
diff --git a/ios/web/interstitials/native_web_interstitial_impl.h b/ios/web/interstitials/native_web_interstitial_impl.h index bd680e62..f24c731 100644 --- a/ios/web/interstitials/native_web_interstitial_impl.h +++ b/ios/web/interstitials/native_web_interstitial_impl.h
@@ -5,12 +5,12 @@ #ifndef IOS_WEB_INTERSTITIALS_NATIVE_WEB_INTERSTITIAL_IMPL_H_ #define IOS_WEB_INTERSTITIALS_NATIVE_WEB_INTERSTITIAL_IMPL_H_ -#include "ios/web/interstitials/web_interstitial_impl.h" +#import "ios/web/interstitials/web_interstitial_impl.h" #include <memory> -#include "base/ios/weak_nsobject.h" -#include "base/mac/scoped_nsobject.h" +#import "base/ios/weak_nsobject.h" +#import "base/mac/scoped_nsobject.h" namespace web {
diff --git a/ios/web/interstitials/native_web_interstitial_impl.mm b/ios/web/interstitials/native_web_interstitial_impl.mm index 822a9b8..fbceff67 100644 --- a/ios/web/interstitials/native_web_interstitial_impl.mm +++ b/ios/web/interstitials/native_web_interstitial_impl.mm
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/interstitials/native_web_interstitial_impl.h" +#import "ios/web/interstitials/native_web_interstitial_impl.h" #include <utility> #include "base/logging.h" -#include "ios/web/public/interstitials/web_interstitial_delegate.h" +#import "ios/web/public/interstitials/web_interstitial_delegate.h" #import "ios/web/public/web_state/ui/crw_generic_content_view.h" -#include "ios/web/web_state/web_state_impl.h" +#import "ios/web/web_state/web_state_impl.h" #include "ui/gfx/geometry/size.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/interstitials/web_interstitial_impl.h b/ios/web/interstitials/web_interstitial_impl.h index cc76075..525aa27 100644 --- a/ios/web/interstitials/web_interstitial_impl.h +++ b/ios/web/interstitials/web_interstitial_impl.h
@@ -7,8 +7,8 @@ #import <UIKit/UIKit.h> -#import "ios/web/public/interstitials/web_interstitial.h" -#include "ios/web/public/web_state/ui/crw_content_view.h" +#include "ios/web/public/interstitials/web_interstitial.h" +#import "ios/web/public/web_state/ui/crw_content_view.h" #include "ios/web/public/web_state/web_state_observer.h" #import "ios/web/web_state/ui/web_view_js_utils.h" #include "url/gurl.h"
diff --git a/ios/web/interstitials/web_interstitial_impl.mm b/ios/web/interstitials/web_interstitial_impl.mm index fb5ef39d..fc1bd1d 100644 --- a/ios/web/interstitials/web_interstitial_impl.mm +++ b/ios/web/interstitials/web_interstitial_impl.mm
@@ -6,11 +6,11 @@ #include "base/logging.h" #include "ios/web/interstitials/web_interstitial_facade_delegate.h" -#include "ios/web/navigation/crw_session_controller.h" -#include "ios/web/navigation/navigation_manager_impl.h" -#include "ios/web/public/interstitials/web_interstitial_delegate.h" +#import "ios/web/navigation/crw_session_controller.h" +#import "ios/web/navigation/navigation_manager_impl.h" +#import "ios/web/public/interstitials/web_interstitial_delegate.h" #import "ios/web/public/navigation_manager.h" -#include "ios/web/web_state/web_state_impl.h" +#import "ios/web/web_state/web_state_impl.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm index c4c0785..ca01cfc 100644 --- a/ios/web/navigation/crw_session_controller.mm +++ b/ios/web/navigation/crw_session_controller.mm
@@ -15,12 +15,12 @@ #import "base/mac/foundation_util.h" #import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" -#import "ios/web/history_state_util.h" +#include "ios/web/history_state_util.h" #import "ios/web/navigation/crw_session_certificate_policy_manager.h" #import "ios/web/navigation/crw_session_controller+private_constructors.h" #import "ios/web/navigation/crw_session_entry.h" -#include "ios/web/navigation/navigation_item_impl.h" -#import "ios/web/navigation/navigation_manager_facade_delegate.h" +#import "ios/web/navigation/navigation_item_impl.h" +#include "ios/web/navigation/navigation_manager_facade_delegate.h" #import "ios/web/navigation/navigation_manager_impl.h" #include "ios/web/navigation/time_smoother.h" #include "ios/web/public/browser_state.h"
diff --git a/ios/web/navigation/crw_session_controller_unittest.mm b/ios/web/navigation/crw_session_controller_unittest.mm index 48f5601..bb01eed 100644 --- a/ios/web/navigation/crw_session_controller_unittest.mm +++ b/ios/web/navigation/crw_session_controller_unittest.mm
@@ -12,14 +12,14 @@ #import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "ios/web/navigation/crw_session_controller+private_constructors.h" -#include "ios/web/navigation/crw_session_entry.h" -#include "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/navigation/crw_session_entry.h" +#import "ios/web/navigation/navigation_item_impl.h" #include "ios/web/public/referrer.h" #include "ios/web/public/test/test_browser_state.h" #include "ios/web/public/test/test_web_thread_bundle.h" #import "net/base/mac/url_conversions.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" @interface CRWSessionController (Testing)
diff --git a/ios/web/navigation/crw_session_entry.mm b/ios/web/navigation/crw_session_entry.mm index ed27327f..13a83e5 100644 --- a/ios/web/navigation/crw_session_entry.mm +++ b/ios/web/navigation/crw_session_entry.mm
@@ -8,11 +8,11 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" -#include "ios/web/navigation/navigation_item_impl.h" -#include "ios/web/navigation/nscoder_util.h" -#include "ios/web/public/navigation_item.h" +#import "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/navigation/nscoder_util.h" +#import "ios/web/public/navigation_item.h" #include "ios/web/public/web_state/page_display_state.h" #import "net/base/mac/url_conversions.h"
diff --git a/ios/web/navigation/crw_session_entry_unittest.mm b/ios/web/navigation/crw_session_entry_unittest.mm index ec1a8bb..e0b439cc 100644 --- a/ios/web/navigation/crw_session_entry_unittest.mm +++ b/ios/web/navigation/crw_session_entry_unittest.mm
@@ -9,14 +9,14 @@ #include <utility> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "ios/testing/ocmock_complex_type_helper.h" -#include "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/navigation/navigation_item_impl.h" #include "ios/web/public/referrer.h" #import "net/base/mac/url_conversions.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" #include "third_party/ocmock/gtest_support.h"
diff --git a/ios/web/navigation/navigation_item_impl.h b/ios/web/navigation/navigation_item_impl.h index 2d58a96..2dde8e6 100644 --- a/ios/web/navigation/navigation_item_impl.h +++ b/ios/web/navigation/navigation_item_impl.h
@@ -9,11 +9,11 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "ios/web/navigation/navigation_item_facade_delegate.h" #include "ios/web/public/favicon_status.h" -#include "ios/web/public/navigation_item.h" +#import "ios/web/public/navigation_item.h" #include "ios/web/public/referrer.h" #include "ios/web/public/ssl_status.h" #include "url/gurl.h"
diff --git a/ios/web/navigation/navigation_item_impl.mm b/ios/web/navigation/navigation_item_impl.mm index 5fccafb5..3d8bc3a3 100644 --- a/ios/web/navigation/navigation_item_impl.mm +++ b/ios/web/navigation/navigation_item_impl.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/navigation/navigation_item_impl.h" #include <stddef.h>
diff --git a/ios/web/navigation/navigation_item_impl_unittest.mm b/ios/web/navigation/navigation_item_impl_unittest.mm index e978e2f..642ff00 100644 --- a/ios/web/navigation/navigation_item_impl_unittest.mm +++ b/ios/web/navigation/navigation_item_impl_unittest.mm
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/navigation/navigation_item_impl.h" #include <memory> #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" namespace web {
diff --git a/ios/web/navigation/navigation_manager_impl.h b/ios/web/navigation/navigation_manager_impl.h index 7ee74d1..9a15905a 100644 --- a/ios/web/navigation/navigation_manager_impl.h +++ b/ios/web/navigation/navigation_manager_impl.h
@@ -10,7 +10,7 @@ #include <memory> #include <vector> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/memory/scoped_vector.h" #import "ios/web/public/navigation_manager.h"
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm index 76c725a..f13d0959 100644 --- a/ios/web/navigation/navigation_manager_impl.mm +++ b/ios/web/navigation/navigation_manager_impl.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/navigation/navigation_manager_impl.h" +#import "ios/web/navigation/navigation_manager_impl.h" #include <stddef.h> @@ -12,12 +12,12 @@ #import "ios/web/navigation/crw_session_controller+private_constructors.h" #import "ios/web/navigation/crw_session_controller.h" #import "ios/web/navigation/crw_session_entry.h" -#include "ios/web/navigation/navigation_item_impl.h" -#include "ios/web/navigation/navigation_manager_delegate.h" -#import "ios/web/navigation/navigation_manager_facade_delegate.h" +#import "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/navigation/navigation_manager_delegate.h" +#include "ios/web/navigation/navigation_manager_facade_delegate.h" #include "ios/web/public/load_committed_details.h" -#include "ios/web/public/navigation_item.h" -#include "ios/web/public/web_state/web_state.h" +#import "ios/web/public/navigation_item.h" +#import "ios/web/public/web_state/web_state.h" #include "ui/base/page_transition_types.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/navigation/nscoder_util.mm b/ios/web/navigation/nscoder_util.mm index 0ded3bc..930baa5 100644 --- a/ios/web/navigation/nscoder_util.mm +++ b/ios/web/navigation/nscoder_util.mm
@@ -6,7 +6,7 @@ #include <string> -#include "ios/web/navigation/nscoder_util.h" +#import "ios/web/navigation/nscoder_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/web/navigation/nscoder_util_unittest.mm b/ios/web/navigation/nscoder_util_unittest.mm index 25b84e5..2d63b34 100644 --- a/ios/web/navigation/nscoder_util_unittest.mm +++ b/ios/web/navigation/nscoder_util_unittest.mm
@@ -5,9 +5,9 @@ #import <Foundation/Foundation.h> #include <stddef.h> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/macros.h" -#include "ios/web/navigation/nscoder_util.h" +#import "ios/web/navigation/nscoder_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h"
diff --git a/ios/web/net/clients/crw_js_injection_network_client.h b/ios/web/net/clients/crw_js_injection_network_client.h index b22e6b88..f241cafc 100644 --- a/ios/web/net/clients/crw_js_injection_network_client.h +++ b/ios/web/net/clients/crw_js_injection_network_client.h
@@ -5,7 +5,7 @@ #ifndef IOS_WEB_NET_CLIENTS_CRW_JS_INJECTION_NETWORK_CLIENT_H_ #define IOS_WEB_NET_CLIENTS_CRW_JS_INJECTION_NETWORK_CLIENT_H_ -#include "ios/net/clients/crn_forwarding_network_client.h" +#import "ios/net/clients/crn_forwarding_network_client.h" namespace web { // Used for UMA histogram and must be kept in sync with the histograms.xml file.
diff --git a/ios/web/net/clients/crw_js_injection_network_client.mm b/ios/web/net/clients/crw_js_injection_network_client.mm index 2ce43e64..ebb635d 100644 --- a/ios/web/net/clients/crw_js_injection_network_client.mm +++ b/ios/web/net/clients/crw_js_injection_network_client.mm
@@ -8,7 +8,7 @@ #include <stdint.h> #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/metrics/histogram.h" #import "ios/net/crn_http_url_response.h" #import "ios/third_party/blink/src/html_tokenizer.h"
diff --git a/ios/web/net/clients/crw_js_injection_network_client_factory.mm b/ios/web/net/clients/crw_js_injection_network_client_factory.mm index f10114fa..afb89ef2 100644 --- a/ios/web/net/clients/crw_js_injection_network_client_factory.mm +++ b/ios/web/net/clients/crw_js_injection_network_client_factory.mm
@@ -5,7 +5,7 @@ #import "ios/web/net/clients/crw_js_injection_network_client_factory.h" #include "base/metrics/histogram.h" -#include "ios/web/net/clients/crw_js_injection_network_client.h" +#import "ios/web/net/clients/crw_js_injection_network_client.h" #include "net/url_request/url_request.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/net/clients/crw_js_injection_network_client_unittest.mm b/ios/web/net/clients/crw_js_injection_network_client_unittest.mm index b5353d5..8fe2424 100644 --- a/ios/web/net/clients/crw_js_injection_network_client_unittest.mm +++ b/ios/web/net/clients/crw_js_injection_network_client_unittest.mm
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/clients/crw_js_injection_network_client.h" +#import "ios/web/net/clients/crw_js_injection_network_client.h" #import <Foundation/Foundation.h> #include "base/files/file_path.h" #include "base/files/file_util.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/path_service.h" #include "base/strings/sys_string_conversions.h" #import "ios/net/clients/crn_network_client_protocol.h"
diff --git a/ios/web/net/clients/crw_redirect_network_client.mm b/ios/web/net/clients/crw_redirect_network_client.mm index 384b556..ab4194b 100644 --- a/ios/web/net/clients/crw_redirect_network_client.mm +++ b/ios/web/net/clients/crw_redirect_network_client.mm
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/clients/crw_redirect_network_client.h" +#import "ios/web/net/clients/crw_redirect_network_client.h" #include "base/location.h" -#include "base/mac/bind_objc_block.h" +#import "base/mac/bind_objc_block.h" #include "ios/web/public/web_thread.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/net/clients/crw_redirect_network_client_factory.mm b/ios/web/net/clients/crw_redirect_network_client_factory.mm index 933f78e..34a5ce07 100644 --- a/ios/web/net/clients/crw_redirect_network_client_factory.mm +++ b/ios/web/net/clients/crw_redirect_network_client_factory.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/clients/crw_redirect_network_client_factory.h" +#import "ios/web/net/clients/crw_redirect_network_client_factory.h" #include "base/location.h" #include "ios/web/public/web_thread.h"
diff --git a/ios/web/net/cookie_notification_bridge.h b/ios/web/net/cookie_notification_bridge.h index 66fbef8..0e4c1304 100644 --- a/ios/web/net/cookie_notification_bridge.h +++ b/ios/web/net/cookie_notification_bridge.h
@@ -5,7 +5,7 @@ #ifndef IOS_WEB_NET_COOKIE_NOTIFICATION_BRIDGE_H_ #define IOS_WEB_NET_COOKIE_NOTIFICATION_BRIDGE_H_ -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/threading/thread_checker.h"
diff --git a/ios/web/net/cookie_notification_bridge.mm b/ios/web/net/cookie_notification_bridge.mm index 3088ab4..3c2d538 100644 --- a/ios/web/net/cookie_notification_bridge.mm +++ b/ios/web/net/cookie_notification_bridge.mm
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/cookie_notification_bridge.h" +#import "ios/web/net/cookie_notification_bridge.h" #import <Foundation/Foundation.h> #include "base/bind.h" #include "base/location.h" -#include "ios/net/cookies/cookie_store_ios.h" +#import "ios/net/cookies/cookie_store_ios.h" #include "ios/web/public/web_thread.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/net/crw_cert_verification_controller.h b/ios/web/net/crw_cert_verification_controller.h index 7855b4d..69daf9d 100644 --- a/ios/web/net/crw_cert_verification_controller.h +++ b/ios/web/net/crw_cert_verification_controller.h
@@ -8,7 +8,7 @@ #import <Foundation/Foundation.h> #include "base/mac/scoped_cftyperef.h" -#import "base/memory/ref_counted.h" +#include "base/memory/ref_counted.h" #include "ios/web/public/security_style.h" #include "net/cert/cert_status_flags.h"
diff --git a/ios/web/net/crw_cert_verification_controller.mm b/ios/web/net/crw_cert_verification_controller.mm index 4fe42a1..b67742c 100644 --- a/ios/web/net/crw_cert_verification_controller.mm +++ b/ios/web/net/crw_cert_verification_controller.mm
@@ -6,10 +6,10 @@ #include <memory> -#include "base/ios/block_types.h" +#import "base/ios/block_types.h" #include "base/logging.h" -#include "base/mac/bind_objc_block.h" -#import "base/memory/ref_counted.h" +#import "base/mac/bind_objc_block.h" +#include "base/memory/ref_counted.h" #include "base/strings/sys_string_conversions.h" #include "base/threading/worker_pool.h" #include "ios/web/public/browser_state.h"
diff --git a/ios/web/net/crw_cert_verification_controller_unittest.mm b/ios/web/net/crw_cert_verification_controller_unittest.mm index 2bb2bd5..edc0d68 100644 --- a/ios/web/net/crw_cert_verification_controller_unittest.mm +++ b/ios/web/net/crw_cert_verification_controller_unittest.mm
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/crw_cert_verification_controller.h" +#import "ios/web/net/crw_cert_verification_controller.h" -#include "base/mac/bind_objc_block.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/bind_objc_block.h" +#import "base/mac/scoped_nsobject.h" #include "base/message_loop/message_loop.h" -#include "base/test/ios/wait_util.h" +#import "base/test/ios/wait_util.h" #include "ios/web/public/test/web_test.h" #include "ios/web/public/web_thread.h" #import "ios/web/web_state/wk_web_view_security_util.h"
diff --git a/ios/web/net/crw_ssl_status_updater_unittest.mm b/ios/web/net/crw_ssl_status_updater_unittest.mm index 411c967e..81cf477b 100644 --- a/ios/web/net/crw_ssl_status_updater_unittest.mm +++ b/ios/web/net/crw_ssl_status_updater_unittest.mm
@@ -9,7 +9,7 @@ #import "ios/web/navigation/crw_session_controller+private_constructors.h" #import "ios/web/navigation/crw_session_controller.h" #import "ios/web/navigation/navigation_manager_impl.h" -#include "ios/web/public/navigation_item.h" +#import "ios/web/public/navigation_item.h" #include "ios/web/public/ssl_status.h" #include "ios/web/public/test/web_test.h" #import "ios/web/web_state/wk_web_view_security_util.h"
diff --git a/ios/web/net/request_group_util.mm b/ios/web/net/request_group_util.mm index 83b0e43e..51eeddb 100644 --- a/ios/web/net/request_group_util.mm +++ b/ios/web/net/request_group_util.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/request_group_util.h" +#import "ios/web/net/request_group_util.h" #import <Foundation/Foundation.h>
diff --git a/ios/web/net/request_group_util_unittest.mm b/ios/web/net/request_group_util_unittest.mm index 7f88a9c..9cf78091 100644 --- a/ios/web/net/request_group_util_unittest.mm +++ b/ios/web/net/request_group_util_unittest.mm
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/request_group_util.h" +#import "ios/web/net/request_group_util.h" #import <Foundation/Foundation.h> #include <stddef.h> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "testing/gtest/include/gtest/gtest.h" // Checks that all newly generated groupID are unique and that there are no
diff --git a/ios/web/net/request_tracker_factory_impl.h b/ios/web/net/request_tracker_factory_impl.h index 2d0bfc4..9cdb3e7 100644 --- a/ios/web/net/request_tracker_factory_impl.h +++ b/ios/web/net/request_tracker_factory_impl.h
@@ -7,8 +7,8 @@ #include <string> -#include "base/mac/scoped_nsobject.h" -#include "ios/net/request_tracker.h" +#import "base/mac/scoped_nsobject.h" +#import "ios/net/request_tracker.h" namespace web {
diff --git a/ios/web/net/request_tracker_factory_impl.mm b/ios/web/net/request_tracker_factory_impl.mm index afc6413a..a1ee474 100644 --- a/ios/web/net/request_tracker_factory_impl.mm +++ b/ios/web/net/request_tracker_factory_impl.mm
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/request_tracker_factory_impl.h" +#import "ios/web/net/request_tracker_factory_impl.h" #include "base/logging.h" #include "base/memory/weak_ptr.h" #include "base/strings/sys_string_conversions.h" -#include "ios/web/net/request_group_util.h" -#include "ios/web/net/request_tracker_impl.h" +#import "ios/web/net/request_group_util.h" +#import "ios/web/net/request_tracker_impl.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/web/net/request_tracker_impl.h b/ios/web/net/request_tracker_impl.h index 0376b3c..f9fbdba 100644 --- a/ios/web/net/request_tracker_impl.h +++ b/ios/web/net/request_tracker_impl.h
@@ -11,7 +11,7 @@ #include <set> #include "base/callback_forward.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h"
diff --git a/ios/web/net/request_tracker_impl.mm b/ios/web/net/request_tracker_impl.mm index 5595fc7..5a6014f 100644 --- a/ios/web/net/request_tracker_impl.mm +++ b/ios/web/net/request_tracker_impl.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/request_tracker_impl.h" +#import "ios/web/net/request_tracker_impl.h" #include <pthread.h> #include <stddef.h> @@ -12,15 +12,15 @@ #include "base/containers/hash_tables.h" #include "base/location.h" #include "base/logging.h" -#include "base/mac/bind_objc_block.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/bind_objc_block.h" +#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" #include "base/synchronization/lock.h" #import "ios/net/clients/crn_forwarding_network_client.h" #import "ios/net/clients/crn_forwarding_network_client_factory.h" -#import "ios/web/history_state_util.h" +#include "ios/web/history_state_util.h" #import "ios/web/net/crw_request_tracker_delegate.h" #include "ios/web/public/browser_state.h" #include "ios/web/public/certificate_policy_cache.h"
diff --git a/ios/web/net/request_tracker_impl_unittest.mm b/ios/web/net/request_tracker_impl_unittest.mm index f0f11f2..98499a29 100644 --- a/ios/web/net/request_tracker_impl_unittest.mm +++ b/ios/web/net/request_tracker_impl_unittest.mm
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/request_tracker_impl.h" +#import "ios/web/net/request_tracker_impl.h" #include <stddef.h> #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/memory/scoped_vector.h" @@ -30,7 +30,7 @@ #include "net/url_request/url_request_test_job.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" #include "third_party/ocmock/gtest_support.h"
diff --git a/ios/web/net/web_http_protocol_handler_delegate.mm b/ios/web/net/web_http_protocol_handler_delegate.mm index a1701a4..2296c08 100644 --- a/ios/web/net/web_http_protocol_handler_delegate.mm +++ b/ios/web/net/web_http_protocol_handler_delegate.mm
@@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/web_http_protocol_handler_delegate.h" +#import "ios/web/net/web_http_protocol_handler_delegate.h" #import <Foundation/Foundation.h> #import "ios/web/public/url_scheme_util.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "net/url_request/url_request_context_getter.h" #include "url/gurl.h"
diff --git a/ios/web/net/web_http_protocol_handler_delegate_unittest.mm b/ios/web/net/web_http_protocol_handler_delegate_unittest.mm index c51c79d..0bb44c6 100644 --- a/ios/web/net/web_http_protocol_handler_delegate_unittest.mm +++ b/ios/web/net/web_http_protocol_handler_delegate_unittest.mm
@@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/net/web_http_protocol_handler_delegate.h" +#import "ios/web/net/web_http_protocol_handler_delegate.h" #import <Foundation/Foundation.h> #include <memory> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/threading/thread_task_runner_handle.h" #include "ios/web/public/test/scoped_testing_web_client.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" #import "third_party/ocmock/OCMock/OCMock.h"
diff --git a/ios/web/public/image_fetcher/image_data_fetcher.mm b/ios/web/public/image_fetcher/image_data_fetcher.mm index cc7167db..11a237a 100644 --- a/ios/web/public/image_fetcher/image_data_fetcher.mm +++ b/ios/web/public/image_fetcher/image_data_fetcher.mm
@@ -9,10 +9,10 @@ #include "base/bind.h" #include "base/location.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/task_runner.h" #include "base/task_runner_util.h" -#include "ios/web/public/image_fetcher/webp_decoder.h" +#import "ios/web/public/image_fetcher/webp_decoder.h" #include "net/base/load_flags.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_fetcher.h"
diff --git a/ios/web/public/image_fetcher/webp_decoder.h b/ios/web/public/image_fetcher/webp_decoder.h index 1ab4d6c5..268ffc3 100644 --- a/ios/web/public/image_fetcher/webp_decoder.h +++ b/ios/web/public/image_fetcher/webp_decoder.h
@@ -10,7 +10,7 @@ #include <memory> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted.h" #include "third_party/libwebp/webp/decode.h"
diff --git a/ios/web/public/image_fetcher/webp_decoder.mm b/ios/web/public/image_fetcher/webp_decoder.mm index 935deee..95b18936c 100644 --- a/ios/web/public/image_fetcher/webp_decoder.mm +++ b/ios/web/public/image_fetcher/webp_decoder.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/image_fetcher/webp_decoder.h" +#import "ios/web/public/image_fetcher/webp_decoder.h" #import <Foundation/Foundation.h> #include <stdint.h>
diff --git a/ios/web/public/image_fetcher/webp_decoder_unittest.mm b/ios/web/public/image_fetcher/webp_decoder_unittest.mm index 9efbe75..fdaae2e9 100644 --- a/ios/web/public/image_fetcher/webp_decoder_unittest.mm +++ b/ios/web/public/image_fetcher/webp_decoder_unittest.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/image_fetcher/webp_decoder.h" +#import "ios/web/public/image_fetcher/webp_decoder.h" #import <CoreGraphics/CoreGraphics.h> #import <Foundation/Foundation.h> @@ -16,7 +16,7 @@ #include "base/ios/ios_util.h" #include "base/logging.h" #include "base/mac/scoped_cftyperef.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/path_service.h"
diff --git a/ios/web/public/java_script_dialog_callback.h b/ios/web/public/java_script_dialog_callback.h index 1d89ccd..ca1d968 100644 --- a/ios/web/public/java_script_dialog_callback.h +++ b/ios/web/public/java_script_dialog_callback.h
@@ -5,6 +5,8 @@ #ifndef IOS_WEB_PUBLIC_JAVA_SCRIPT_DIALOG_CALLBACK_H_ #define IOS_WEB_PUBLIC_JAVA_SCRIPT_DIALOG_CALLBACK_H_ +#import <Foundation/Foundation.h> + #include "base/callback.h" namespace web {
diff --git a/ios/web/public/origin_util_unittest.mm b/ios/web/public/origin_util_unittest.mm index c797864..79cae2b0 100644 --- a/ios/web/public/origin_util_unittest.mm +++ b/ios/web/public/origin_util_unittest.mm
@@ -6,8 +6,8 @@ #import <WebKit/WebKit.h> -#include "base/mac/objc_property_releaser.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/objc_property_releaser.h" +#import "base/mac/scoped_nsobject.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h"
diff --git a/ios/web/public/test/crw_test_js_injection_receiver.mm b/ios/web/public/test/crw_test_js_injection_receiver.mm index 23975f4..7127e04 100644 --- a/ios/web/public/test/crw_test_js_injection_receiver.mm +++ b/ios/web/public/test/crw_test_js_injection_receiver.mm
@@ -7,7 +7,7 @@ #import <UIKit/UIKit.h> #import <WebKit/WebKit.h> -#include "base/ios/weak_nsobject.h" +#import "base/ios/weak_nsobject.h" #import "base/mac/scoped_nsobject.h" #import "ios/web/public/web_state/js/crw_js_injection_evaluator.h" #import "ios/web/web_state/ui/web_view_js_utils.h"
diff --git a/ios/web/public/test/earl_grey/web_view_actions.mm b/ios/web/public/test/earl_grey/web_view_actions.mm index 0335592..a8bfd1a 100644 --- a/ios/web/public/test/earl_grey/web_view_actions.mm +++ b/ios/web/public/test/earl_grey/web_view_actions.mm
@@ -6,9 +6,9 @@ #include "base/callback_helpers.h" #include "base/logging.h" -#include "base/mac/bind_objc_block.h" +#import "base/mac/bind_objc_block.h" #include "base/strings/stringprintf.h" -#include "base/test/ios/wait_util.h" +#import "base/test/ios/wait_util.h" #include "base/values.h" #import "ios/testing/wait_util.h" #import "ios/web/public/test/earl_grey/web_view_matchers.h"
diff --git a/ios/web/public/test/earl_grey/web_view_matchers.mm b/ios/web/public/test/earl_grey/web_view_matchers.mm index 984e731..024a5fe 100644 --- a/ios/web/public/test/earl_grey/web_view_matchers.mm +++ b/ios/web/public/test/earl_grey/web_view_matchers.mm
@@ -7,14 +7,14 @@ #import <UIKit/UIKit.h> #import <WebKit/WebKit.h> -#include "base/mac/bind_objc_block.h" +#import "base/mac/bind_objc_block.h" #import "base/mac/scoped_nsobject.h" #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" -#include "base/test/ios/wait_util.h" +#import "base/test/ios/wait_util.h" #include "base/values.h" -#include "ios/testing/wait_util.h" +#import "ios/testing/wait_util.h" #import "ios/web/interstitials/web_interstitial_impl.h" #import "ios/web/public/test/earl_grey/js_test_util.h" #import "ios/web/public/test/web_view_interaction_test_util.h"
diff --git a/ios/web/public/test/http_server.h b/ios/web/public/test/http_server.h index aed7739..11e32c9 100644 --- a/ios/web/public/test/http_server.h +++ b/ios/web/public/test/http_server.h
@@ -12,7 +12,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h" -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/response_provider.h" @class GCDWebServer;
diff --git a/ios/web/public/test/http_server_inttest.mm b/ios/web/public/test/http_server_inttest.mm index 41ecb43..6e556e2d 100644 --- a/ios/web/public/test/http_server_inttest.mm +++ b/ios/web/public/test/http_server_inttest.mm
@@ -11,12 +11,12 @@ #include "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" #import "ios/web/public/test/http_server.h" -#include "ios/web/public/test/response_providers/string_response_provider.h" +#import "ios/web/public/test/response_providers/string_response_provider.h" #import "ios/web/test/web_int_test.h" #import "net/base/mac/url_conversions.h" #include "net/http/http_response_headers.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" // A test fixture for verifying the behavior of web::test::HttpServer. typedef web::WebIntTest HttpServerTest;
diff --git a/ios/web/public/test/http_server_util.mm b/ios/web/public/test/http_server_util.mm index b6ca437..42276a6 100644 --- a/ios/web/public/test/http_server_util.mm +++ b/ios/web/public/test/http_server_util.mm
@@ -7,8 +7,8 @@ #include "base/memory/ptr_util.h" #include "base/path_service.h" #import "ios/web/public/test/http_server.h" -#include "ios/web/public/test/response_providers/file_based_response_provider.h" -#include "ios/web/public/test/response_providers/html_response_provider.h" +#import "ios/web/public/test/response_providers/file_based_response_provider.h" +#import "ios/web/public/test/response_providers/html_response_provider.h" namespace web { namespace test {
diff --git a/ios/web/public/test/js_test_util.mm b/ios/web/public/test/js_test_util.mm index 05a3e1cab..00ab99d 100644 --- a/ios/web/public/test/js_test_util.mm +++ b/ios/web/public/test/js_test_util.mm
@@ -6,7 +6,7 @@ #import <WebKit/WebKit.h> -#import "base/logging.h" +#include "base/logging.h" #import "base/mac/scoped_nsobject.h" #import "base/test/ios/wait_util.h" #import "ios/web/public/web_state/js/crw_js_injection_manager.h"
diff --git a/ios/web/public/test/response_providers/data_response_provider.h b/ios/web/public/test/response_providers/data_response_provider.h index 3ae5fae..9c32c70 100644 --- a/ios/web/public/test/response_providers/data_response_provider.h +++ b/ios/web/public/test/response_providers/data_response_provider.h
@@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/response_provider.h" #include "net/http/http_response_headers.h" namespace web {
diff --git a/ios/web/public/test/response_providers/data_response_provider.mm b/ios/web/public/test/response_providers/data_response_provider.mm index 4b1cd80..b73dcc23 100644 --- a/ios/web/public/test/response_providers/data_response_provider.mm +++ b/ios/web/public/test/response_providers/data_response_provider.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/response_providers/data_response_provider.h" +#import "ios/web/public/test/response_providers/data_response_provider.h" #include "base/strings/sys_string_conversions.h" #import "ios/third_party/gcdwebserver/src/GCDWebServer/Responses/GCDWebServerDataResponse.h"
diff --git a/ios/web/public/test/response_providers/delayed_response_provider.h b/ios/web/public/test/response_providers/delayed_response_provider.h index 6f74a8d..c313510 100644 --- a/ios/web/public/test/response_providers/delayed_response_provider.h +++ b/ios/web/public/test/response_providers/delayed_response_provider.h
@@ -7,7 +7,7 @@ #include <memory> -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/response_provider.h" namespace web {
diff --git a/ios/web/public/test/response_providers/delayed_response_provider.mm b/ios/web/public/test/response_providers/delayed_response_provider.mm index d1956a73..7d57911 100644 --- a/ios/web/public/test/response_providers/delayed_response_provider.mm +++ b/ios/web/public/test/response_providers/delayed_response_provider.mm
@@ -2,11 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/response_providers/delayed_response_provider.h" +#import "ios/web/public/test/response_providers/delayed_response_provider.h" #import <Foundation/Foundation.h> -#include "base/ios/weak_nsobject.h" +#import "base/ios/weak_nsobject.h" #import "base/mac/scoped_nsobject.h" #import "base/mac/foundation_util.h" #import "ios/third_party/gcdwebserver/src/GCDWebServer/Responses/GCDWebServerDataResponse.h"
diff --git a/ios/web/public/test/response_providers/error_page_response_provider.h b/ios/web/public/test/response_providers/error_page_response_provider.h index 030c4ad..79f4730b 100644 --- a/ios/web/public/test/response_providers/error_page_response_provider.h +++ b/ios/web/public/test/response_providers/error_page_response_provider.h
@@ -8,7 +8,7 @@ #include <map> #include <string> -#include "ios/web/public/test/response_providers/html_response_provider.h" +#import "ios/web/public/test/response_providers/html_response_provider.h" #include "url/gurl.h" // A HtmlResponseProvider that supports the following additional URLs:
diff --git a/ios/web/public/test/response_providers/error_page_response_provider.mm b/ios/web/public/test/response_providers/error_page_response_provider.mm index 9980891..f8fb072 100644 --- a/ios/web/public/test/response_providers/error_page_response_provider.mm +++ b/ios/web/public/test/response_providers/error_page_response_provider.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/response_providers/error_page_response_provider.h" +#import "ios/web/public/test/response_providers/error_page_response_provider.h" #include "base/logging.h" #import "ios/web/public/test/http_server.h"
diff --git a/ios/web/public/test/response_providers/file_based_response_provider.h b/ios/web/public/test/response_providers/file_based_response_provider.h index b9c98b7..e0b0eef 100644 --- a/ios/web/public/test/response_providers/file_based_response_provider.h +++ b/ios/web/public/test/response_providers/file_based_response_provider.h
@@ -8,8 +8,8 @@ #include <memory> #include "base/compiler_specific.h" -#include "ios/web/public/test/response_providers/file_based_response_provider_impl.h" -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/file_based_response_provider_impl.h" +#import "ios/web/public/test/response_providers/response_provider.h" namespace base { class FilePath;
diff --git a/ios/web/public/test/response_providers/file_based_response_provider.mm b/ios/web/public/test/response_providers/file_based_response_provider.mm index 4c9fa178..457a5f88 100644 --- a/ios/web/public/test/response_providers/file_based_response_provider.mm +++ b/ios/web/public/test/response_providers/file_based_response_provider.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/response_providers/file_based_response_provider.h" +#import "ios/web/public/test/response_providers/file_based_response_provider.h" #include "base/files/file_path.h" #include "base/strings/sys_string_conversions.h"
diff --git a/ios/web/public/test/response_providers/file_based_response_provider_impl.h b/ios/web/public/test/response_providers/file_based_response_provider_impl.h index 95853653..a04163c 100644 --- a/ios/web/public/test/response_providers/file_based_response_provider_impl.h +++ b/ios/web/public/test/response_providers/file_based_response_provider_impl.h
@@ -6,7 +6,7 @@ #define IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_FILE_BASED_RESPONSE_PROVIDER_IMPL_H_ #include "base/files/file_path.h" -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/response_provider.h" class GURL;
diff --git a/ios/web/public/test/response_providers/file_based_response_provider_impl.mm b/ios/web/public/test/response_providers/file_based_response_provider_impl.mm index d7740b2c..f10ab13 100644 --- a/ios/web/public/test/response_providers/file_based_response_provider_impl.mm +++ b/ios/web/public/test/response_providers/file_based_response_provider_impl.mm
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/response_providers/file_based_response_provider_impl.h" +#import "ios/web/public/test/response_providers/file_based_response_provider_impl.h" #include "base/files/file_util.h" -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/response_provider.h" #include "url/gurl.h" namespace web {
diff --git a/ios/web/public/test/response_providers/html_response_provider.h b/ios/web/public/test/response_providers/html_response_provider.h index d19d972d..86a021c 100644 --- a/ios/web/public/test/response_providers/html_response_provider.h +++ b/ios/web/public/test/response_providers/html_response_provider.h
@@ -9,9 +9,9 @@ #include <string> #include "base/memory/ref_counted.h" -#include "ios/web/public/test/response_providers/data_response_provider.h" -#include "ios/web/public/test/response_providers/html_response_provider_impl.h" -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/data_response_provider.h" +#import "ios/web/public/test/response_providers/html_response_provider_impl.h" +#import "ios/web/public/test/response_providers/response_provider.h" #include "url/gurl.h" namespace net {
diff --git a/ios/web/public/test/response_providers/html_response_provider.mm b/ios/web/public/test/response_providers/html_response_provider.mm index 690596c..cf09ede8 100644 --- a/ios/web/public/test/response_providers/html_response_provider.mm +++ b/ios/web/public/test/response_providers/html_response_provider.mm
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/response_providers/html_response_provider.h" +#import "ios/web/public/test/response_providers/html_response_provider.h" -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/response_provider.h" #include "url/gurl.h" HtmlResponseProvider::HtmlResponseProvider()
diff --git a/ios/web/public/test/response_providers/html_response_provider_impl.h b/ios/web/public/test/response_providers/html_response_provider_impl.h index d9214b5..298a49d 100644 --- a/ios/web/public/test/response_providers/html_response_provider_impl.h +++ b/ios/web/public/test/response_providers/html_response_provider_impl.h
@@ -9,8 +9,8 @@ #include <string> #include "base/memory/ref_counted.h" -#include "ios/web/public/test/response_providers/data_response_provider.h" -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/data_response_provider.h" +#import "ios/web/public/test/response_providers/response_provider.h" #include "net/http/http_response_headers.h" #include "net/http/http_status_code.h" #include "url/gurl.h"
diff --git a/ios/web/public/test/response_providers/html_response_provider_impl.mm b/ios/web/public/test/response_providers/html_response_provider_impl.mm index 0ae64fec..543f190 100644 --- a/ios/web/public/test/response_providers/html_response_provider_impl.mm +++ b/ios/web/public/test/response_providers/html_response_provider_impl.mm
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/response_providers/html_response_provider_impl.h" +#import "ios/web/public/test/response_providers/html_response_provider_impl.h" -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/response_provider.h" #include "net/http/http_response_headers.h" #include "net/http/http_status_code.h" #include "url/gurl.h"
diff --git a/ios/web/public/test/response_providers/response_provider.mm b/ios/web/public/test/response_providers/response_provider.mm index 22752a0..b47d62b 100644 --- a/ios/web/public/test/response_providers/response_provider.mm +++ b/ios/web/public/test/response_providers/response_provider.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/response_providers/response_provider.h" +#import "ios/web/public/test/response_providers/response_provider.h" #include "base/strings/stringprintf.h" #include "net/http/http_response_headers.h"
diff --git a/ios/web/public/test/response_providers/string_response_provider.h b/ios/web/public/test/response_providers/string_response_provider.h index e5a0f9e..2b20d7d 100644 --- a/ios/web/public/test/response_providers/string_response_provider.h +++ b/ios/web/public/test/response_providers/string_response_provider.h
@@ -8,7 +8,7 @@ #include <string> #include "base/macros.h" -#include "ios/web/public/test/response_providers/data_response_provider.h" +#import "ios/web/public/test/response_providers/data_response_provider.h" namespace web {
diff --git a/ios/web/public/test/response_providers/string_response_provider.mm b/ios/web/public/test/response_providers/string_response_provider.mm index 85756529..41834a4 100644 --- a/ios/web/public/test/response_providers/string_response_provider.mm +++ b/ios/web/public/test/response_providers/string_response_provider.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/response_providers/string_response_provider.h" +#import "ios/web/public/test/response_providers/string_response_provider.h" namespace web {
diff --git a/ios/web/public/test/scoped_testing_web_client.mm b/ios/web/public/test/scoped_testing_web_client.mm index fd06b97..98807ea9 100644 --- a/ios/web/public/test/scoped_testing_web_client.mm +++ b/ios/web/public/test/scoped_testing_web_client.mm
@@ -5,7 +5,7 @@ #include "ios/web/public/test/scoped_testing_web_client.h" #include "base/logging.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" namespace web {
diff --git a/ios/web/public/test/test_native_content.mm b/ios/web/public/test/test_native_content.mm index 3b1c5ea4..398bae5 100644 --- a/ios/web/public/test/test_native_content.mm +++ b/ios/web/public/test/test_native_content.mm
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/test_native_content.h" +#import "ios/web/public/test/test_native_content.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" @implementation TestNativeContent { GURL _URL;
diff --git a/ios/web/public/test/test_native_content_provider.mm b/ios/web/public/test/test_native_content_provider.mm index 0033b8e..91cf920b 100644 --- a/ios/web/public/test/test_native_content_provider.mm +++ b/ios/web/public/test/test_native_content_provider.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/test_native_content_provider.h" +#import "ios/web/public/test/test_native_content_provider.h" #include <map>
diff --git a/ios/web/public/test/test_navigation_manager.mm b/ios/web/public/test/test_navigation_manager.mm index 0966d35..398d967 100644 --- a/ios/web/public/test/test_navigation_manager.mm +++ b/ios/web/public/test/test_navigation_manager.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/test_navigation_manager.h" +#import "ios/web/public/test/test_navigation_manager.h" namespace web {
diff --git a/ios/web/public/test/test_web_client.h b/ios/web/public/test/test_web_client.h index 1514f112..08ad507 100644 --- a/ios/web/public/test/test_web_client.h +++ b/ios/web/public/test/test_web_client.h
@@ -8,8 +8,8 @@ #import <Foundation/Foundation.h> #include "base/compiler_specific.h" -#include "base/mac/scoped_nsobject.h" -#include "ios/web/public/web_client.h" +#import "base/mac/scoped_nsobject.h" +#import "ios/web/public/web_client.h" #include "net/ssl/ssl_info.h" #include "url/gurl.h"
diff --git a/ios/web/public/test/test_web_state.mm b/ios/web/public/test/test_web_state.mm index e6665844..e2edc40a 100644 --- a/ios/web/public/test/test_web_state.mm +++ b/ios/web/public/test/test_web_state.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/test/test_web_state.h" +#import "ios/web/public/test/test_web_state.h" #include <stdint.h>
diff --git a/ios/web/public/test/test_web_view_content_view.mm b/ios/web/public/test/test_web_view_content_view.mm index 500a31d3..3dbc9b8 100644 --- a/ios/web/public/test/test_web_view_content_view.mm +++ b/ios/web/public/test/test_web_view_content_view.mm
@@ -5,7 +5,7 @@ #import "ios/web/public/test/test_web_view_content_view.h" #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" @interface TestWebViewContentView () { base::scoped_nsprotocol<id> _mockWebView;
diff --git a/ios/web/public/test/web_js_test.h b/ios/web/public/test/web_js_test.h index f47ceb49..f50cae8 100644 --- a/ios/web/public/test/web_js_test.h +++ b/ios/web/public/test/web_js_test.h
@@ -9,7 +9,7 @@ #import "base/mac/bundle_locations.h" #import "base/mac/scoped_nsobject.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" namespace web {
diff --git a/ios/web/public/test/web_test.mm b/ios/web/public/test/web_test.mm index 7c49547e5..d22fe43 100644 --- a/ios/web/public/test/web_test.mm +++ b/ios/web/public/test/web_test.mm
@@ -5,7 +5,7 @@ #include "ios/web/public/test/web_test.h" #include "base/memory/ptr_util.h" -#import "ios/web/public/active_state_manager.h" +#include "ios/web/public/active_state_manager.h" #import "ios/web/public/test/test_web_client.h" namespace web {
diff --git a/ios/web/public/test/web_test_with_web_state.h b/ios/web/public/test/web_test_with_web_state.h index c65fbb7fb..74eb958 100644 --- a/ios/web/public/test/web_test_with_web_state.h +++ b/ios/web/public/test/web_test_with_web_state.h
@@ -5,7 +5,7 @@ #ifndef IOS_WEB_PUBLIC_TEST_WEB_TEST_WITH_WEB_STATE_H_ #define IOS_WEB_PUBLIC_TEST_WEB_TEST_WITH_WEB_STATE_H_ -#include "base/ios/block_types.h" +#import "base/ios/block_types.h" #include "base/message_loop/message_loop.h" #include "ios/web/public/test/web_test.h" #include "url/gurl.h"
diff --git a/ios/web/public/test/web_test_with_web_state.mm b/ios/web/public/test/web_test_with_web_state.mm index f70c4c6..6ad0beb3 100644 --- a/ios/web/public/test/web_test_with_web_state.mm +++ b/ios/web/public/test/web_test_with_web_state.mm
@@ -6,8 +6,8 @@ #include "base/run_loop.h" #include "base/strings/sys_string_conversions.h" -#include "base/test/ios/wait_util.h" -#import "ios/web/public/web_state/url_verification_constants.h" +#import "base/test/ios/wait_util.h" +#include "ios/web/public/web_state/url_verification_constants.h" #include "ios/web/public/web_state/web_state_observer.h" #import "ios/web/web_state/ui/crw_web_controller.h" #import "ios/web/web_state/web_state_impl.h"
diff --git a/ios/web/public/test/web_view_interaction_test_util.h b/ios/web/public/test/web_view_interaction_test_util.h index a3c54d8..38d4a0e 100644 --- a/ios/web/public/test/web_view_interaction_test_util.h +++ b/ios/web/public/test/web_view_interaction_test_util.h
@@ -9,7 +9,7 @@ #include <string> -#include "base/ios/block_types.h" +#import "base/ios/block_types.h" #include "base/values.h" #import "ios/web/public/web_state/web_state.h"
diff --git a/ios/web/public/test/web_view_interaction_test_util.mm b/ios/web/public/test/web_view_interaction_test_util.mm index 277d4da..aa1baf60 100644 --- a/ios/web/public/test/web_view_interaction_test_util.mm +++ b/ios/web/public/test/web_view_interaction_test_util.mm
@@ -4,15 +4,15 @@ #import "ios/web/public/test/web_view_interaction_test_util.h" -#include "base/mac/bind_objc_block.h" +#import "base/mac/bind_objc_block.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" -#include "base/test/ios/wait_util.h" -#include "ios/testing/wait_util.h" +#import "base/test/ios/wait_util.h" +#import "ios/testing/wait_util.h" #import "ios/web/public/web_state/crw_web_view_scroll_view_proxy.h" #import "ios/web/web_state/crw_web_view_proxy_impl.h" #import "ios/web/web_state/ui/crw_web_controller.h" -#include "ios/web/web_state/web_state_impl.h" +#import "ios/web/web_state/web_state_impl.h" using web::NavigationManager;
diff --git a/ios/web/public/url_schemes.mm b/ios/web/public/url_schemes.mm index 541e7e1..45b07bf 100644 --- a/ios/web/public/url_schemes.mm +++ b/ios/web/public/url_schemes.mm
@@ -7,7 +7,7 @@ #include <algorithm> #include <vector> -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "url/url_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/public/user_agent.mm b/ios/web/public/user_agent.mm index f1dcfbe9..c3342aa 100644 --- a/ios/web/public/user_agent.mm +++ b/ios/web/public/user_agent.mm
@@ -11,7 +11,7 @@ #include <sys/sysctl.h> #include <string> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h"
diff --git a/ios/web/public/web_client.mm b/ios/web/public/web_client.mm index 6ee1bd3..997eece 100644 --- a/ios/web/public/web_client.mm +++ b/ios/web/public/web_client.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #import <Foundation/Foundation.h>
diff --git a/ios/web/public/web_state/context_menu_params.h b/ios/web/public/web_state/context_menu_params.h index 9c793f5..925fa300 100644 --- a/ios/web/public/web_state/context_menu_params.h +++ b/ios/web/public/web_state/context_menu_params.h
@@ -6,7 +6,7 @@ #import <UIKit/UIKit.h> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/string16.h" #include "ios/web/public/referrer.h" #include "url/gurl.h"
diff --git a/ios/web/public/web_state/ui/crw_generic_content_view.h b/ios/web/public/web_state/ui/crw_generic_content_view.h index 221bf4c..ac1a059 100644 --- a/ios/web/public/web_state/ui/crw_generic_content_view.h +++ b/ios/web/public/web_state/ui/crw_generic_content_view.h
@@ -5,7 +5,7 @@ #ifndef IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_GENERIC_CONTENT_VIEW_H_ #define IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_GENERIC_CONTENT_VIEW_H_ -#include "ios/web/public/web_state/ui/crw_content_view.h" +#import "ios/web/public/web_state/ui/crw_content_view.h" // Wraps an arbitrary native UIView in a CRWContentView. @interface CRWGenericContentView : CRWContentView
diff --git a/ios/web/public/web_state/ui/crw_web_delegate.h b/ios/web/public/web_state/ui/crw_web_delegate.h index f0091a1..7a51db7 100644 --- a/ios/web/public/web_state/ui/crw_web_delegate.h +++ b/ios/web/public/web_state/ui/crw_web_delegate.h
@@ -9,12 +9,12 @@ #import <UIKit/UIKit.h> #include <vector> -#include "base/ios/block_types.h" +#import "base/ios/block_types.h" #include "ios/web/public/favicon_url.h" #import "ios/web/public/navigation_manager.h" #include "ios/web/public/ssl_status.h" #import "ios/web/public/web_state/ui/crw_native_content.h" -#include "ios/web/public/web_state/web_state.h" +#import "ios/web/public/web_state/web_state.h" #include "ui/base/page_transition_types.h" class GURL;
diff --git a/ios/web/public/web_state/web_state_observer_bridge.h b/ios/web/public/web_state/web_state_observer_bridge.h index a0ba092..f230d93 100644 --- a/ios/web/public/web_state/web_state_observer_bridge.h +++ b/ios/web/public/web_state/web_state_observer_bridge.h
@@ -11,7 +11,7 @@ #import "base/ios/weak_nsobject.h" #include "base/macros.h" -#import "ios/web/public/web_state/web_state_observer.h" +#include "ios/web/public/web_state/web_state_observer.h" class GURL;
diff --git a/ios/web/public/web_state/web_state_user_data.h b/ios/web/public/web_state/web_state_user_data.h index 61145b9..8f224a5d 100644 --- a/ios/web/public/web_state/web_state_user_data.h +++ b/ios/web/public/web_state/web_state_user_data.h
@@ -7,7 +7,7 @@ #include "base/logging.h" #include "base/supports_user_data.h" -#include "ios/web/public/web_state/web_state.h" +#import "ios/web/public/web_state/web_state.h" namespace web {
diff --git a/ios/web/shell/app_delegate.mm b/ios/web/shell/app_delegate.mm index f5a4a3f..abc7bac 100644 --- a/ios/web/shell/app_delegate.mm +++ b/ios/web/shell/app_delegate.mm
@@ -8,11 +8,11 @@ #import "base/mac/scoped_nsobject.h" #include "ios/web/public/app/web_main.h" -#include "ios/web/public/web_client.h" -#include "ios/web/public/web_state/web_state.h" +#import "ios/web/public/web_client.h" +#import "ios/web/public/web_state/web_state.h" #include "ios/web/shell/shell_browser_state.h" #include "ios/web/shell/shell_main_delegate.h" -#include "ios/web/shell/shell_web_client.h" +#import "ios/web/shell/shell_web_client.h" #import "ios/web/shell/view_controller.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/shell/shell_main_delegate.mm b/ios/web/shell/shell_main_delegate.mm index 367a7f76..32184b1 100644 --- a/ios/web/shell/shell_main_delegate.mm +++ b/ios/web/shell/shell_main_delegate.mm
@@ -4,7 +4,7 @@ #include "ios/web/shell/shell_main_delegate.h" -#include "ios/web/shell/shell_web_client.h" +#import "ios/web/shell/shell_web_client.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/web/shell/shell_url_request_context_getter.mm b/ios/web/shell/shell_url_request_context_getter.mm index d7efc4aea..7fa966c 100644 --- a/ios/web/shell/shell_url_request_context_getter.mm +++ b/ios/web/shell/shell_url_request_context_getter.mm
@@ -13,8 +13,8 @@ #include "base/memory/ref_counted.h" #include "base/path_service.h" #include "base/threading/worker_pool.h" -#include "ios/net/cookies/cookie_store_ios.h" -#include "ios/web/public/web_client.h" +#import "ios/net/cookies/cookie_store_ios.h" +#import "ios/web/public/web_client.h" #include "ios/web/public/web_thread.h" #include "ios/web/shell/shell_network_delegate.h" #include "net/base/cache_type.h"
diff --git a/ios/web/shell/shell_web_client.h b/ios/web/shell/shell_web_client.h index 3da1f65..4ab58d8 100644 --- a/ios/web/shell/shell_web_client.h +++ b/ios/web/shell/shell_web_client.h
@@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" namespace web { class ShellBrowserState;
diff --git a/ios/web/shell/shell_web_client.mm b/ios/web/shell/shell_web_client.mm index 659f789..825e9d1 100644 --- a/ios/web/shell/shell_web_client.mm +++ b/ios/web/shell/shell_web_client.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/shell/shell_web_client.h" +#import "ios/web/shell/shell_web_client.h" #import <UIKit/UIKit.h>
diff --git a/ios/web/shell/test/context_menu_egtest.mm b/ios/web/shell/test/context_menu_egtest.mm index d87f608..9b10422 100644 --- a/ios/web/shell/test/context_menu_egtest.mm +++ b/ios/web/shell/test/context_menu_egtest.mm
@@ -7,7 +7,7 @@ #import <WebKit/WebKit.h> #import <XCTest/XCTest.h> -#include "base/ios/block_types.h" +#import "base/ios/block_types.h" #include "base/strings/sys_string_conversions.h" #import "ios/testing/earl_grey/matchers.h" #import "ios/web/public/test/http_server.h"
diff --git a/ios/web/shell/test/earl_grey/shell_matchers.mm b/ios/web/shell/test/earl_grey/shell_matchers.mm index f3bea48..b22b75f 100644 --- a/ios/web/shell/test/earl_grey/shell_matchers.mm +++ b/ios/web/shell/test/earl_grey/shell_matchers.mm
@@ -7,7 +7,7 @@ #import "base/mac/foundation_util.h" #include "base/strings/sys_string_conversions.h" #import "ios/testing/earl_grey/matchers.h" -#include "ios/testing/wait_util.h" +#import "ios/testing/wait_util.h" #import "ios/web/public/web_state/web_state.h" #import "ios/web/public/test/earl_grey/web_view_matchers.h" #import "ios/web/shell/test/app/web_shell_test_util.h"
diff --git a/ios/web/shell/test/meta_tags_egtest.mm b/ios/web/shell/test/meta_tags_egtest.mm index ae3b926..bc606329 100644 --- a/ios/web/shell/test/meta_tags_egtest.mm +++ b/ios/web/shell/test/meta_tags_egtest.mm
@@ -5,7 +5,7 @@ #include <map> #include "base/strings/stringprintf.h" -#include "base/test/ios/wait_util.h" +#import "base/test/ios/wait_util.h" #import "ios/web/public/test/http_server.h" #include "ios/web/public/test/http_server_util.h" #import "ios/web/shell/test/earl_grey/shell_base_test_case.h"
diff --git a/ios/web/shell/test/page_state_egtest.mm b/ios/web/shell/test/page_state_egtest.mm index 4cb32590..a6e6139 100644 --- a/ios/web/shell/test/page_state_egtest.mm +++ b/ios/web/shell/test/page_state_egtest.mm
@@ -8,7 +8,7 @@ #import <XCTest/XCTest.h> #include "base/ios/ios_util.h" -#import "ios/testing/earl_grey/disabled_test_macros.h" +#include "ios/testing/earl_grey/disabled_test_macros.h" #import "ios/web/public/test/http_server.h" #include "ios/web/public/test/http_server_util.h" #import "ios/web/shell/test/earl_grey/shell_base_test_case.h"
diff --git a/ios/web/shell/test/pdf_egtest.mm b/ios/web/shell/test/pdf_egtest.mm index f18f409..c240bf35 100644 --- a/ios/web/shell/test/pdf_egtest.mm +++ b/ios/web/shell/test/pdf_egtest.mm
@@ -4,8 +4,8 @@ #import <EarlGrey/EarlGrey.h> -#include "base/test/ios/wait_util.h" -#include "ios/testing/wait_util.h" +#import "base/test/ios/wait_util.h" +#import "ios/testing/wait_util.h" #import "ios/web/public/test/earl_grey/web_view_matchers.h" #import "ios/web/public/test/http_server.h" #include "ios/web/public/test/http_server_util.h"
diff --git a/ios/web/shell/test/plugin_placeholder_egtest.mm b/ios/web/shell/test/plugin_placeholder_egtest.mm index b7939ec0..a3a29cb 100644 --- a/ios/web/shell/test/plugin_placeholder_egtest.mm +++ b/ios/web/shell/test/plugin_placeholder_egtest.mm
@@ -8,7 +8,7 @@ #import <EarlGrey/EarlGrey.h> #include "base/strings/stringprintf.h" -#include "base/test/ios/wait_util.h" +#import "base/test/ios/wait_util.h" #import "ios/web/public/test/http_server.h" #include "ios/web/public/test/http_server_util.h" #import "ios/web/shell/test/earl_grey/shell_base_test_case.h"
diff --git a/ios/web/shell/test/redirect_egtest.mm b/ios/web/shell/test/redirect_egtest.mm index 91f4b5c..f53e64f6 100644 --- a/ios/web/shell/test/redirect_egtest.mm +++ b/ios/web/shell/test/redirect_egtest.mm
@@ -6,8 +6,8 @@ #import "ios/web/public/test/http_server.h" #include "ios/web/public/test/http_server_util.h" -#include "ios/web/public/test/response_providers/html_response_provider.h" -#include "ios/web/public/test/response_providers/html_response_provider_impl.h" +#import "ios/web/public/test/response_providers/html_response_provider.h" +#import "ios/web/public/test/response_providers/html_response_provider_impl.h" #import "ios/web/shell/test/earl_grey/shell_base_test_case.h" #import "ios/web/shell/test/earl_grey/shell_earl_grey.h" #import "ios/web/shell/test/earl_grey/shell_matchers.h"
diff --git a/ios/web/shell/view_controller.mm b/ios/web/shell/view_controller.mm index 893fb86..8b33ba70 100644 --- a/ios/web/shell/view_controller.mm +++ b/ios/web/shell/view_controller.mm
@@ -19,7 +19,7 @@ #import "ios/web/public/navigation_manager.h" #include "ios/web/public/referrer.h" #import "ios/web/public/web_state/context_menu_params.h" -#include "ios/web/public/web_state/web_state.h" +#import "ios/web/public/web_state/web_state.h" #import "ios/web/public/web_state/web_state_delegate_bridge.h" #import "ios/web/public/web_state/web_state_observer_bridge.h" #import "net/base/mac/url_conversions.h"
diff --git a/ios/web/test/web_int_test.mm b/ios/web/test/web_int_test.mm index abc5d53e..92edfc8e 100644 --- a/ios/web/test/web_int_test.mm +++ b/ios/web/test/web_int_test.mm
@@ -4,9 +4,9 @@ #import "ios/web/test/web_int_test.h" -#include "base/ios/block_types.h" +#import "base/ios/block_types.h" -#include "base/test/ios/wait_util.h" +#import "base/test/ios/wait_util.h" #import "ios/web/public/test/http_server.h" #import "ios/web/public/web_view_creation_util.h"
diff --git a/ios/web/web_state/blocked_popup_info.h b/ios/web/web_state/blocked_popup_info.h index 9373ad36..311a5472 100644 --- a/ios/web/web_state/blocked_popup_info.h +++ b/ios/web/web_state/blocked_popup_info.h
@@ -7,8 +7,8 @@ #import <Foundation/Foundation.h> -#include "base/ios/block_types.h" -#include "base/mac/scoped_nsobject.h" +#import "base/ios/block_types.h" +#import "base/mac/scoped_nsobject.h" #include "ios/web/public/referrer.h" #include "url/gurl.h"
diff --git a/ios/web/web_state/blocked_popup_info.mm b/ios/web/web_state/blocked_popup_info.mm index fdeeac8..b77023e 100644 --- a/ios/web/web_state/blocked_popup_info.mm +++ b/ios/web/web_state/blocked_popup_info.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/web_state/blocked_popup_info.h" +#import "ios/web/web_state/blocked_popup_info.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/web/web_state/crw_pass_kit_downloader_unittest.mm b/ios/web/web_state/crw_pass_kit_downloader_unittest.mm index 9af61e4..3a14e2e 100644 --- a/ios/web/web_state/crw_pass_kit_downloader_unittest.mm +++ b/ios/web/web_state/crw_pass_kit_downloader_unittest.mm
@@ -15,7 +15,7 @@ #include "net/url_request/test_url_fetcher_factory.h" #include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_test_util.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "url/gurl.h" using net::HttpResponseHeaders;
diff --git a/ios/web/web_state/crw_web_view_proxy_impl.h b/ios/web/web_state/crw_web_view_proxy_impl.h index 87b4d04f..53074406 100644 --- a/ios/web/web_state/crw_web_view_proxy_impl.h +++ b/ios/web/web_state/crw_web_view_proxy_impl.h
@@ -7,8 +7,8 @@ #import <UIKit/UIKit.h> -#include "ios/web/public/web_state/crw_web_view_proxy.h" -#include "ios/web/public/web_state/ui/crw_content_view.h" +#import "ios/web/public/web_state/crw_web_view_proxy.h" +#import "ios/web/public/web_state/ui/crw_content_view.h" @class CRWWebController;
diff --git a/ios/web/web_state/crw_web_view_proxy_impl.mm b/ios/web/web_state/crw_web_view_proxy_impl.mm index 8bb4aba..357ed97 100644 --- a/ios/web/web_state/crw_web_view_proxy_impl.mm +++ b/ios/web/web_state/crw_web_view_proxy_impl.mm
@@ -4,7 +4,7 @@ #import "ios/web/web_state/crw_web_view_proxy_impl.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "ios/web/public/web_state/crw_web_view_scroll_view_proxy.h" #import "ios/web/public/web_state/ui/crw_content_view.h" #import "ios/web/web_state/ui/crw_web_controller.h"
diff --git a/ios/web/web_state/error_translation_util.mm b/ios/web/web_state/error_translation_util.mm index ee0f716..4b07e2b3 100644 --- a/ios/web/web_state/error_translation_util.mm +++ b/ios/web/web_state/error_translation_util.mm
@@ -7,7 +7,7 @@ #include <CFNetwork/CFNetwork.h> #import "base/ios/ns_error_util.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "net/base/net_errors.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/web_state/error_translation_util_unittest.mm b/ios/web/web_state/error_translation_util_unittest.mm index eb4bdad..f5d512af 100644 --- a/ios/web/web_state/error_translation_util_unittest.mm +++ b/ios/web/web_state/error_translation_util_unittest.mm
@@ -10,7 +10,7 @@ #include "base/strings/sys_string_conversions.h" #include "net/base/net_errors.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" // Test fixture for error translation testing.
diff --git a/ios/web/web_state/global_web_state_event_tracker.mm b/ios/web/web_state/global_web_state_event_tracker.mm index 49ed9f9a..0587e1d 100644 --- a/ios/web/web_state/global_web_state_event_tracker.mm +++ b/ios/web/web_state/global_web_state_event_tracker.mm
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "base/memory/singleton.h" #include "ios/web/public/web_state/web_state_observer.h" -#include "ios/web/public/web_state/web_state_user_data.h" +#import "ios/web/public/web_state/web_state_user_data.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/web/web_state/js/common_js_unittest.mm b/ios/web/web_state/js/common_js_unittest.mm index 821944e..5e10f768 100644 --- a/ios/web/web_state/js/common_js_unittest.mm +++ b/ios/web/web_state/js/common_js_unittest.mm
@@ -8,7 +8,7 @@ #include "base/macros.h" #import "ios/web/public/test/web_test_with_web_state.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" namespace {
diff --git a/ios/web/web_state/js/core_js_unittest.mm b/ios/web/web_state/js/core_js_unittest.mm index 7f4d7c7..dc83ee3 100644 --- a/ios/web/web_state/js/core_js_unittest.mm +++ b/ios/web/web_state/js/core_js_unittest.mm
@@ -9,7 +9,7 @@ #include "base/strings/stringprintf.h" #import "ios/web/public/test/web_test_with_web_state.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" // Unit tests for ios/web/web_state/js/resources/core.js.
diff --git a/ios/web/web_state/js/credential_util_unittest.mm b/ios/web/web_state/js/credential_util_unittest.mm index 5716660..6046fe1 100644 --- a/ios/web/web_state/js/credential_util_unittest.mm +++ b/ios/web/web_state/js/credential_util_unittest.mm
@@ -12,7 +12,7 @@ #include "ios/web/public/web_state/credential.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" #include "url/gurl.h" #include "url/origin.h"
diff --git a/ios/web/web_state/js/crw_js_injection_manager_unittest.mm b/ios/web/web_state/js/crw_js_injection_manager_unittest.mm index f2386d8..233a7fa 100644 --- a/ios/web/web_state/js/crw_js_injection_manager_unittest.mm +++ b/ios/web/web_state/js/crw_js_injection_manager_unittest.mm
@@ -10,7 +10,7 @@ #import "ios/web/public/test/web_test_with_web_state.h" #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" #import "ios/web/public/web_state/web_state.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" // Testing class of JsInjectioManager that has no dependencies. @interface TestingCRWJSBaseManager : CRWJSInjectionManager
diff --git a/ios/web/web_state/js/crw_js_plugin_placeholder_manager.mm b/ios/web/web_state/js/crw_js_plugin_placeholder_manager.mm index 43d44a17..ca7e9c7 100644 --- a/ios/web/web_state/js/crw_js_plugin_placeholder_manager.mm +++ b/ios/web/web_state/js/crw_js_plugin_placeholder_manager.mm
@@ -6,7 +6,7 @@ #include "base/logging.h" #include "base/strings/sys_string_conversions.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/web/web_state/js/page_script_util.mm b/ios/web/web_state/js/page_script_util.mm index f5a91094..fd7aeb90 100644 --- a/ios/web/web_state/js/page_script_util.mm +++ b/ios/web/web_state/js/page_script_util.mm
@@ -8,7 +8,7 @@ #include "base/files/file_util.h" #include "base/mac/bundle_locations.h" #include "base/strings/sys_string_conversions.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/web/web_state/js/page_script_util_unittest.mm b/ios/web/web_state/js/page_script_util_unittest.mm index 65e75c2..7ecdb74 100644 --- a/ios/web/web_state/js/page_script_util_unittest.mm +++ b/ios/web/web_state/js/page_script_util_unittest.mm
@@ -15,7 +15,7 @@ #import "ios/web/public/test/test_web_client.h" #include "ios/web/public/test/web_test.h" #import "ios/web/public/web_view_creation_util.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" namespace web { namespace {
diff --git a/ios/web/web_state/ui/crw_generic_content_view.mm b/ios/web/web_state/ui/crw_generic_content_view.mm index 7c8746b..2cae6c1 100644 --- a/ios/web/web_state/ui/crw_generic_content_view.mm +++ b/ios/web/web_state/ui/crw_generic_content_view.mm
@@ -5,7 +5,7 @@ #import "ios/web/public/web_state/ui/crw_generic_content_view.h" #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index 5a18350..c7340ba 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -15,18 +15,18 @@ #include "base/callback.h" #include "base/containers/mru_cache.h" -#include "base/ios/block_types.h" +#import "base/ios/block_types.h" #include "base/ios/ios_util.h" #import "base/ios/ns_error_util.h" -#include "base/ios/weak_nsobject.h" +#import "base/ios/weak_nsobject.h" #include "base/json/string_escape.h" #include "base/logging.h" -#include "base/mac/bind_objc_block.h" +#import "base/mac/bind_objc_block.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" -#include "base/mac/objc_property_releaser.h" +#import "base/mac/objc_property_releaser.h" #include "base/mac/scoped_cftyperef.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/metrics/histogram.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" @@ -38,8 +38,8 @@ #include "components/url_formatter/url_formatter.h" #import "ios/net/http_response_headers_util.h" #import "ios/net/nsurlrequest_util.h" -#import "ios/web/history_state_util.h" -#include "ios/web/interstitials/web_interstitial_impl.h" +#include "ios/web/history_state_util.h" +#import "ios/web/interstitials/web_interstitial_impl.h" #import "ios/web/navigation/crw_session_certificate_policy_manager.h" #import "ios/web/navigation/crw_session_controller.h" #import "ios/web/navigation/crw_session_entry.h" @@ -48,11 +48,11 @@ #include "ios/web/net/cert_host_pair.h" #import "ios/web/net/crw_cert_verification_controller.h" #import "ios/web/net/crw_ssl_status_updater.h" -#include "ios/web/net/request_group_util.h" +#import "ios/web/net/request_group_util.h" #include "ios/web/public/browser_state.h" #include "ios/web/public/favicon_url.h" #import "ios/web/public/java_script_dialog_presenter.h" -#include "ios/web/public/navigation_item.h" +#import "ios/web/public/navigation_item.h" #import "ios/web/public/navigation_manager.h" #import "ios/web/public/origin_util.h" #include "ios/web/public/referrer.h" @@ -60,13 +60,13 @@ #include "ios/web/public/ssl_status.h" #import "ios/web/public/url_scheme_util.h" #include "ios/web/public/url_util.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "ios/web/public/web_kit_constants.h" #import "ios/web/public/web_state/context_menu_params.h" #include "ios/web/public/web_state/credential.h" #import "ios/web/public/web_state/crw_web_controller_observer.h" #import "ios/web/public/web_state/crw_web_view_scroll_view_proxy.h" -#import "ios/web/public/web_state/js/credential_util.h" +#include "ios/web/public/web_state/js/credential_util.h" #import "ios/web/public/web_state/js/crw_js_injection_manager.h" #import "ios/web/public/web_state/js/crw_js_injection_receiver.h" #include "ios/web/public/web_state/page_display_state.h" @@ -75,9 +75,9 @@ #import "ios/web/public/web_state/ui/crw_native_content_provider.h" #import "ios/web/public/web_state/ui/crw_web_view_content_view.h" #include "ios/web/public/web_state/url_verification_constants.h" -#include "ios/web/public/web_state/web_state.h" +#import "ios/web/public/web_state/web_state.h" #include "ios/web/public/webui/web_ui_ios.h" -#include "ios/web/web_state/blocked_popup_info.h" +#import "ios/web/web_state/blocked_popup_info.h" #import "ios/web/web_state/crw_pass_kit_downloader.h" #import "ios/web/web_state/crw_web_view_proxy_impl.h" #import "ios/web/web_state/error_translation_util.h"
diff --git a/ios/web/web_state/ui/crw_web_controller_container_view.h b/ios/web/web_state/ui/crw_web_controller_container_view.h index f28efaa..6f00a237 100644 --- a/ios/web/web_state/ui/crw_web_controller_container_view.h +++ b/ios/web/web_state/ui/crw_web_controller_container_view.h
@@ -7,7 +7,7 @@ #import <UIKit/UIKit.h> -#include "ios/web/public/web_state/ui/crw_content_view.h" +#import "ios/web/public/web_state/ui/crw_content_view.h" @class CRWWebControllerContainerView; @class CRWWebViewContentView;
diff --git a/ios/web/web_state/ui/crw_web_controller_container_view.mm b/ios/web/web_state/ui/crw_web_controller_container_view.mm index 87e1363..6db54ac 100644 --- a/ios/web/web_state/ui/crw_web_controller_container_view.mm +++ b/ios/web/web_state/ui/crw_web_controller_container_view.mm
@@ -4,9 +4,9 @@ #import "ios/web/web_state/ui/crw_web_controller_container_view.h" -#include "base/ios/weak_nsobject.h" +#import "base/ios/weak_nsobject.h" #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "ios/web/public/web_state/ui/crw_content_view.h" #import "ios/web/public/web_state/ui/crw_native_content.h" #import "ios/web/public/web_state/ui/crw_web_view_content_view.h"
diff --git a/ios/web/web_state/ui/crw_web_controller_container_view_unittest.mm b/ios/web/web_state/ui/crw_web_controller_container_view_unittest.mm index 197a3183..fa4f0af 100644 --- a/ios/web/web_state/ui/crw_web_controller_container_view_unittest.mm +++ b/ios/web/web_state/ui/crw_web_controller_container_view_unittest.mm
@@ -6,7 +6,7 @@ #import "ios/web/web_state/crw_web_view_proxy_impl.h" #import "ios/web/web_state/ui/crw_web_controller_container_view.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" #include "third_party/ocmock/gtest_support.h" #import "third_party/ocmock/OCMock/OCMock.h"
diff --git a/ios/web/web_state/ui/crw_web_controller_observer_unittest.mm b/ios/web/web_state/ui/crw_web_controller_observer_unittest.mm index 0ba1353..a4f54b1 100644 --- a/ios/web/web_state/ui/crw_web_controller_observer_unittest.mm +++ b/ios/web/web_state/ui/crw_web_controller_observer_unittest.mm
@@ -4,7 +4,7 @@ #import "ios/web/public/web_state/crw_web_controller_observer.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "ios/web/test/crw_fake_web_controller_observer.h" #import "ios/web/test/web_test_with_web_controller.h"
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm index 69c625ca..d6f3743 100644 --- a/ios/web/web_state/ui/crw_web_controller_unittest.mm +++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -9,18 +9,18 @@ #include <utility> #include "base/ios/ios_util.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #import "base/test/ios/wait_util.h" #import "ios/testing/ocmock_complex_type_helper.h" -#include "ios/web/navigation/crw_session_controller.h" -#include "ios/web/navigation/crw_session_entry.h" -#include "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/navigation/crw_session_controller.h" +#import "ios/web/navigation/crw_session_entry.h" +#import "ios/web/navigation/navigation_item_impl.h" #import "ios/web/navigation/navigation_manager_impl.h" #include "ios/web/public/referrer.h" #import "ios/web/public/test/test_native_content.h" #import "ios/web/public/test/test_native_content_provider.h" #import "ios/web/public/test/test_web_client.h" -#include "ios/web/public/test/test_web_view_content_view.h" +#import "ios/web/public/test/test_web_view_content_view.h" #import "ios/web/public/web_state/crw_web_controller_observer.h" #import "ios/web/public/web_state/ui/crw_content_view.h" #import "ios/web/public/web_state/ui/crw_native_content.h" @@ -30,7 +30,7 @@ #include "ios/web/public/web_state/web_state_observer.h" #import "ios/web/test/web_test_with_web_controller.h" #import "ios/web/test/wk_web_view_crash_utils.h" -#include "ios/web/web_state/blocked_popup_info.h" +#import "ios/web/web_state/blocked_popup_info.h" #import "ios/web/web_state/ui/crw_web_controller_container_view.h" #import "ios/web/web_state/web_state_impl.h" #import "ios/web/web_state/wk_web_view_security_util.h" @@ -39,11 +39,11 @@ #include "net/test/cert_test_util.h" #include "net/test/test_data_directory.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "third_party/ocmock/OCMock/OCMock.h" #include "third_party/ocmock/gtest_support.h" #include "third_party/ocmock/ocmock_extensions.h" -#include "ui/base/test/ios/ui_view_test_utils.h" +#import "ui/base/test/ios/ui_view_test_utils.h" using web::NavigationManagerImpl;
diff --git a/ios/web/web_state/ui/crw_web_view_content_view.mm b/ios/web/web_state/ui/crw_web_view_content_view.mm index df2962af..cda7343 100644 --- a/ios/web/web_state/ui/crw_web_view_content_view.mm +++ b/ios/web/web_state/ui/crw_web_view_content_view.mm
@@ -7,7 +7,7 @@ #import <WebKit/WebKit.h> #include "base/logging.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" namespace {
diff --git a/ios/web/web_state/ui/crw_wk_script_message_router.mm b/ios/web/web_state/ui/crw_wk_script_message_router.mm index 0e1dfbb..ed13ddb 100644 --- a/ios/web/web_state/ui/crw_wk_script_message_router.mm +++ b/ios/web/web_state/ui/crw_wk_script_message_router.mm
@@ -4,7 +4,7 @@ #import "ios/web/web_state/ui/crw_wk_script_message_router.h" -#import "base/logging.h" +#include "base/logging.h" #import "base/mac/scoped_nsobject.h" @interface CRWWKScriptMessageRouter ()<WKScriptMessageHandler>
diff --git a/ios/web/web_state/ui/crw_wk_script_message_router_unittest.mm b/ios/web/web_state/ui/crw_wk_script_message_router_unittest.mm index 089eaa0..e04c3a47 100644 --- a/ios/web/web_state/ui/crw_wk_script_message_router_unittest.mm +++ b/ios/web/web_state/ui/crw_wk_script_message_router_unittest.mm
@@ -5,7 +5,7 @@ #import "ios/web/web_state/ui/crw_wk_script_message_router.h" #include "base/mac/scoped_block.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #include "ios/web/public/test/scoped_testing_web_client.h" #include "ios/web/public/test/test_browser_state.h"
diff --git a/ios/web/web_state/ui/web_view_js_utils.h b/ios/web/web_state/ui/web_view_js_utils.h index 464c4f4..39c5d8e6 100644 --- a/ios/web/web_state/ui/web_view_js_utils.h +++ b/ios/web/web_state/ui/web_view_js_utils.h
@@ -8,7 +8,7 @@ #import <Foundation/Foundation.h> #include <memory> -#include "ios/web/public/block_types.h" +#import "ios/web/public/block_types.h" @class WKWebView;
diff --git a/ios/web/web_state/ui/web_view_js_utils.mm b/ios/web/web_state/ui/web_view_js_utils.mm index fb402fd..a626924 100644 --- a/ios/web/web_state/ui/web_view_js_utils.mm +++ b/ios/web/web_state/ui/web_view_js_utils.mm
@@ -9,7 +9,7 @@ #include "base/logging.h" #include "base/mac/foundation_util.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" #include "base/values.h"
diff --git a/ios/web/web_state/ui/web_view_js_utils_unittest.mm b/ios/web/web_state/ui/web_view_js_utils_unittest.mm index 44ae5c3f1..6ca075a 100644 --- a/ios/web/web_state/ui/web_view_js_utils_unittest.mm +++ b/ios/web/web_state/ui/web_view_js_utils_unittest.mm
@@ -6,7 +6,7 @@ #include "base/callback_helpers.h" #include "base/logging.h" -#include "base/mac/bind_objc_block.h" +#import "base/mac/bind_objc_block.h" #include "base/values.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/ios/web/web_state/ui/wk_back_forward_list_item_holder.h b/ios/web/web_state/ui/wk_back_forward_list_item_holder.h index d9186bee..793f311 100644 --- a/ios/web/web_state/ui/wk_back_forward_list_item_holder.h +++ b/ios/web/web_state/ui/wk_back_forward_list_item_holder.h
@@ -7,7 +7,7 @@ #import <WebKit/WebKit.h> -#include "base/ios/weak_nsobject.h" +#import "base/ios/weak_nsobject.h" #import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/supports_user_data.h"
diff --git a/ios/web/web_state/ui/wk_back_forward_list_item_holder.mm b/ios/web/web_state/ui/wk_back_forward_list_item_holder.mm index 32e9b37..0e99baab 100644 --- a/ios/web/web_state/ui/wk_back_forward_list_item_holder.mm +++ b/ios/web/web_state/ui/wk_back_forward_list_item_holder.mm
@@ -4,7 +4,7 @@ #import "ios/web/web_state/ui/wk_back_forward_list_item_holder.h" -#include "ios/web/public/navigation_item.h" +#import "ios/web/public/navigation_item.h" namespace web {
diff --git a/ios/web/web_state/ui/wk_back_forward_list_item_holder_unittest.mm b/ios/web/web_state/ui/wk_back_forward_list_item_holder_unittest.mm index e293335e..5d31e24 100644 --- a/ios/web/web_state/ui/wk_back_forward_list_item_holder_unittest.mm +++ b/ios/web/web_state/ui/wk_back_forward_list_item_holder_unittest.mm
@@ -6,10 +6,10 @@ #import <WebKit/WebKit.h> -#include "ios/web/navigation/navigation_item_impl.h" -#include "ios/web/public/navigation_item.h" +#import "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/public/navigation_item.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" namespace web {
diff --git a/ios/web/web_state/ui/wk_web_view_configuration_provider.h b/ios/web/web_state/ui/wk_web_view_configuration_provider.h index 1059e135..84191f7 100644 --- a/ios/web/web_state/ui/wk_web_view_configuration_provider.h +++ b/ios/web/web_state/ui/wk_web_view_configuration_provider.h
@@ -5,7 +5,7 @@ #ifndef IOS_WEB_WEB_STATE_UI_WK_WEB_VIEW_CONFIGURATION_PROVIDER_H_ #define IOS_WEB_WEB_STATE_UI_WK_WEB_VIEW_CONFIGURATION_PROVIDER_H_ -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/supports_user_data.h"
diff --git a/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm b/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm index 8196b96..fa53aa7 100644 --- a/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm +++ b/ios/web/web_state/ui/wk_web_view_configuration_provider_unittest.mm
@@ -10,11 +10,11 @@ #include "base/memory/ptr_util.h" #include "ios/web/public/test/scoped_testing_web_client.h" #include "ios/web/public/test/test_browser_state.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #import "ios/web/web_state/js/page_script_util.h" #import "ios/web/web_state/ui/crw_wk_script_message_router.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" namespace web {
diff --git a/ios/web/web_state/web_state.mm b/ios/web/web_state/web_state.mm index 51ea245e..d3ed3c7 100644 --- a/ios/web/web_state/web_state.mm +++ b/ios/web/web_state/web_state.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/web_state/web_state.h" +#import "ios/web/public/web_state/web_state.h" namespace web {
diff --git a/ios/web/web_state/web_state_delegate.mm b/ios/web/web_state/web_state_delegate.mm index d08ee50..1233533 100644 --- a/ios/web/web_state/web_state_delegate.mm +++ b/ios/web/web_state/web_state_delegate.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "ios/web/public/web_state/web_state_delegate.h" +#include "ios/web/public/web_state/web_state_delegate.h" #import "ios/web/public/web_state/web_state.h"
diff --git a/ios/web/web_state/web_state_delegate_bridge_unittest.mm b/ios/web/web_state/web_state_delegate_bridge_unittest.mm index 9272d80..fa1754d 100644 --- a/ios/web/web_state/web_state_delegate_bridge_unittest.mm +++ b/ios/web/web_state/web_state_delegate_bridge_unittest.mm
@@ -8,7 +8,7 @@ #import "base/mac/scoped_nsobject.h" #include "base/strings/utf_string_conversions.h" -#include "ios/web/public/web_state/context_menu_params.h" +#import "ios/web/public/web_state/context_menu_params.h" #import "ios/web/web_state/web_state_delegate_stub.h" #include "testing/platform_test.h" #import "third_party/ocmock/gtest_support.h"
diff --git a/ios/web/web_state/web_state_impl.h b/ios/web/web_state/web_state_impl.h index cb86de42..ed7214f 100644 --- a/ios/web/web_state/web_state_impl.h +++ b/ios/web/web_state/web_state_impl.h
@@ -17,12 +17,12 @@ #include "base/memory/ref_counted.h" #include "base/observer_list.h" #include "base/values.h" -#include "ios/web/navigation/navigation_manager_delegate.h" -#include "ios/web/navigation/navigation_manager_impl.h" -#include "ios/web/net/request_tracker_impl.h" +#import "ios/web/navigation/navigation_manager_delegate.h" +#import "ios/web/navigation/navigation_manager_impl.h" +#import "ios/web/net/request_tracker_impl.h" #import "ios/web/public/java_script_dialog_callback.h" #include "ios/web/public/java_script_dialog_type.h" -#include "ios/web/public/web_state/web_state.h" +#import "ios/web/public/web_state/web_state.h" #include "url/gurl.h" @protocol CRWRequestTrackerDelegate;
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm index 46897fa..5854cad 100644 --- a/ios/web/web_state/web_state_impl.mm +++ b/ios/web/web_state/web_state_impl.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/web_state/web_state_impl.h" +#import "ios/web/web_state/web_state_impl.h" #include <stddef.h> #include <stdint.h> @@ -10,29 +10,29 @@ #include "base/logging.h" #include "base/metrics/histogram_macros.h" #include "base/strings/sys_string_conversions.h" -#include "ios/web/interstitials/web_interstitial_impl.h" +#import "ios/web/interstitials/web_interstitial_impl.h" #import "ios/web/navigation/crw_session_controller.h" #import "ios/web/navigation/crw_session_entry.h" -#include "ios/web/navigation/navigation_item_impl.h" -#include "ios/web/net/request_group_util.h" +#import "ios/web/navigation/navigation_item_impl.h" +#import "ios/web/net/request_group_util.h" #include "ios/web/public/browser_state.h" #import "ios/web/public/image_fetcher/image_data_fetcher.h" #import "ios/web/public/java_script_dialog_presenter.h" -#include "ios/web/public/navigation_item.h" +#import "ios/web/public/navigation_item.h" #include "ios/web/public/url_util.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #import "ios/web/public/web_state/context_menu_params.h" #include "ios/web/public/web_state/credential.h" -#include "ios/web/public/web_state/ui/crw_content_view.h" +#import "ios/web/public/web_state/ui/crw_content_view.h" #include "ios/web/public/web_state/web_state_delegate.h" #include "ios/web/public/web_state/web_state_observer.h" -#include "ios/web/public/web_state/web_state_policy_decider.h" +#import "ios/web/public/web_state/web_state_policy_decider.h" #include "ios/web/web_state/global_web_state_event_tracker.h" #import "ios/web/web_state/ui/crw_web_controller.h" #import "ios/web/web_state/ui/crw_web_controller_container_view.h" #include "ios/web/web_state/web_state_facade_delegate.h" -#import "ios/web/webui/web_ui_ios_controller_factory_registry.h" -#import "ios/web/webui/web_ui_ios_impl.h" +#include "ios/web/webui/web_ui_ios_controller_factory_registry.h" +#include "ios/web/webui/web_ui_ios_impl.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_fetcher.h" #include "services/service_manager/public/cpp/interface_registry.h"
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm index e18e32a..4f9e243f 100644 --- a/ios/web/web_state/web_state_impl_unittest.mm +++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/web_state/web_state_impl.h" +#import "ios/web/web_state/web_state_impl.h" #include <stddef.h> @@ -11,26 +11,26 @@ #include "base/base64.h" #include "base/bind.h" #include "base/logging.h" -#include "base/mac/bind_objc_block.h" +#import "base/mac/bind_objc_block.h" #include "base/strings/utf_string_conversions.h" -#include "base/test/ios/wait_util.h" +#import "base/test/ios/wait_util.h" #include "base/values.h" #import "ios/web/public/java_script_dialog_presenter.h" #include "ios/web/public/load_committed_details.h" #include "ios/web/public/test/test_browser_state.h" #include "ios/web/public/test/web_test.h" -#include "ios/web/public/web_state/context_menu_params.h" +#import "ios/web/public/web_state/context_menu_params.h" #include "ios/web/public/web_state/global_web_state_observer.h" #include "ios/web/public/web_state/web_state_delegate.h" #include "ios/web/public/web_state/web_state_observer.h" -#include "ios/web/public/web_state/web_state_policy_decider.h" +#import "ios/web/public/web_state/web_state_policy_decider.h" #include "ios/web/web_state/global_web_state_event_tracker.h" #import "ios/web/web_state/ui/crw_web_controller.h" #include "net/http/http_response_headers.h" #include "net/http/http_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "url/gurl.h" using testing::_;
diff --git a/ios/web/web_state/web_state_observer.mm b/ios/web/web_state/web_state_observer.mm index 6c250e9..1408a6e8 100644 --- a/ios/web/web_state/web_state_observer.mm +++ b/ios/web/web_state/web_state_observer.mm
@@ -5,7 +5,7 @@ #include "ios/web/public/web_state/web_state_observer.h" #include "ios/web/public/load_committed_details.h" -#include "ios/web/public/web_state/web_state.h" +#import "ios/web/public/web_state/web_state.h" namespace web {
diff --git a/ios/web/web_state/web_state_policy_decider.mm b/ios/web/web_state/web_state_policy_decider.mm index 5f41fb8d..f061dfa12 100644 --- a/ios/web/web_state/web_state_policy_decider.mm +++ b/ios/web/web_state/web_state_policy_decider.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/web_state/web_state_policy_decider.h" +#import "ios/web/public/web_state/web_state_policy_decider.h" #import "ios/web/public/web_state/web_state.h" #import "ios/web/web_state/web_state_impl.h"
diff --git a/ios/web/web_state/web_state_weak_ptr_factory.mm b/ios/web/web_state/web_state_weak_ptr_factory.mm index 277f369..3b93e4b 100644 --- a/ios/web/web_state/web_state_weak_ptr_factory.mm +++ b/ios/web/web_state/web_state_weak_ptr_factory.mm
@@ -4,7 +4,7 @@ #include "ios/web/web_state/web_state_weak_ptr_factory.h" -#include "ios/web/public/web_state/web_state.h" +#import "ios/web/public/web_state/web_state.h" namespace web {
diff --git a/ios/web/web_state/web_view_internal_creation_util.mm b/ios/web/web_state/web_view_internal_creation_util.mm index 67e79aa1..2fb8789 100644 --- a/ios/web/web_state/web_view_internal_creation_util.mm +++ b/ios/web/web_state/web_view_internal_creation_util.mm
@@ -6,7 +6,7 @@ #include "base/logging.h" #include "base/strings/sys_string_conversions.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" namespace web {
diff --git a/ios/web/web_state/web_view_internal_creation_util_unittest.mm b/ios/web/web_state/web_view_internal_creation_util_unittest.mm index c65e9fb..9be10dd 100644 --- a/ios/web/web_state/web_view_internal_creation_util_unittest.mm +++ b/ios/web/web_state/web_view_internal_creation_util_unittest.mm
@@ -7,7 +7,7 @@ #import <CoreGraphics/CoreGraphics.h> #import <WebKit/WebKit.h> -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #include "ios/web/public/test/scoped_testing_web_client.h" #include "ios/web/public/test/test_browser_state.h" @@ -16,7 +16,7 @@ #import "ios/web/public/web_view_creation_util.h" #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" #include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" namespace {
diff --git a/ios/web/web_state/wk_web_view_security_util_unittest.mm b/ios/web/web_state/wk_web_view_security_util_unittest.mm index ece0122f..d2eb9c0 100644 --- a/ios/web/web_state/wk_web_view_security_util_unittest.mm +++ b/ios/web/web_state/wk_web_view_security_util_unittest.mm
@@ -16,7 +16,7 @@ #include "net/cert/x509_util.h" #include "net/ssl/ssl_info.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" namespace web {
diff --git a/ios/web/web_view_creation_util.mm b/ios/web/web_view_creation_util.mm index c6e586e..1ad84e97 100644 --- a/ios/web/web_view_creation_util.mm +++ b/ios/web/web_view_creation_util.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/public/web_view_creation_util.h" +#import "ios/web/public/web_view_creation_util.h" #include "base/logging.h" #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h"
diff --git a/ios/web/webui/crw_web_ui_manager.mm b/ios/web/webui/crw_web_ui_manager.mm index d7660f7a..fd5fa0e2 100644 --- a/ios/web/webui/crw_web_ui_manager.mm +++ b/ios/web/webui/crw_web_ui_manager.mm
@@ -5,8 +5,8 @@ #import "ios/web/webui/crw_web_ui_manager.h" #include "base/json/string_escape.h" -#include "base/mac/bind_objc_block.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/bind_objc_block.h" +#import "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted_memory.h" #include "base/memory/scoped_vector.h" #include "base/strings/stringprintf.h" @@ -16,12 +16,12 @@ #include "ios/web/grit/ios_web_resources.h" #import "ios/web/net/request_group_util.h" #include "ios/web/public/browser_state.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #import "ios/web/public/web_state/web_state_observer_bridge.h" -#include "ios/web/web_state/web_state_impl.h" +#import "ios/web/web_state/web_state_impl.h" #import "ios/web/webui/crw_web_ui_page_builder.h" #include "ios/web/webui/mojo_js_constants.h" -#include "ios/web/webui/url_fetcher_block_adapter.h" +#import "ios/web/webui/url_fetcher_block_adapter.h" #include "mojo/public/js/constants.h" #import "net/base/mac/url_conversions.h"
diff --git a/ios/web/webui/crw_web_ui_manager_unittest.mm b/ios/web/webui/crw_web_ui_manager_unittest.mm index 27288b4..79d2e425 100644 --- a/ios/web/webui/crw_web_ui_manager_unittest.mm +++ b/ios/web/webui/crw_web_ui_manager_unittest.mm
@@ -21,12 +21,12 @@ #include "ios/web/public/test/test_browser_state.h" #import "ios/web/public/test/test_web_client.h" #include "ios/web/public/test/web_test.h" -#include "ios/web/web_state/web_state_impl.h" +#import "ios/web/web_state/web_state_impl.h" #import "ios/web/webui/crw_web_ui_page_builder.h" -#include "ios/web/webui/url_fetcher_block_adapter.h" +#import "ios/web/webui/url_fetcher_block_adapter.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" namespace web {
diff --git a/ios/web/webui/crw_web_ui_page_builder.mm b/ios/web/webui/crw_web_ui_page_builder.mm index 39e499a6..08310290 100644 --- a/ios/web/webui/crw_web_ui_page_builder.mm +++ b/ios/web/webui/crw_web_ui_page_builder.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/webui/crw_web_ui_page_builder.h" +#import "ios/web/webui/crw_web_ui_page_builder.h" #include <map> #include <string> @@ -10,7 +10,7 @@ #include "base/logging.h" #include "base/mac/bundle_locations.h" -#include "base/mac/scoped_nsobject.h" +#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/web/webui/crw_web_ui_page_builder_unittest.mm b/ios/web/webui/crw_web_ui_page_builder_unittest.mm index 7d7968a..67c2932 100644 --- a/ios/web/webui/crw_web_ui_page_builder_unittest.mm +++ b/ios/web/webui/crw_web_ui_page_builder_unittest.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/webui/crw_web_ui_page_builder.h" +#import "ios/web/webui/crw_web_ui_page_builder.h" #import <Foundation/Foundation.h> @@ -10,7 +10,7 @@ #import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" #include "url/gurl.h"
diff --git a/ios/web/webui/mojo_facade.h b/ios/web/webui/mojo_facade.h index ce9ed754..1d6d487 100644 --- a/ios/web/webui/mojo_facade.h +++ b/ios/web/webui/mojo_facade.h
@@ -9,7 +9,7 @@ #include <string> #import "base/ios/weak_nsobject.h" -#import "mojo/public/cpp/system/watcher.h" +#include "mojo/public/cpp/system/watcher.h" @protocol CRWJSInjectionEvaluator;
diff --git a/ios/web/webui/mojo_facade.mm b/ios/web/webui/mojo_facade.mm index bdea3d3..780c846 100644 --- a/ios/web/webui/mojo_facade.mm +++ b/ios/web/webui/mojo_facade.mm
@@ -6,10 +6,10 @@ #import <Foundation/Foundation.h> -#include "base/ios/block_types.h" +#import "base/ios/block_types.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" -#include "base/mac/bind_objc_block.h" +#import "base/mac/bind_objc_block.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" #import "ios/web/public/web_state/js/crw_js_injection_evaluator.h"
diff --git a/ios/web/webui/mojo_facade_unittest.mm b/ios/web/webui/mojo_facade_unittest.mm index c7138d51..542124c 100644 --- a/ios/web/webui/mojo_facade_unittest.mm +++ b/ios/web/webui/mojo_facade_unittest.mm
@@ -9,7 +9,7 @@ #import "base/mac/scoped_nsobject.h" #include "base/strings/string_number_conversions.h" #include "base/strings/sys_string_conversions.h" -#include "base/test/ios/wait_util.h" +#import "base/test/ios/wait_util.h" #include "ios/web/public/test/web_test.h" #import "ios/web/public/web_state/js/crw_js_injection_evaluator.h" #include "ios/web/test/mojo_test.mojom.h"
diff --git a/ios/web/webui/shared_resources_data_source_ios.mm b/ios/web/webui/shared_resources_data_source_ios.mm index 4d9e78a..cc4dca0 100644 --- a/ios/web/webui/shared_resources_data_source_ios.mm +++ b/ios/web/webui/shared_resources_data_source_ios.mm
@@ -9,7 +9,7 @@ #include "base/logging.h" #include "base/memory/ref_counted_memory.h" #include "base/strings/string_util.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "net/base/mime_util.h" #include "ui/base/webui/web_ui_util.h" #include "ui/resources/grit/webui_resources.h"
diff --git a/ios/web/webui/url_data_manager_ios_backend.mm b/ios/web/webui/url_data_manager_ios_backend.mm index 9db7acd5..ee2c895 100644 --- a/ios/web/webui/url_data_manager_ios_backend.mm +++ b/ios/web/webui/url_data_manager_ios_backend.mm
@@ -22,7 +22,7 @@ #include "base/strings/stringprintf.h" #include "base/trace_event/trace_event.h" #include "ios/web/public/browser_state.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "ios/web/public/web_thread.h" #include "ios/web/webui/shared_resources_data_source_ios.h" #include "ios/web/webui/url_data_source_ios_impl.h"
diff --git a/ios/web/webui/url_data_source_ios.mm b/ios/web/webui/url_data_source_ios.mm index 2cad70a..537b143 100644 --- a/ios/web/webui/url_data_source_ios.mm +++ b/ios/web/webui/url_data_source_ios.mm
@@ -4,7 +4,7 @@ #include "ios/web/public/url_data_source_ios.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "ios/web/webui/url_data_manager_ios.h" #include "net/url_request/url_request.h"
diff --git a/ios/web/webui/url_fetcher_block_adapter.mm b/ios/web/webui/url_fetcher_block_adapter.mm index df7e1fa7..596b39db 100644 --- a/ios/web/webui/url_fetcher_block_adapter.mm +++ b/ios/web/webui/url_fetcher_block_adapter.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/webui/url_fetcher_block_adapter.h" +#import "ios/web/webui/url_fetcher_block_adapter.h" #include "base/logging.h" #include "net/url_request/url_fetcher.h"
diff --git a/ios/web/webui/url_fetcher_block_adapter_unittest.mm b/ios/web/webui/url_fetcher_block_adapter_unittest.mm index f7a8c833..87e28729 100644 --- a/ios/web/webui/url_fetcher_block_adapter_unittest.mm +++ b/ios/web/webui/url_fetcher_block_adapter_unittest.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/web/webui/url_fetcher_block_adapter.h" +#import "ios/web/webui/url_fetcher_block_adapter.h" #include <string> @@ -13,7 +13,7 @@ #include "net/url_request/test_url_fetcher_factory.h" #include "net/url_request/url_request_status.h" #include "net/url_request/url_request_test_util.h" -#include "testing/gtest_mac.h" +#import "testing/gtest_mac.h" #include "testing/platform_test.h" #include "url/gurl.h"
diff --git a/ios/web/webui/web_ui_ios_data_source_impl.mm b/ios/web/webui/web_ui_ios_data_source_impl.mm index efb9e793..b51e26f 100644 --- a/ios/web/webui/web_ui_ios_data_source_impl.mm +++ b/ios/web/webui/web_ui_ios_data_source_impl.mm
@@ -9,7 +9,7 @@ #include "base/bind.h" #include "base/memory/ref_counted_memory.h" #include "base/strings/string_util.h" -#include "ios/web/public/web_client.h" +#import "ios/web/public/web_client.h" #include "ui/base/webui/jstemplate_builder.h" #include "ui/base/webui/web_ui_util.h"
diff --git a/ios/web/webui/web_ui_ios_impl.mm b/ios/web/webui/web_ui_ios_impl.mm index 9123ed3..395b4ab0 100644 --- a/ios/web/webui/web_ui_ios_impl.mm +++ b/ios/web/webui/web_ui_ios_impl.mm
@@ -13,7 +13,7 @@ #include "ios/web/public/webui/web_ui_ios_controller.h" #include "ios/web/public/webui/web_ui_ios_controller_factory.h" #include "ios/web/public/webui/web_ui_ios_message_handler.h" -#include "ios/web/web_state/web_state_impl.h" +#import "ios/web/web_state/web_state_impl.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/media/gpu/android_video_encode_accelerator.cc b/media/gpu/android_video_encode_accelerator.cc index b16f933..2e8559dd 100644 --- a/media/gpu/android_video_encode_accelerator.cc +++ b/media/gpu/android_video_encode_accelerator.cc
@@ -47,9 +47,9 @@ do { \ if (!(result)) { \ DLOG(ERROR) << log; \ - if (client_ptr_factory_->GetWeakPtr()) { \ + if (!error_occurred_) { \ client_ptr_factory_->GetWeakPtr()->NotifyError(error); \ - client_ptr_factory_.reset(); \ + error_occurred_ = true; \ } \ return; \ } \ @@ -94,7 +94,7 @@ } AndroidVideoEncodeAccelerator::AndroidVideoEncodeAccelerator() - : num_buffers_at_codec_(0), last_set_bitrate_(0) {} + : num_buffers_at_codec_(0), last_set_bitrate_(0), error_occurred_(false) {} AndroidVideoEncodeAccelerator::~AndroidVideoEncodeAccelerator() { DCHECK(thread_checker_.CalledOnValidThread()); @@ -150,6 +150,7 @@ << ", initial_bitrate: " << initial_bitrate; DCHECK(!media_codec_); DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK(client); client_ptr_factory_.reset(new base::WeakPtrFactory<Client>(client)); @@ -301,7 +302,7 @@ } void AndroidVideoEncodeAccelerator::QueueInput() { - if (!client_ptr_factory_->GetWeakPtr() || pending_frames_.empty()) + if (error_occurred_ || pending_frames_.empty()) return; int input_buf_index = 0; @@ -368,8 +369,8 @@ } void AndroidVideoEncodeAccelerator::DequeueOutput() { - if (!client_ptr_factory_->GetWeakPtr() || - available_bitstream_buffers_.empty() || num_buffers_at_codec_ == 0) { + if (error_occurred_ || available_bitstream_buffers_.empty() || + num_buffers_at_codec_ == 0) { return; }
diff --git a/media/gpu/android_video_encode_accelerator.h b/media/gpu/android_video_encode_accelerator.h index ef1ec841..0617a663d 100644 --- a/media/gpu/android_video_encode_accelerator.h +++ b/media/gpu/android_video_encode_accelerator.h
@@ -104,6 +104,9 @@ uint32_t last_set_bitrate_; // In bps. + // True if there is encoder error. + bool error_occurred_; + DISALLOW_COPY_AND_ASSIGN(AndroidVideoEncodeAccelerator); };
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index 3b2ca28d..f408317 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc
@@ -72,6 +72,32 @@ // and does not consume "too much" memory. const int32_t kQuicSocketReceiveBufferSize = 1024 * 1024; // 1MB +namespace { + +// Keep all HTTP2 parameters in |http2_settings|, even the ones that are not +// implemented, to be sent to the server. +// Set default values for settings that |http2_settings| does not specify. +SettingsMap AddDefaultHttp2Settings(SettingsMap http2_settings) { + // Set default values only if |http2_settings| does not have + // a value set for given setting. + SettingsMap::iterator it = http2_settings.find(SETTINGS_HEADER_TABLE_SIZE); + if (it == http2_settings.end()) + http2_settings[SETTINGS_HEADER_TABLE_SIZE] = kSpdyMaxHeaderTableSize; + + it = http2_settings.find(SETTINGS_MAX_CONCURRENT_STREAMS); + if (it == http2_settings.end()) + http2_settings[SETTINGS_MAX_CONCURRENT_STREAMS] = + kSpdyMaxConcurrentPushedStreams; + + it = http2_settings.find(SETTINGS_INITIAL_WINDOW_SIZE); + if (it == http2_settings.end()) + http2_settings[SETTINGS_INITIAL_WINDOW_SIZE] = kSpdyStreamMaxRecvWindowSize; + + return http2_settings; +} + +} // unnamed namespace + HttpNetworkSession::Params::Params() : client_socket_factory(NULL), host_resolver(NULL), @@ -93,7 +119,6 @@ enable_spdy_ping_based_connection_checking(true), enable_http2(true), spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize), - spdy_stream_max_recv_window_size(kSpdyStreamMaxRecvWindowSize), time_func(&base::TimeTicks::Now), enable_http2_alternative_service_with_different_host(false), enable_quic_alternative_service_with_different_host(true), @@ -197,7 +222,7 @@ params.transport_security_state, params.enable_spdy_ping_based_connection_checking, params.spdy_session_max_recv_window_size, - params.spdy_stream_max_recv_window_size, + AddDefaultHttp2Settings(params.http2_settings), params.time_func, params.proxy_delegate), http_stream_factory_(new HttpStreamFactoryImpl(this, false)),
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index f1402bfa..4676fcf 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h
@@ -28,6 +28,7 @@ #include "net/http/http_stream_factory.h" #include "net/quic/chromium/quic_stream_factory.h" #include "net/socket/next_proto.h" +#include "net/spdy/spdy_protocol.h" #include "net/spdy/spdy_session_pool.h" #include "net/ssl/ssl_client_auth_cache.h" @@ -65,6 +66,12 @@ class TransportClientSocketPool; class TransportSecurityState; +// Specifies the maximum HPACK dynamic table size the server is allowed to set. +const uint32_t kSpdyMaxHeaderTableSize = 64 * 1024; + +// Specifies the maximum concurrent streams server could send (via push). +const uint32_t kSpdyMaxConcurrentPushedStreams = 1000; + // This class holds session objects used by HttpNetworkTransaction objects. class NET_EXPORT HttpNetworkSession : NON_EXPORTED_BASE(public base::NonThreadSafe), @@ -98,7 +105,9 @@ bool enable_spdy_ping_based_connection_checking; bool enable_http2; size_t spdy_session_max_recv_window_size; - size_t spdy_stream_max_recv_window_size; + // HTTP/2 connection settings. + // Unknown settings will still be sent to the server. + SettingsMap http2_settings; // Source of time for SPDY connections. SpdySessionPool::TimeFunc time_func; // Whether to enable HTTP/2 Alt-Svc entries with hostname different than
diff --git a/net/http2/decoder/http2_frame_decoder_test.cc b/net/http2/decoder/http2_frame_decoder_test.cc index c2ec0a0d..ee1e9e49 100644 --- a/net/http2/decoder/http2_frame_decoder_test.cc +++ b/net/http2/decoder/http2_frame_decoder_test.cc
@@ -6,6 +6,7 @@ // Tests of Http2FrameDecoder. +#include <memory> #include <string> #include <vector>
diff --git a/net/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc b/net/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc index 313a457..bcf1f356 100644 --- a/net/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc +++ b/net/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
@@ -6,7 +6,6 @@ // Tests of HpackDecoderStringBuffer. -#include <initializer_list> #include <sstream> #include <string>
diff --git a/net/net.gypi b/net/net.gypi index a5fd9f0..c83e8eb 100644 --- a/net/net.gypi +++ b/net/net.gypi
@@ -1212,6 +1212,7 @@ 'quic/platform/api/quic_ip_address_family.h', 'quic/platform/api/quic_ip_address.cc', 'quic/platform/api/quic_ip_address.h', + 'quic/platform/api/quic_lru_cache.h', 'quic/platform/api/quic_mutex.cc', 'quic/platform/api/quic_mutex.h', 'quic/platform/api/quic_reference_counted.h', @@ -1224,6 +1225,7 @@ 'quic/platform/impl/quic_export_impl.h', 'quic/platform/impl/quic_ip_address_impl.cc', 'quic/platform/impl/quic_ip_address_impl.h', + 'quic/platform/impl/quic_lru_cache_impl.h', 'quic/platform/impl/quic_mutex_impl.cc', 'quic/platform/impl/quic_mutex_impl.h', 'quic/platform/impl/quic_reference_counted_impl.h', @@ -1963,6 +1965,7 @@ 'quic/core/quic_versions_test.cc', 'quic/core/quic_write_blocked_list_test.cc', 'quic/core/spdy_utils_test.cc', + 'quic/platform/api/quic_lru_cache_test.cc', 'quic/platform/api/quic_reference_counted_test.cc', 'quic/platform/api/quic_str_cat_test.cc', 'quic/platform/impl/quic_chromium_clock_test.cc',
diff --git a/net/quic/core/crypto/quic_compressed_certs_cache.cc b/net/quic/core/crypto/quic_compressed_certs_cache.cc index 7bcddc4..c9ba5301 100644 --- a/net/quic/core/crypto/quic_compressed_certs_cache.cc +++ b/net/quic/core/crypto/quic_compressed_certs_cache.cc
@@ -76,13 +76,10 @@ uint64_t key = ComputeUncompressedCertsHash(uncompressed_certs); - auto cached_it = certs_cache_.Get(key); - - if (cached_it != certs_cache_.end()) { - const CachedCerts& cached_value = cached_it->second; - if (cached_value.MatchesUncompressedCerts(uncompressed_certs)) { - return cached_value.compressed_cert(); - } + CachedCerts* cached_value = certs_cache_.Lookup(key); + if (cached_value != nullptr && + cached_value->MatchesUncompressedCerts(uncompressed_certs)) { + return cached_value->compressed_cert(); } return nullptr; } @@ -98,15 +95,17 @@ uint64_t key = ComputeUncompressedCertsHash(uncompressed_certs); // Insert one unit to the cache. - certs_cache_.Put(key, CachedCerts(uncompressed_certs, compressed_cert)); + std::unique_ptr<CachedCerts> cached_certs( + new CachedCerts(uncompressed_certs, compressed_cert)); + certs_cache_.Insert(key, std::move(cached_certs)); } size_t QuicCompressedCertsCache::MaxSize() { - return certs_cache_.max_size(); + return certs_cache_.MaxSize(); } size_t QuicCompressedCertsCache::Size() { - return certs_cache_.size(); + return certs_cache_.Size(); } uint64_t QuicCompressedCertsCache::ComputeUncompressedCertsHash(
diff --git a/net/quic/core/crypto/quic_compressed_certs_cache.h b/net/quic/core/crypto/quic_compressed_certs_cache.h index cb1daa8e..ce480e35 100644 --- a/net/quic/core/crypto/quic_compressed_certs_cache.h +++ b/net/quic/core/crypto/quic_compressed_certs_cache.h
@@ -8,9 +8,9 @@ #include <string> #include <vector> -#include "base/containers/mru_cache.h" #include "net/quic/core/crypto/proof_source.h" #include "net/quic/platform/api/quic_export.h" +#include "net/quic/platform/api/quic_lru_cache.h" namespace net { @@ -100,7 +100,7 @@ // Key is a unit64_t hash for UncompressedCerts. Stored associated value is // CachedCerts which has both original uncompressed certs data and the // compressed representation of the certs. - base::MRUCache<uint64_t, CachedCerts> certs_cache_; + QuicLRUCache<uint64_t, CachedCerts> certs_cache_; }; } // namespace net
diff --git a/net/quic/platform/api/quic_lru_cache.h b/net/quic/platform/api/quic_lru_cache.h new file mode 100644 index 0000000..b7a06233 --- /dev/null +++ b/net/quic/platform/api/quic_lru_cache.h
@@ -0,0 +1,52 @@ +// Copyright (c) 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_QUIC_PLATFORM_API_QUIC_LRU_CACHE_H_ +#define NET_QUIC_PLATFORM_API_QUIC_LRU_CACHE_H_ + +#include <memory> + +#include "net/quic/platform/impl/quic_lru_cache_impl.h" + +namespace net { + +// A LRU cache that maps from type Key to Value* in QUIC. +// This cache CANNOT be shared by multiple threads (even with locks) because +// Value* returned by Lookup() can be invalid if the entry is evicted by other +// threads. +template <class K, class V> +class QuicLRUCache { + public: + explicit QuicLRUCache(int64_t total_units) : impl_(total_units) {} + + // Inserts one unit of |key|, |value| pair to the cache. Cache takes ownership + // of inserted |value|. + void Insert(const K& key, std::unique_ptr<V> value) { + impl_.Insert(key, std::move(value)); + } + + // If cache contains an entry for |key|, return a pointer to it. This returned + // value is guaranteed to be valid until Insert or Clear. + // Else return nullptr. + V* Lookup(const K& key) { return impl_.Lookup(key); } + + // Removes all entries from the cache. This method MUST be called before + // destruction. + void Clear() { impl_.Clear(); } + + // Returns maximum size of the cache. + int64_t MaxSize() const { return impl_.MaxSize(); } + + // Returns current size of the cache. + int64_t Size() const { return impl_.Size(); } + + private: + QuicLRUCacheImpl<K, V> impl_; + + DISALLOW_COPY_AND_ASSIGN(QuicLRUCache); +}; + +} // namespace net + +#endif // NET_QUIC_PLATFORM_API_QUIC_LRU_CACHE_H_
diff --git a/net/quic/platform/api/quic_lru_cache_test.cc b/net/quic/platform/api/quic_lru_cache_test.cc new file mode 100644 index 0000000..77b6bac --- /dev/null +++ b/net/quic/platform/api/quic_lru_cache_test.cc
@@ -0,0 +1,76 @@ +// Copyright (c) 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/quic/platform/api/quic_lru_cache.h" + +#include "testing/gtest/include/gtest/gtest.h" + +namespace net { +namespace test { +namespace { + +struct CachedItem { + explicit CachedItem(uint32_t new_value) : value(new_value) {} + + uint32_t value; +}; + +TEST(QuicLRUCacheTest, InsertAndLookup) { + QuicLRUCache<int, CachedItem> cache(5); + EXPECT_EQ(nullptr, cache.Lookup(1)); + EXPECT_EQ(0u, cache.Size()); + EXPECT_EQ(5u, cache.MaxSize()); + + // Check that item 1 was properly inserted. + std::unique_ptr<CachedItem> item1(new CachedItem(11)); + cache.Insert(1, std::move(item1)); + EXPECT_EQ(1u, cache.Size()); + EXPECT_EQ(11u, cache.Lookup(1)->value); + + // Check that item 2 overrides item 1. + std::unique_ptr<CachedItem> item2(new CachedItem(12)); + cache.Insert(1, std::move(item2)); + EXPECT_EQ(1u, cache.Size()); + EXPECT_EQ(12u, cache.Lookup(1)->value); + + std::unique_ptr<CachedItem> item3(new CachedItem(13)); + cache.Insert(3, std::move(item3)); + EXPECT_EQ(2u, cache.Size()); + EXPECT_EQ(13u, cache.Lookup(3)->value); + + // No memory leakage. + cache.Clear(); + EXPECT_EQ(0u, cache.Size()); +} + +TEST(QuicLRUCacheTest, Eviction) { + QuicLRUCache<int, CachedItem> cache(3); + + for (size_t i = 1; i <= 4; ++i) { + std::unique_ptr<CachedItem> item(new CachedItem(10 + i)); + cache.Insert(i, std::move(item)); + } + + EXPECT_EQ(3u, cache.Size()); + EXPECT_EQ(3u, cache.MaxSize()); + + // Make sure item 1 is evicted. + EXPECT_EQ(nullptr, cache.Lookup(1)); + EXPECT_EQ(14u, cache.Lookup(4)->value); + + EXPECT_EQ(12u, cache.Lookup(2)->value); + std::unique_ptr<CachedItem> item5(new CachedItem(15)); + cache.Insert(5, std::move(item5)); + // Make sure item 3 is evicted. + EXPECT_EQ(nullptr, cache.Lookup(3)); + EXPECT_EQ(15u, cache.Lookup(5)->value); + + // No memory leakage. + cache.Clear(); + EXPECT_EQ(0u, cache.Size()); +} + +} // namespace +} // namespace test +} // namespace net
diff --git a/net/quic/platform/impl/quic_lru_cache_impl.h b/net/quic/platform/impl/quic_lru_cache_impl.h new file mode 100644 index 0000000..18f33719 --- /dev/null +++ b/net/quic/platform/impl/quic_lru_cache_impl.h
@@ -0,0 +1,50 @@ +// Copyright (c) 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_QUIC_PLATFORM_IMPL_QUIC_LRU_CACHE_IMPL_H_ +#define NET_QUIC_PLATFORM_IMPL_QUIC_LRU_CACHE_IMPL_H_ + +#include "base/containers/mru_cache.h" + +namespace net { + +template <class K, class V> +class QuicLRUCacheImpl { + public: + explicit QuicLRUCacheImpl(int64_t total_units) : mru_cache_(total_units) {} + + // Inserts one unit of |key|, |value| pair to the cache. + void Insert(const K& key, std::unique_ptr<V> value) { + mru_cache_.Put(key, std::move(value)); + } + + // If cache contains an entry for |key|, return a pointer to it. This returned + // value is guaranteed to be valid until Insert or Clear. + // Else return nullptr. + V* Lookup(const K& key) { + auto cached_it = mru_cache_.Get(key); + if (cached_it != mru_cache_.end()) { + return cached_it->second.get(); + } + return nullptr; + } + + // Removes all entries from the cache. + void Clear() { mru_cache_.Clear(); } + + // Returns maximum size of the cache. + int64_t MaxSize() const { return mru_cache_.max_size(); } + + // Returns current size of the cache. + int64_t Size() const { return mru_cache_.size(); } + + private: + base::MRUCache<K, std::unique_ptr<V>> mru_cache_; + + DISALLOW_COPY_AND_ASSIGN(QuicLRUCacheImpl); +}; + +} // namespace net + +#endif // NET_QUIC_PLATFORM_IMPL_QUIC_LRU_CACHE_IMPL_H_
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index adae8ec..c7a3c2b4 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -26,6 +26,7 @@ #include "net/base/upload_bytes_element_reader.h" #include "net/base/upload_file_element_reader.h" #include "net/http/http_auth_scheme.h" +#include "net/http/http_network_session.h" #include "net/http/http_network_session_peer.h" #include "net/http/http_network_transaction.h" #include "net/http/http_server_properties.h" @@ -5317,9 +5318,9 @@ stream_max_recv_window_size / 2 + kChunkSize; SettingsMap initial_settings; - initial_settings[SETTINGS_HEADER_TABLE_SIZE] = kMaxHeaderTableSize; + initial_settings[SETTINGS_HEADER_TABLE_SIZE] = kSpdyMaxHeaderTableSize; initial_settings[SETTINGS_MAX_CONCURRENT_STREAMS] = - kMaxConcurrentPushedStreams; + kSpdyMaxConcurrentPushedStreams; initial_settings[SETTINGS_INITIAL_WINDOW_SIZE] = stream_max_recv_window_size; SpdySerializedFrame initial_settings_frame( spdy_util_.ConstructSpdySettings(initial_settings)); @@ -5369,7 +5370,8 @@ auto session_deps = base::MakeUnique<SpdySessionDependencies>(); session_deps->session_max_recv_window_size = session_max_recv_window_size; - session_deps->stream_max_recv_window_size = stream_max_recv_window_size; + session_deps->http2_settings[SETTINGS_INITIAL_WINDOW_SIZE] = + stream_max_recv_window_size; NormalSpdyTransactionHelper helper(CreateGetRequest(), DEFAULT_PRIORITY, NetLogWithSource(),
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 1fd6283..9ad1cb3e 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc
@@ -69,6 +69,35 @@ // Minimum seconds that unclaimed pushed streams will be kept in memory. const int kMinPushedStreamLifetimeSeconds = 300; +// Default initial value for HTTP/2 SETTINGS. +const uint32_t kDefaultInitialHeaderTableSize = 4096; +const uint32_t kDefaultInitialEnablePush = 1; +const uint32_t kDefaultInitialInitialWindowSize = 65535; +const uint32_t kDefaultInitialMaxFrameSize = 16384; + +bool IsSpdySettingAtDefaultInitialValue(SpdySettingsIds setting_id, + uint32_t value) { + switch (setting_id) { + case SETTINGS_HEADER_TABLE_SIZE: + return value == kDefaultInitialHeaderTableSize; + case SETTINGS_ENABLE_PUSH: + return value == kDefaultInitialEnablePush; + case SETTINGS_MAX_CONCURRENT_STREAMS: + // There is no initial limit on the number of concurrent streams. + return false; + case SETTINGS_INITIAL_WINDOW_SIZE: + return value == kDefaultInitialInitialWindowSize; + case SETTINGS_MAX_FRAME_SIZE: + return value == kDefaultInitialMaxFrameSize; + case SETTINGS_MAX_HEADER_LIST_SIZE: + // There is no initial limit on the size of the header list. + return false; + default: + // Undefined parameters have no initial value. + return false; + } +} + std::unique_ptr<base::Value> NetLogSpdyHeadersSentCallback( const SpdyHeaderBlock* headers, bool fin, @@ -655,7 +684,7 @@ bool enable_sending_initial_data, bool enable_ping_based_connection_checking, size_t session_max_recv_window_size, - size_t stream_max_recv_window_size, + const SettingsMap& initial_settings, TimeFunc time_func, ServerPushDelegate* push_delegate, ProxyDelegate* proxy_delegate, @@ -681,8 +710,10 @@ read_state_(READ_STATE_DO_READ), write_state_(WRITE_STATE_IDLE), error_on_close_(OK), + initial_settings_(initial_settings), max_concurrent_streams_(kInitialMaxConcurrentStreams), - max_concurrent_pushed_streams_(kMaxConcurrentPushedStreams), + max_concurrent_pushed_streams_( + initial_settings.at(SETTINGS_MAX_CONCURRENT_STREAMS)), streams_initiated_count_(0), streams_pushed_count_(0), streams_pushed_and_claimed_count_(0), @@ -697,7 +728,9 @@ session_recv_window_size_(0), session_unacked_recv_window_bytes_(0), stream_initial_send_window_size_(kDefaultInitialWindowSize), - stream_max_recv_window_size_(stream_max_recv_window_size), + max_header_table_size_(initial_settings.at(SETTINGS_HEADER_TABLE_SIZE)), + stream_max_recv_window_size_( + initial_settings.at(SETTINGS_INITIAL_WINDOW_SIZE)), net_log_( NetLogWithSource::Make(net_log, NetLogSourceType::HTTP2_SESSION)), enable_sending_initial_data_(enable_sending_initial_data), @@ -714,6 +747,11 @@ base::Bind(&NetLogSpdySessionCallback, &host_port_proxy_pair())); next_unclaimed_push_stream_sweep_time_ = time_func_() + base::TimeDelta::FromSeconds(kMinPushedStreamLifetimeSeconds); + + DCHECK(base::ContainsKey(initial_settings_, SETTINGS_HEADER_TABLE_SIZE)); + DCHECK(base::ContainsKey(initial_settings_, SETTINGS_MAX_CONCURRENT_STREAMS)); + DCHECK(base::ContainsKey(initial_settings_, SETTINGS_INITIAL_WINDOW_SIZE)); + // TODO(mbelshe): consider randomization of the stream_hi_water_mark. } @@ -755,7 +793,7 @@ buffered_spdy_framer_.reset(new BufferedSpdyFramer()); buffered_spdy_framer_->set_visitor(this); buffered_spdy_framer_->set_debug_visitor(this); - buffered_spdy_framer_->UpdateHeaderDecoderTableSize(kMaxHeaderTableSize); + buffered_spdy_framer_->UpdateHeaderDecoderTableSize(max_header_table_size_); net_log_.AddEvent(NetLogEventType::HTTP2_SESSION_INITIALIZED, base::Bind(&NetLogSpdyInitializedCallback, @@ -2646,12 +2684,13 @@ std::move(connection_header_prefix_frame)); // First, notify the server about the settings they should use when - // communicating with us. + // communicating with us. Only send settings that have a value different from + // the protocol default value. SettingsMap settings_map; - settings_map[SETTINGS_HEADER_TABLE_SIZE] = kMaxHeaderTableSize; - settings_map[SETTINGS_MAX_CONCURRENT_STREAMS] = kMaxConcurrentPushedStreams; - if (stream_max_recv_window_size_ != kDefaultInitialWindowSize) { - settings_map[SETTINGS_INITIAL_WINDOW_SIZE] = stream_max_recv_window_size_; + for (auto setting : initial_settings_) { + if (!IsSpdySettingAtDefaultInitialValue(setting.first, setting.second)) { + settings_map.insert(setting); + } } SendSettings(settings_map);
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index aef7606..61f2a9d1 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h
@@ -75,12 +75,6 @@ // sends a SETTINGS frame with a different value. const size_t kInitialMaxConcurrentStreams = 100; -// Specifies the maximum HPACK dynamic table size the server is allowed to set. -const int kMaxHeaderTableSize = 64 * 1024; - -// Specifies the maximum concurrent streams server could send (via push). -const int kMaxConcurrentPushedStreams = 1000; - // If more than this many bytes have been read or more than that many // milliseconds have passed, return ERR_IO_PENDING from ReadLoop. const int kYieldAfterBytesRead = 32 * 1024; @@ -307,7 +301,7 @@ bool enable_sending_initial_data, bool enable_ping_based_connection_checking, size_t session_max_recv_window_size, - size_t stream_max_recv_window_size, + const SettingsMap& initial_settings, TimeFunc time_func, ServerPushDelegate* push_delegate, ProxyDelegate* proxy_delegate, @@ -1094,6 +1088,12 @@ // Initialized to OK. Error error_on_close_; + // Settings that are sent in the initial SETTINGS frame + // (if |enable_sending_initial_data_| is true), + // and also control SpdySession parameters like initial receive window size + // and maximum HPACK dynamic table size. + const SettingsMap initial_settings_; + // Limits size_t max_concurrent_streams_; size_t max_concurrent_pushed_streams_; @@ -1151,6 +1151,9 @@ // this value for the initial send window size. int32_t stream_initial_send_window_size_; + // The maximum HPACK dynamic table size the server is allowed to set. + uint32_t max_header_table_size_; + // Initial receive window size for this session's streams. There are // plans to add a command line switch that would cause a SETTINGS // frame with window size announcement to be sent on startup. Newly
diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc index 919a8d6..904edae9 100644 --- a/net/spdy/spdy_session_pool.cc +++ b/net/spdy/spdy_session_pool.cc
@@ -45,7 +45,7 @@ TransportSecurityState* transport_security_state, bool enable_ping_based_connection_checking, size_t session_max_recv_window_size, - size_t stream_max_recv_window_size, + const SettingsMap& initial_settings, SpdySessionPool::TimeFunc time_func, ProxyDelegate* proxy_delegate) : http_server_properties_(http_server_properties), @@ -56,7 +56,7 @@ enable_ping_based_connection_checking_( enable_ping_based_connection_checking), session_max_recv_window_size_(session_max_recv_window_size), - stream_max_recv_window_size_(stream_max_recv_window_size), + initial_settings_(initial_settings), time_func_(time_func), push_delegate_(nullptr), proxy_delegate_(proxy_delegate) { @@ -92,11 +92,11 @@ UMA_HISTOGRAM_ENUMERATION( "Net.SpdySessionGet", IMPORTED_FROM_SOCKET, SPDY_SESSION_GET_MAX); - std::unique_ptr<SpdySession> new_session(new SpdySession( + auto new_session = base::MakeUnique<SpdySession>( key, http_server_properties_, transport_security_state_, enable_sending_initial_data_, enable_ping_based_connection_checking_, - session_max_recv_window_size_, stream_max_recv_window_size_, time_func_, - push_delegate_, proxy_delegate_, net_log.net_log())); + session_max_recv_window_size_, initial_settings_, time_func_, + push_delegate_, proxy_delegate_, net_log.net_log()); new_session->InitializeWithSocket(std::move(connection), this, is_secure);
diff --git a/net/spdy/spdy_session_pool.h b/net/spdy/spdy_session_pool.h index 940cde6..661501f1 100644 --- a/net/spdy/spdy_session_pool.h +++ b/net/spdy/spdy_session_pool.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include <map> +#include <memory> #include <set> #include <string> #include <vector> @@ -24,6 +25,7 @@ #include "net/proxy/proxy_config.h" #include "net/proxy/proxy_server.h" #include "net/spdy/server_push_delegate.h" +#include "net/spdy/spdy_protocol.h" #include "net/spdy/spdy_session_key.h" #include "net/ssl/ssl_config_service.h" @@ -57,7 +59,7 @@ TransportSecurityState* transport_security_state, bool enable_ping_based_connection_checking, size_t session_max_recv_window_size, - size_t stream_max_recv_window_size, + const SettingsMap& initial_settings, SpdySessionPool::TimeFunc time_func, ProxyDelegate* proxy_delegate); ~SpdySessionPool() override; @@ -228,8 +230,15 @@ // Defaults to true. May be controlled via SpdySessionPoolPeer for tests. bool enable_sending_initial_data_; bool enable_ping_based_connection_checking_; + size_t session_max_recv_window_size_; - size_t stream_max_recv_window_size_; + + // Settings that are sent in the initial SETTINGS frame + // (if |enable_sending_initial_data_| is true), + // and also control SpdySession parameters like initial receive window size + // and maximum HPACK dynamic table size. + const SettingsMap initial_settings_; + TimeFunc time_func_; ServerPushDelegate* push_delegate_;
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc index 12b8c01c..4d10961f 100644 --- a/net/spdy/spdy_session_unittest.cc +++ b/net/spdy/spdy_session_unittest.cc
@@ -1881,39 +1881,6 @@ base::RunLoop().RunUntilIdle(); } -TEST_F(SpdySessionTest, SendInitialDataOnNewSession) { - session_deps_.host_resolver->set_synchronous_mode(true); - - MockRead reads[] = { - MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever. - }; - - SettingsMap settings; - settings[SETTINGS_HEADER_TABLE_SIZE] = kMaxHeaderTableSize; - settings[SETTINGS_MAX_CONCURRENT_STREAMS] = kMaxConcurrentPushedStreams; - SpdySerializedFrame settings_frame( - spdy_util_.ConstructSpdySettings(settings)); - MockWrite writes[] = {MockWrite(ASYNC, kHttp2ConnectionHeaderPrefix, - kHttp2ConnectionHeaderPrefixSize), - CreateMockWrite(settings_frame)}; - - StaticSocketDataProvider data(reads, arraysize(reads), writes, - arraysize(writes)); - session_deps_.socket_factory->AddSocketDataProvider(&data); - - AddSSLSocketData(); - - CreateNetworkSession(); - - SpdySessionPoolPeer pool_peer(spdy_session_pool_); - pool_peer.SetEnableSendingInitialData(true); - - CreateSecureSpdySession(); - - base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(data.AllWriteDataConsumed()); -} - TEST_F(SpdySessionTest, Initialize) { session_deps_.host_resolver->set_synchronous_mode(true); @@ -3887,7 +3854,8 @@ AddSSLSocketData(); - session_deps_.stream_max_recv_window_size = stream_max_recv_window_size; + session_deps_.http2_settings[SETTINGS_INITIAL_WINDOW_SIZE] = + stream_max_recv_window_size; CreateNetworkSession(); CreateSecureSpdySession(); @@ -4024,7 +3992,8 @@ AddSSLSocketData(); - session_deps_.stream_max_recv_window_size = stream_max_recv_window_size; + session_deps_.http2_settings[SETTINGS_INITIAL_WINDOW_SIZE] = + stream_max_recv_window_size; CreateNetworkSession(); CreateSecureSpdySession(); @@ -5391,6 +5360,92 @@ EXPECT_FALSE(session_->OnUnknownFrame(8, 0)); } +class SendInitialSettingsOnNewSpdySessionTest : public SpdySessionTest { + protected: + void RunInitialSettingsTest(const SettingsMap expected_settings) { + session_deps_.host_resolver->set_synchronous_mode(true); + + MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING)}; + + SpdySerializedFrame settings_frame( + spdy_util_.ConstructSpdySettings(expected_settings)); + MockWrite writes[] = {MockWrite(ASYNC, kHttp2ConnectionHeaderPrefix, + kHttp2ConnectionHeaderPrefixSize), + CreateMockWrite(settings_frame)}; + + StaticSocketDataProvider data(reads, arraysize(reads), writes, + arraysize(writes)); + session_deps_.socket_factory->AddSocketDataProvider(&data); + AddSSLSocketData(); + + CreateNetworkSession(); + + SpdySessionPoolPeer pool_peer(spdy_session_pool_); + pool_peer.SetEnableSendingInitialData(true); + + CreateSecureSpdySession(); + + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(data.AllWriteDataConsumed()); + } +}; + +// Setting values when Params::http2_settings is empty. Note that +// SETTINGS_INITIAL_WINDOW_SIZE is sent in production, because it is set to a +// non-default value, but it is not sent in tests, because the protocol default +// value is used in tests. +TEST_F(SendInitialSettingsOnNewSpdySessionTest, Empty) { + SettingsMap expected_settings; + expected_settings[SETTINGS_HEADER_TABLE_SIZE] = kSpdyMaxHeaderTableSize; + expected_settings[SETTINGS_MAX_CONCURRENT_STREAMS] = + kSpdyMaxConcurrentPushedStreams; + RunInitialSettingsTest(expected_settings); +} + +// When a setting is set to the protocol default value, +// no corresponding value is sent on the wire. +TEST_F(SendInitialSettingsOnNewSpdySessionTest, ProtocolDefault) { + // Explicitly set protocol default values for the following settings. + session_deps_.http2_settings[SETTINGS_HEADER_TABLE_SIZE] = 4096; + session_deps_.http2_settings[SETTINGS_ENABLE_PUSH] = 1; + session_deps_.http2_settings[SETTINGS_INITIAL_WINDOW_SIZE] = 64 * 1024 - 1; + + SettingsMap expected_settings; + expected_settings[SETTINGS_MAX_CONCURRENT_STREAMS] = + kSpdyMaxConcurrentPushedStreams; + RunInitialSettingsTest(expected_settings); +} + +// Values set in Params::http2_settings overwrite Chromium's default values. +TEST_F(SendInitialSettingsOnNewSpdySessionTest, OverwriteValues) { + session_deps_.http2_settings[SETTINGS_HEADER_TABLE_SIZE] = 16 * 1024; + session_deps_.http2_settings[SETTINGS_ENABLE_PUSH] = 0; + session_deps_.http2_settings[SETTINGS_MAX_CONCURRENT_STREAMS] = 42; + session_deps_.http2_settings[SETTINGS_INITIAL_WINDOW_SIZE] = 32 * 1024; + + SettingsMap expected_settings; + expected_settings[SETTINGS_HEADER_TABLE_SIZE] = 16 * 1024; + expected_settings[SETTINGS_ENABLE_PUSH] = 0; + expected_settings[SETTINGS_MAX_CONCURRENT_STREAMS] = 42; + expected_settings[SETTINGS_INITIAL_WINDOW_SIZE] = 32 * 1024; + RunInitialSettingsTest(expected_settings); +} + +// Unknown parameters should still be sent to the server. +TEST_F(SendInitialSettingsOnNewSpdySessionTest, UnknownSettings) { + // The following parameters are not defined in the HTTP/2 specification. + session_deps_.http2_settings[static_cast<SpdySettingsIds>(7)] = 1234; + session_deps_.http2_settings[static_cast<SpdySettingsIds>(25)] = 5678; + + SettingsMap expected_settings; + expected_settings[SETTINGS_HEADER_TABLE_SIZE] = kSpdyMaxHeaderTableSize; + expected_settings[SETTINGS_MAX_CONCURRENT_STREAMS] = + kSpdyMaxConcurrentPushedStreams; + expected_settings[static_cast<SpdySettingsIds>(7)] = 1234; + expected_settings[static_cast<SpdySettingsIds>(25)] = 5678; + RunInitialSettingsTest(expected_settings); +} + class AltSvcFrameTest : public SpdySessionTest { public: AltSvcFrameTest()
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc index 754f447e..ec69ba4 100644 --- a/net/spdy/spdy_test_util_common.cc +++ b/net/spdy/spdy_test_util_common.cc
@@ -343,7 +343,6 @@ enable_user_alternate_protocol_ports(false), enable_quic(false), session_max_recv_window_size(kDefaultInitialWindowSize), - stream_max_recv_window_size(kDefaultInitialWindowSize), time_func(&base::TimeTicks::Now), enable_http2_alternative_service_with_different_host(false), net_log(nullptr), @@ -355,6 +354,7 @@ // lookups allows the test to shutdown cleanly. Until we have // cancellable TCPConnectJobs, use synchronous lookups. host_resolver->set_synchronous_mode(true); + http2_settings[SETTINGS_INITIAL_WINDOW_SIZE] = kDefaultInitialWindowSize; } SpdySessionDependencies::~SpdySessionDependencies() {} @@ -394,8 +394,7 @@ params.enable_quic = session_deps->enable_quic; params.spdy_session_max_recv_window_size = session_deps->session_max_recv_window_size; - params.spdy_stream_max_recv_window_size = - session_deps->stream_max_recv_window_size; + params.http2_settings = session_deps->http2_settings; params.time_func = session_deps->time_func; params.proxy_delegate = session_deps->proxy_delegate.get(); params.enable_http2_alternative_service_with_different_host =
diff --git a/net/spdy/spdy_test_util_common.h b/net/spdy/spdy_test_util_common.h index d95d468..8f5dafb 100644 --- a/net/spdy/spdy_test_util_common.h +++ b/net/spdy/spdy_test_util_common.h
@@ -8,6 +8,7 @@ #include <stddef.h> #include <stdint.h> +#include <map> #include <memory> #include <string> #include <vector> @@ -201,7 +202,7 @@ bool enable_user_alternate_protocol_ports; bool enable_quic; size_t session_max_recv_window_size; - size_t stream_max_recv_window_size; + SettingsMap http2_settings; SpdySession::TimeFunc time_func; std::unique_ptr<ProxyDelegate> proxy_delegate; bool enable_http2_alternative_service_with_different_host;
diff --git a/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-reload-expected.txt b/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-reload-expected.txt index 2365adef..9b2d845c 100644 --- a/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-reload-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-reload-expected.txt
@@ -3,10 +3,12 @@ CONSOLE WARNING: line 47: A Parser-blocking, cross-origin script, http://localhost:8000/loading/resources/js-loaded.js?reload, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/feature/5718547946799104 for more details. CONSOLE WARNING: line 47: A Parser-blocking, cross-origin script, http://localhost:8000/loading/resources/js-loaded.js?reload, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/feature/5718547946799104 for more details. main frame - didStartProvisionalLoadForFrame +main frame - didFailLoadWithError main frame - didCommitLoadForFrame CONSOLE WARNING: line 47: A Parser-blocking, cross-origin script, http://localhost:8000/loading/resources/js-loaded.js?reload, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/feature/5718547946799104 for more details. CONSOLE WARNING: line 47: A Parser-blocking, cross-origin script, http://localhost:8000/loading/resources/js-loaded.js?reload, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/feature/5718547946799104 for more details. main frame - didStartProvisionalLoadForFrame +main frame - didFailLoadWithError main frame - didCommitLoadForFrame CONSOLE WARNING: line 47: A Parser-blocking, cross-origin script, http://localhost:8000/loading/resources/js-loaded.js?reload, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/feature/5718547946799104 for more details. CONSOLE WARNING: line 47: A Parser-blocking, cross-origin script, http://localhost:8000/loading/resources/js-loaded.js?reload, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/feature/5718547946799104 for more details.
diff --git a/third_party/WebKit/Source/core/html/HTMLAttributeNames.in b/third_party/WebKit/Source/core/html/HTMLAttributeNames.in index 50d07db..697bfa5 100644 --- a/third_party/WebKit/Source/core/html/HTMLAttributeNames.in +++ b/third_party/WebKit/Source/core/html/HTMLAttributeNames.in
@@ -20,6 +20,9 @@ aria-autocomplete aria-busy aria-checked +aria-colcount +aria-colindex +aria-colspan aria-controls aria-current aria-describedby @@ -47,6 +50,9 @@ aria-readonly aria-relevant aria-required +aria-rowcount +aria-rowindex +aria-rowspan aria-selected aria-setsize aria-sort
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp index fb1e5ea..7328e49 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -132,6 +132,7 @@ DCHECK(!m_frame); DCHECK(!m_mainResource); DCHECK(!m_applicationCacheHost); + DCHECK_EQ(m_state, SentDidFinishLoad); } DEFINE_TRACE(DocumentLoader) { @@ -285,7 +286,6 @@ if (m_applicationCacheHost) m_applicationCacheHost->failedLoadingMainResource(); - m_state = MainResourceDone; if (m_mainResource->resourceError().wasBlockedByResponse()) { InspectorInstrumentation::canceledAfterReceivedResourceResponse( @@ -326,8 +326,6 @@ m_applicationCacheHost->finishedLoadingMainResource(); endWriting(); - if (m_state < MainResourceDone) - m_state = MainResourceDone; clearMainResourceHandle(); // Shows the deprecation message and measures the impact of the new security @@ -551,7 +549,7 @@ } void DocumentLoader::commitData(const char* bytes, size_t length) { - DCHECK_LT(m_state, MainResourceDone); + DCHECK_EQ(m_state, Committed); ensureWriter(m_response.mimeType()); // This can happen if document.close() is called by an event handler while @@ -633,6 +631,9 @@ // frame have any loads active, so go ahead and kill all the loads. m_fetcher->stopFetching(); + if (frameLoader() && !sentDidFinishLoad()) + frameLoader()->loadFailed(this, ResourceError::cancelledError(url())); + // If that load cancellation triggered another detach, leave. // (fast/frames/detach-frame-nested-no-crash.html is an example of this.) if (!m_frame)
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.h b/third_party/WebKit/Source/core/loader/DocumentLoader.h index 4ab1e23..9a4acde 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.h +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.h
@@ -271,7 +271,6 @@ NotStarted, Provisional, Committed, - MainResourceDone, SentDidFinishLoad }; State m_state;
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp index 1840b62..dd6319fd 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -87,25 +87,16 @@ void SetUp() override { dummyPageHolder = DummyPageHolder::create(IntSize(500, 500)); dummyPageHolder->page().setDeviceScaleFactor(1.0); - documentLoader = DocumentLoader::create( - &dummyPageHolder->frame(), ResourceRequest("http://www.example.com"), - SubstituteData(), ClientRedirectPolicy::NotClientRedirect); document = &dummyPageHolder->document(); fetchContext = - static_cast<FrameFetchContext*>(&documentLoader->fetcher()->context()); + static_cast<FrameFetchContext*>(&document->fetcher()->context()); owner = DummyFrameOwner::create(); FrameFetchContext::provideDocumentToContext(*fetchContext, document.get()); } void TearDown() override { - documentLoader->detachFromFrame(); - documentLoader.clear(); - - if (childFrame) { - childDocumentLoader->detachFromFrame(); - childDocumentLoader.clear(); + if (childFrame) childFrame->detach(FrameDetachType::Remove); - } } FrameFetchContext* createChildFrame() { @@ -114,12 +105,9 @@ document->frame()->host(), owner.get()); childFrame->setView(FrameView::create(*childFrame, IntSize(500, 500))); childFrame->init(); - childDocumentLoader = DocumentLoader::create( - childFrame.get(), ResourceRequest("http://www.example.com"), - SubstituteData(), ClientRedirectPolicy::NotClientRedirect); childDocument = childFrame->document(); FrameFetchContext* childFetchContext = static_cast<FrameFetchContext*>( - &childDocumentLoader->fetcher()->context()); + &childFrame->loader().documentLoader()->fetcher()->context()); FrameFetchContext::provideDocumentToContext(*childFetchContext, childDocument.get()); return childFetchContext; @@ -129,13 +117,11 @@ // We don't use the DocumentLoader directly in any tests, but need to keep it // around as long as the ResourceFetcher and Document live due to indirect // usage. - Persistent<DocumentLoader> documentLoader; Persistent<Document> document; Persistent<FrameFetchContext> fetchContext; Persistent<StubFrameLoaderClientWithParent> childClient; Persistent<LocalFrame> childFrame; - Persistent<DocumentLoader> childDocumentLoader; Persistent<Document> childDocument; Persistent<DummyFrameOwner> owner; }; @@ -151,13 +137,10 @@ dummyPageHolder = DummyPageHolder::create(IntSize(500, 500), nullptr, client); dummyPageHolder->page().setDeviceScaleFactor(1.0); - documentLoader = DocumentLoader::create( - &dummyPageHolder->frame(), ResourceRequest(mainResourceUrl), - SubstituteData(), ClientRedirectPolicy::NotClientRedirect); document = &dummyPageHolder->document(); document->setURL(mainResourceUrl); fetchContext = - static_cast<FrameFetchContext*>(&documentLoader->fetcher()->context()); + static_cast<FrameFetchContext*>(&document->fetcher()->context()); owner = DummyFrameOwner::create(); FrameFetchContext::provideDocumentToContext(*fetchContext, document.get()); }
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index 68831e29..d927b74 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -225,6 +225,10 @@ m_frame->document()->cancelParsing(); m_stateMachine.advanceTo( FrameLoaderStateMachine::DisplayingInitialEmptyDocument); + // Suppress finish notifications for inital empty documents, since they don't + // generate start notifications. + if (m_documentLoader) + m_documentLoader->setSentDidFinishLoad(); // Self-suspend if created in an already suspended Page. Note that both // startLoadingMainResource() and cancelParsing() may have already detached // the frame, since they both fire JS events. @@ -672,11 +676,6 @@ } static bool shouldSendFinishNotification(LocalFrame* frame) { - // Don't send stop notifications for inital empty documents, since they don't - // generate start notifications. - if (!frame->loader().stateMachine()->committedFirstRealDocumentLoad()) - return false; - // Don't send didFinishLoad more than once per DocumentLoader. if (frame->loader().documentLoader()->sentDidFinishLoad()) return false; @@ -1468,19 +1467,18 @@ HistoryCommitType historyCommitType = loadTypeToCommitType(m_loadType); if (loader == m_provisionalDocumentLoader) { + m_provisionalDocumentLoader->setSentDidFinishLoad(); client()->dispatchDidFailProvisionalLoad(error, historyCommitType); if (loader != m_provisionalDocumentLoader) return; detachDocumentLoader(m_provisionalDocumentLoader); - m_progressTracker->progressCompleted(); } else { DCHECK_EQ(loader, m_documentLoader); if (m_frame->document()->parser()) m_frame->document()->parser()->stopParsing(); - m_documentLoader->setSentDidFinishLoad(); - if (!m_provisionalDocumentLoader && m_frame->isLoading()) { + if (!m_documentLoader->sentDidFinishLoad()) { + m_documentLoader->setSentDidFinishLoad(); client()->dispatchDidFailLoad(error, historyCommitType); - m_progressTracker->progressCompleted(); } } checkCompleted();
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp index 22271154..cc5d4b6 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp
@@ -491,6 +491,47 @@ } } +int AXTable::ariaColumnCount() { + if (!hasAttribute(aria_colcountAttr)) + return 0; + + const AtomicString& colCountValue = getAttribute(aria_colcountAttr); + int colCountInt = colCountValue.toInt(); + + if (colCountInt > (int)columnCount()) + return colCountInt; + + // Spec says that if all of the columns are present in the DOM, it + // is not necessary to set this attribute as the user agent can + // automatically calculate the total number of columns. + // It returns 0 in order not to set this attribute. + if (colCountInt == (int)columnCount() || colCountInt != -1) + return 0; + + return -1; +} + +int AXTable::ariaRowCount() { + if (!hasAttribute(aria_rowcountAttr)) + return 0; + + const AtomicString& rowCountValue = getAttribute(aria_rowcountAttr); + int rowCountInt = rowCountValue.toInt(); + + if (rowCountInt > (int)rowCount()) + return rowCountInt; + + // Spec says that if all of the rows are present in the DOM, it is + // not necessary to set this attribute as the user agent can + // automatically calculate the total number of rows. + // It returns 0 in order not to set this attribute. + if (rowCountInt == (int)rowCount() || rowCountInt != -1) + return 0; + + // In the spec, -1 explicitly means an unknown number of rows. + return -1; +} + unsigned AXTable::columnCount() { updateChildrenIfNecessary();
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTable.h b/third_party/WebKit/Source/modules/accessibility/AXTable.h index b5f67bd..974f0af 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTable.h +++ b/third_party/WebKit/Source/modules/accessibility/AXTable.h
@@ -70,6 +70,9 @@ unsigned rowCount(); AXTableCell* cellForColumnAndRow(unsigned column, unsigned row); + int ariaColumnCount(); + int ariaRowCount(); + void columnHeaders(AXObjectVector&); void rowHeaders(AXObjectVector&);
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp b/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp index 4880b6f..09d5115 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp
@@ -30,6 +30,7 @@ #include "core/layout/LayoutTableCell.h" #include "modules/accessibility/AXObjectCacheImpl.h" +#include "modules/accessibility/AXTableRow.h" namespace blink { @@ -101,6 +102,30 @@ return true; } +unsigned AXTableCell::ariaColumnIndex() const { + const AtomicString& colIndex = getAttribute(aria_colindexAttr); + if (colIndex.toInt() >= 1) + return colIndex.toInt(); + + AXObject* parent = parentObjectUnignored(); + if (!parent || !parent->isTableRow()) + return 0; + + return m_ariaColIndexFromRow; +} + +unsigned AXTableCell::ariaRowIndex() const { + const AtomicString& rowIndex = getAttribute(aria_rowindexAttr); + if (rowIndex.toInt() >= 1) + return rowIndex.toInt(); + + AXObject* parent = parentObjectUnignored(); + if (!parent || !parent->isTableRow()) + return 0; + + return toAXTableRow(parent)->ariaRowIndex(); +} + static AccessibilityRole decideRoleFromSibling(LayoutTableCell* siblingCell) { if (!siblingCell) return CellRole;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableCell.h b/third_party/WebKit/Source/modules/accessibility/AXTableCell.h index 4ae6d6bc..c9f734ec 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTableCell.h +++ b/third_party/WebKit/Source/modules/accessibility/AXTableCell.h
@@ -35,7 +35,7 @@ class AXObjectCacheImpl; -class AXTableCell : public AXLayoutObject { +class MODULES_EXPORT AXTableCell : public AXLayoutObject { WTF_MAKE_NONCOPYABLE(AXTableCell); protected: @@ -55,6 +55,10 @@ SortDirection getSortDirection() const final; virtual AccessibilityRole scanToDecideHeaderRole(); + unsigned ariaColumnIndex() const; + unsigned ariaRowIndex() const; + void setARIAColIndexFromRow(int index) { m_ariaColIndexFromRow = index; } + protected: virtual AXObject* parentTable() const; AccessibilityRole determineAccessibilityRole() final; @@ -65,6 +69,8 @@ bool isColumnHeaderCell() const; bool computeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const final; + + unsigned m_ariaColIndexFromRow; }; DEFINE_AX_OBJECT_TYPE_CASTS(AXTableCell, isTableCell());
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp b/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp index 48a180e..58fb6b1 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp
@@ -47,6 +47,23 @@ return new AXTableRow(layoutObject, axObjectCache); } +void AXTableRow::addChildren() { + AXLayoutObject::addChildren(); + + // A row is allowed to have a column index, indicating the index of the + // first cell in that row, and each subsequent cell gets the next index. + int colIndex = ariaColumnIndex(); + if (!colIndex) + return; + + unsigned index = 0; + for (const auto& cell : children()) { + if (cell->isTableCell()) + toAXTableCell(cell.get())->setARIAColIndexFromRow(colIndex + index); + index++; + } +} + AccessibilityRole AXTableRow::determineAccessibilityRole() { if (!isTableRow()) return AXLayoutObject::determineAccessibilityRole(); @@ -96,6 +113,22 @@ return headers[0].get(); } +unsigned AXTableRow::ariaColumnIndex() const { + const AtomicString& colIndexValue = getAttribute(aria_colindexAttr); + if (colIndexValue.toInt() >= 1) + return colIndexValue.toInt(); + + return 0; +} + +unsigned AXTableRow::ariaRowIndex() const { + const AtomicString& rowIndexValue = getAttribute(aria_rowindexAttr); + if (rowIndexValue.toInt() >= 1) + return rowIndexValue.toInt(); + + return 0; +} + void AXTableRow::headerObjectsForRow(AXObjectVector& headers) { if (!m_layoutObject || !m_layoutObject->isTableRow()) return;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableRow.h b/third_party/WebKit/Source/modules/accessibility/AXTableRow.h index ea038c3..f68d34c 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXTableRow.h +++ b/third_party/WebKit/Source/modules/accessibility/AXTableRow.h
@@ -35,7 +35,7 @@ class AXObjectCacheImpl; -class AXTableRow : public AXLayoutObject { +class MODULES_EXPORT AXTableRow : public AXLayoutObject { WTF_MAKE_NONCOPYABLE(AXTableRow); protected: @@ -45,6 +45,7 @@ static AXTableRow* create(LayoutObject*, AXObjectCacheImpl&); ~AXTableRow() override; + void addChildren() final; bool isTableRow() const final; // retrieves the "row" header (a th tag in the rightmost column) @@ -57,6 +58,9 @@ void setRowIndex(int rowIndex) { m_rowIndex = rowIndex; } int rowIndex() const { return m_rowIndex; } + unsigned ariaColumnIndex() const; + unsigned ariaRowIndex() const; + protected: AccessibilityRole determineAccessibilityRole() final;
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContextTest.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContextTest.cpp index cf60f794..0e76d246 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContextTest.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContextTest.cpp
@@ -87,11 +87,8 @@ } void TearDown() override { - if (m_childFrame) { - m_childDocumentLoader->detachFromFrame(); - m_childDocumentLoader.clear(); + if (m_childFrame) m_childFrame->detach(FrameDetachType::Remove); - } } void createChildFrame() { @@ -100,9 +97,6 @@ document().frame()->host(), m_dummyFrameOwner.get()); m_childFrame->setView(FrameView::create(*m_childFrame, IntSize(500, 500))); m_childFrame->init(); - m_childDocumentLoader = DocumentLoader::create( - m_childFrame.get(), ResourceRequest("https://www.example.com"), - SubstituteData(), ClientRedirectPolicy::NotClientRedirect); childDocument().updateSecurityOrigin( SecurityOrigin::create("https", "cross-origin.com", 80)); @@ -129,7 +123,6 @@ Persistent<DummyFrameOwner> m_dummyFrameOwner; Persistent<LocalFrame> m_childFrame; - Persistent<DocumentLoader> m_childDocumentLoader; BaseAudioContextTestPlatform m_testPlatform; };
diff --git a/third_party/WebKit/Source/web/WebAXObject.cpp b/third_party/WebKit/Source/web/WebAXObject.cpp index ebdf64a..3cca2de 100644 --- a/third_party/WebKit/Source/web/WebAXObject.cpp +++ b/third_party/WebKit/Source/web/WebAXObject.cpp
@@ -1107,6 +1107,49 @@ return true; } +int WebAXObject::ariaColumnCount() const { + if (isDetached()) + return 0; + + if (!m_private->isAXTable()) + return 0; + + return toAXTable(m_private.get())->ariaColumnCount(); +} + +unsigned WebAXObject::ariaColumnIndex() const { + if (isDetached()) + return 0; + + if (!m_private->isTableCell()) + return 0; + + return toAXTableCell(m_private.get())->ariaColumnIndex(); +} + +int WebAXObject::ariaRowCount() const { + if (isDetached()) + return 0; + + if (!m_private->isAXTable()) + return 0; + + return toAXTable(m_private.get())->ariaRowCount(); +} + +unsigned WebAXObject::ariaRowIndex() const { + if (isDetached()) + return 0; + + if (m_private->isTableCell()) + return toAXTableCell(m_private.get())->ariaRowIndex(); + + if (m_private->isTableRow()) + return toAXTableRow(m_private.get())->ariaRowIndex(); + + return 0; +} + unsigned WebAXObject::columnCount() const { if (isDetached()) return false; @@ -1119,7 +1162,7 @@ unsigned WebAXObject::rowCount() const { if (isDetached()) - return false; + return 0; if (!m_private->isAXTable()) return 0;
diff --git a/third_party/WebKit/public/web/WebAXObject.h b/third_party/WebKit/public/web/WebAXObject.h index 3530215..32a2570 100644 --- a/third_party/WebKit/public/web/WebAXObject.h +++ b/third_party/WebKit/public/web/WebAXObject.h
@@ -262,6 +262,10 @@ BLINK_EXPORT void showContextMenu() const; // For a table + BLINK_EXPORT int ariaColumnCount() const; + BLINK_EXPORT unsigned ariaColumnIndex() const; + BLINK_EXPORT int ariaRowCount() const; + BLINK_EXPORT unsigned ariaRowIndex() const; BLINK_EXPORT unsigned columnCount() const; BLINK_EXPORT unsigned rowCount() const; BLINK_EXPORT WebAXObject cellForColumnAndRow(unsigned column,
diff --git a/ui/accessibility/ax_enums.idl b/ui/accessibility/ax_enums.idl index 6984a17..0336206c 100644 --- a/ui/accessibility/ax_enums.idl +++ b/ui/accessibility/ax_enums.idl
@@ -358,6 +358,12 @@ text_sel_start, text_sel_end, + // aria_col* and aria_row* attributes + aria_col_count, + aria_col_index, + aria_row_count, + aria_row_index, + // Table attributes. table_row_count, table_column_count,
diff --git a/ui/accessibility/ax_node_data.cc b/ui/accessibility/ax_node_data.cc index 5a7d6c70..8d25bd00 100644 --- a/ui/accessibility/ax_node_data.cc +++ b/ui/accessibility/ax_node_data.cc
@@ -428,6 +428,18 @@ case AX_ATTR_TEXT_SEL_END: result += " sel_end=" + value; break; + case AX_ATTR_ARIA_COL_COUNT: + result += " aria_col_count=" + value; + break; + case AX_ATTR_ARIA_COL_INDEX: + result += " aria_col_index=" + value; + break; + case AX_ATTR_ARIA_ROW_COUNT: + result += " aria_row_count=" + value; + break; + case AX_ATTR_ARIA_ROW_INDEX: + result += " aria_row_index=" + value; + break; case AX_ATTR_TABLE_ROW_COUNT: result += " rows=" + value; break;
diff --git a/ui/accessibility/ax_tree_combiner.cc b/ui/accessibility/ax_tree_combiner.cc index 1186acd2..b36f0d0 100644 --- a/ui/accessibility/ax_tree_combiner.cc +++ b/ui/accessibility/ax_tree_combiner.cc
@@ -58,6 +58,10 @@ case AX_ATTR_INVALID_STATE: case AX_ATTR_TEXT_DIRECTION: case AX_ATTR_TEXT_STYLE: + case AX_ATTR_ARIA_COL_COUNT: + case AX_ATTR_ARIA_COL_INDEX: + case AX_ATTR_ARIA_ROW_COUNT: + case AX_ATTR_ARIA_ROW_INDEX: return false; }