diff options
author | Torne (Richard Coles) <torne@google.com> | 2013-10-31 11:16:26 +0000 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2013-10-31 11:16:26 +0000 |
commit | 1e9bf3e0803691d0a228da41fc608347b6db4340 (patch) | |
tree | ab2e5565f71b4219b3da406e19f16fe306704ef5 /components | |
parent | f10b58d5bc6ae3e74076fc4ccca14cbc57ef805c (diff) | |
download | chromium_org-1e9bf3e0803691d0a228da41fc608347b6db4340.tar.gz |
Merge from Chromium at DEPS revision 232015
This commit was generated by merge_to_master.py.
Change-Id: If86767ad396b9e2e1a4c1e9df1427daea29703ef
Diffstat (limited to 'components')
175 files changed, 2322 insertions, 1615 deletions
diff --git a/components/auto_login_parser.target.darwin-arm.mk b/components/auto_login_parser.target.darwin-arm.mk index 244b35112e..34eaabd2c5 100644 --- a/components/auto_login_parser.target.darwin-arm.mk +++ b/components/auto_login_parser.target.darwin-arm.mk @@ -63,13 +63,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -146,13 +146,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/auto_login_parser.target.darwin-mips.mk b/components/auto_login_parser.target.darwin-mips.mk index 061331283b..34361eafb6 100644 --- a/components/auto_login_parser.target.darwin-mips.mk +++ b/components/auto_login_parser.target.darwin-mips.mk @@ -62,13 +62,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -144,13 +144,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/auto_login_parser.target.darwin-x86.mk b/components/auto_login_parser.target.darwin-x86.mk index 22756146ef..5fd3925fa4 100644 --- a/components/auto_login_parser.target.darwin-x86.mk +++ b/components/auto_login_parser.target.darwin-x86.mk @@ -65,13 +65,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -150,13 +150,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/auto_login_parser.target.linux-arm.mk b/components/auto_login_parser.target.linux-arm.mk index 244b35112e..34eaabd2c5 100644 --- a/components/auto_login_parser.target.linux-arm.mk +++ b/components/auto_login_parser.target.linux-arm.mk @@ -63,13 +63,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -146,13 +146,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/auto_login_parser.target.linux-mips.mk b/components/auto_login_parser.target.linux-mips.mk index 061331283b..34361eafb6 100644 --- a/components/auto_login_parser.target.linux-mips.mk +++ b/components/auto_login_parser.target.linux-mips.mk @@ -62,13 +62,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -144,13 +144,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/auto_login_parser.target.linux-x86.mk b/components/auto_login_parser.target.linux-x86.mk index 22756146ef..5fd3925fa4 100644 --- a/components/auto_login_parser.target.linux-x86.mk +++ b/components/auto_login_parser.target.linux-x86.mk @@ -65,13 +65,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -150,13 +150,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill/content/browser/wallet/wallet_items.cc b/components/autofill/content/browser/wallet/wallet_items.cc index 0ef44d2f0b..fbc49ef8ed 100644 --- a/components/autofill/content/browser/wallet/wallet_items.cc +++ b/components/autofill/content/browser/wallet/wallet_items.cc @@ -257,6 +257,30 @@ bool WalletItems::HasRequiredAction(RequiredAction action) const { action) != required_actions_.end(); } +bool WalletItems::SupportsCard(const base::string16& card_number, + base::string16* message) const { + std::string card_type = CreditCard::GetCreditCardType(card_number); + + if (card_type == kVisaCard || + card_type == kMasterCard || + card_type == kDiscoverCard) { + return true; + } + + if (card_type == kAmericanExpressCard) { + if (amex_permission_ == AMEX_ALLOWED) + return true; + + *message = l10n_util::GetStringUTF16( + IDS_AUTOFILL_CREDIT_CARD_NOT_SUPPORTED_BY_WALLET_FOR_MERCHANT); + return false; + } + + *message = l10n_util::GetStringUTF16( + IDS_AUTOFILL_CREDIT_CARD_NOT_SUPPORTED_BY_WALLET); + return false; +} + base::string16 WalletItems::MaskedInstrument::DisplayName() const { #if defined(OS_ANDROID) // TODO(aruslan): improve this stub implementation. diff --git a/components/autofill/content/browser/wallet/wallet_items.h b/components/autofill/content/browser/wallet/wallet_items.h index 9838ec83df..6d5721388c 100644 --- a/components/autofill/content/browser/wallet/wallet_items.h +++ b/components/autofill/content/browser/wallet/wallet_items.h @@ -239,6 +239,11 @@ class WalletItems { // Whether or not |action| is in |required_actions_|. bool HasRequiredAction(RequiredAction action) const; + // Checks whether |card_number| is supported by Wallet for this merchant and + // if not, fills in |message| with a user-visible explanation. + bool SupportsCard(const base::string16& card_number, + base::string16* message) const; + const std::vector<RequiredAction>& required_actions() const { return required_actions_; } @@ -257,7 +262,6 @@ class WalletItems { const std::vector<LegalDocument*>& legal_documents() const { return legal_documents_.get(); } - bool is_amex_allowed() const { return amex_permission_ == AMEX_ALLOWED; } private: friend class WalletItemsTest; diff --git a/components/autofill/content/browser/wallet/wallet_items_unittest.cc b/components/autofill/content/browser/wallet/wallet_items_unittest.cc index 0766fea804..a1b32f63a2 100644 --- a/components/autofill/content/browser/wallet/wallet_items_unittest.cc +++ b/components/autofill/content/browser/wallet/wallet_items_unittest.cc @@ -515,7 +515,11 @@ TEST_F(WalletItemsTest, CreateWalletItemsMissingGoogleTransactionId) { TEST_F(WalletItemsTest, CreateWalletItemsMissingAmexDisallowed) { SetUpDictionary(std::string(kWalletItems) + std::string(kCloseJson)); EXPECT_TRUE(dict->Remove("amex_disallowed", NULL)); - EXPECT_FALSE(WalletItems::CreateWalletItems(*dict)->is_amex_allowed()); + base::string16 amex_number = ASCIIToUTF16("378282246310005"); + base::string16 message; + EXPECT_FALSE(WalletItems::CreateWalletItems(*dict)->SupportsCard(amex_number, + &message)); + EXPECT_FALSE(message.empty()); } TEST_F(WalletItemsTest, CreateWalletItems) { diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc index dcf6dc20d9..f8754357c3 100644 --- a/components/autofill/content/renderer/form_autofill_util.cc +++ b/components/autofill/content/renderer/form_autofill_util.cc @@ -507,7 +507,8 @@ void ForEachMatchingFormField(const WebFormElement& form_element, // i.e. the field the user is currently editing and interacting with. const WebInputElement* input_element = toWebInputElement(element); if (!force_override && !is_initiating_element && - ((IsTextInput(input_element) && !input_element->value().isEmpty()) || + ((IsAutofillableInputElement(input_element) && + !input_element->value().isEmpty()) || (IsTextAreaElement(*element) && !element->toConst<WebTextAreaElement>().value().isEmpty()))) continue; @@ -533,7 +534,7 @@ void FillFormField(const FormFieldData& data, field->setAutofilled(true); WebInputElement* input_element = toWebInputElement(field); - if (IsTextInput(input_element)) { + if (IsTextInput(input_element) || IsMonthInput(input_element)) { // If the maxlength attribute contains a negative value, maxLength() // returns the default maxlength value. input_element->setValue( @@ -628,6 +629,11 @@ bool IsWebNodeVisibleImpl(const WebKit::WebNode& node, const int depth) { const size_t kMaxParseableFields = 200; +bool IsMonthInput(const WebInputElement* element) { + CR_DEFINE_STATIC_LOCAL(WebString, kMonth, ("month")); + return element && element->formControlType() == kMonth; +} + // All text fields, including password fields, should be extracted. bool IsTextInput(const WebInputElement* element) { return element && element->isTextField(); @@ -653,7 +659,9 @@ bool IsCheckableElement(const WebInputElement* element) { } bool IsAutofillableInputElement(const WebInputElement* element) { - return IsTextInput(element) || IsCheckableElement(element); + return IsTextInput(element) || + IsMonthInput(element) || + IsCheckableElement(element); } const base::string16 GetFormIdentifier(const WebFormElement& form) { diff --git a/components/autofill/content/renderer/form_autofill_util.h b/components/autofill/content/renderer/form_autofill_util.h index abff7bf7ed..ae4470af4e 100644 --- a/components/autofill/content/renderer/form_autofill_util.h +++ b/components/autofill/content/renderer/form_autofill_util.h @@ -51,6 +51,9 @@ enum ExtractMask { // Google code project settings. extern const size_t kMaxParseableFields; +// Returns true if |element| is a month input element. +bool IsMonthInput(const WebKit::WebInputElement* element); + // Returns true if |element| is a text input element. bool IsTextInput(const WebKit::WebInputElement* element); diff --git a/components/autofill/content/renderer/form_cache.cc b/components/autofill/content/renderer/form_cache.cc index 46df3ef4cc..b959009998 100644 --- a/components/autofill/content/renderer/form_cache.cc +++ b/components/autofill/content/renderer/form_cache.cc @@ -196,7 +196,7 @@ bool FormCache::ClearFormWithElement(const WebInputElement& element) { control_element.setAutofilled(false); WebInputElement* input_element = toWebInputElement(&control_element); - if (IsTextInput(input_element)) { + if (IsTextInput(input_element) || IsMonthInput(input_element)) { input_element->setValue(base::string16(), true); // Clearing the value in the focused node (above) can cause selection diff --git a/components/autofill/content/renderer/password_generation_agent.cc b/components/autofill/content/renderer/password_generation_agent.cc index 682f33a5d4..5e1bff765a 100644 --- a/components/autofill/content/renderer/password_generation_agent.cc +++ b/components/autofill/content/renderer/password_generation_agent.cc @@ -74,17 +74,20 @@ bool ContainsURL(const std::vector<GURL>& urls, const GURL& url) { } // Returns true if the |form1| is essentially equal to |form2|. -bool FormEquals(const autofill::FormData& form1, - const PasswordForm& form2) { +bool FormsAreEqual(const autofill::FormData& form1, + const PasswordForm& form2) { // TODO(zysxqn): use more signals than just origin to compare. - return form1.origin == form2.origin; + // Note that FormData strips the fragement from the url while PasswordForm + // strips both the fragement and the path, so we can't just compare these + // two directly. + return form1.origin.GetOrigin() == form2.origin.GetOrigin(); } bool ContainsForm(const std::vector<autofill::FormData>& forms, const PasswordForm& form) { for (std::vector<autofill::FormData>::const_iterator it = forms.begin(); it != forms.end(); ++it) { - if (FormEquals(*it, form)) + if (FormsAreEqual(*it, form)) return true; } return false; diff --git a/components/autofill/core/browser/autofill_data_model.cc b/components/autofill/core/browser/autofill_data_model.cc index 2d1edcf221..48b818d031 100644 --- a/components/autofill/core/browser/autofill_data_model.cc +++ b/components/autofill/core/browser/autofill_data_model.cc @@ -4,119 +4,10 @@ #include "components/autofill/core/browser/autofill_data_model.h" -#include "base/basictypes.h" -#include "base/logging.h" -#include "base/strings/string_number_conversions.h" -#include "base/strings/string_util.h" -#include "base/strings/utf_string_conversions.h" -#include "components/autofill/core/browser/autofill_country.h" -#include "components/autofill/core/browser/autofill_field.h" #include "components/autofill/core/browser/autofill_type.h" -#include "components/autofill/core/browser/state_names.h" -#include "components/autofill/core/browser/validation.h" -#include "components/autofill/core/common/form_field_data.h" -#include "grit/component_strings.h" -#include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" namespace autofill { -namespace { - -const char* const kMonthsAbbreviated[] = { - NULL, // Padding so index 1 = month 1 = January. - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", -}; - -const char* const kMonthsFull[] = { - NULL, // Padding so index 1 = month 1 = January. - "January", "February", "March", "April", "May", "June", - "July", "August", "September", "October", "November", "December", -}; - -const char* const kMonthsNumeric[] = { - NULL, // Padding so index 1 = month 1 = January. - "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", -}; - -// Returns true if the value was successfully set, meaning |value| was found in -// the list of select options in |field|. -bool SetSelectControlValue(const base::string16& value, - FormFieldData* field) { - base::string16 value_lowercase = StringToLowerASCII(value); - - DCHECK_EQ(field->option_values.size(), field->option_contents.size()); - for (size_t i = 0; i < field->option_values.size(); ++i) { - if (value_lowercase == StringToLowerASCII(field->option_values[i]) || - value_lowercase == StringToLowerASCII(field->option_contents[i])) { - field->value = field->option_values[i]; - return true; - } - } - - return false; -} - -bool FillStateSelectControl(const base::string16& value, - FormFieldData* field) { - base::string16 full, abbreviation; - state_names::GetNameAndAbbreviation(value, &full, &abbreviation); - - // Try the abbreviation first. - if (!abbreviation.empty() && SetSelectControlValue(abbreviation, field)) - return true; - - return !full.empty() && SetSelectControlValue(full, field); -} - -bool FillExpirationMonthSelectControl(const base::string16& value, - FormFieldData* field) { - int index = 0; - if (!base::StringToInt(value, &index) || - index <= 0 || - static_cast<size_t>(index) >= arraysize(kMonthsFull)) - return false; - - bool filled = - SetSelectControlValue(ASCIIToUTF16(kMonthsAbbreviated[index]), field) || - SetSelectControlValue(ASCIIToUTF16(kMonthsFull[index]), field) || - SetSelectControlValue(ASCIIToUTF16(kMonthsNumeric[index]), field); - return filled; -} - -// Try to fill a credit card type |value| (Visa, MasterCard, etc.) into the -// given |field|. -bool FillCreditCardTypeSelectControl(const base::string16& value, - FormFieldData* field) { - // Try stripping off spaces. - base::string16 value_stripped; - RemoveChars(StringToLowerASCII(value), kWhitespaceUTF16, &value_stripped); - - for (size_t i = 0; i < field->option_values.size(); ++i) { - base::string16 option_value_lowercase; - RemoveChars(StringToLowerASCII(field->option_values[i]), kWhitespaceUTF16, - &option_value_lowercase); - base::string16 option_contents_lowercase; - RemoveChars(StringToLowerASCII(field->option_contents[i]), kWhitespaceUTF16, - &option_contents_lowercase); - - // Perform a case-insensitive comparison; but fill the form with the - // original text, not the lowercased version. - if (value_stripped == option_value_lowercase || - value_stripped == option_contents_lowercase) { - field->value = field->option_values[i]; - return true; - } - } - - // For American Express, also try filling as "AmEx". - if (value == l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_AMEX)) - return FillCreditCardTypeSelectControl(ASCIIToUTF16("AmEx"), field); - - return false; -} - -} // namespace AutofillDataModel::AutofillDataModel(const std::string& guid, const std::string& origin) @@ -124,62 +15,11 @@ AutofillDataModel::AutofillDataModel(const std::string& guid, origin_(origin) {} AutofillDataModel::~AutofillDataModel() {} -void AutofillDataModel::FillSelectControl(const AutofillType& type, - const std::string& app_locale, - FormFieldData* field) const { - DCHECK(field); - DCHECK_EQ("select-one", field->form_control_type); - DCHECK_EQ(field->option_values.size(), field->option_contents.size()); - - base::string16 field_text = GetInfo(type, app_locale); - base::string16 field_text_lower = StringToLowerASCII(field_text); - if (field_text.empty()) - return; - - base::string16 value; - for (size_t i = 0; i < field->option_values.size(); ++i) { - if (field_text == field->option_values[i] || - field_text == field->option_contents[i]) { - // An exact match, use it. - value = field->option_values[i]; - break; - } - - if (field_text_lower == StringToLowerASCII(field->option_values[i]) || - field_text_lower == StringToLowerASCII(field->option_contents[i])) { - // A match, but not in the same case. Save it in case an exact match is - // not found. - value = field->option_values[i]; - } - } - - if (!value.empty()) { - field->value = value; - return; - } - - ServerFieldType storable_type = type.GetStorableType(); - if (storable_type == ADDRESS_HOME_STATE) { - FillStateSelectControl(field_text, field); - } else if (storable_type == ADDRESS_HOME_COUNTRY) { - FillCountrySelectControl(app_locale, field); - } else if (storable_type == CREDIT_CARD_EXP_MONTH) { - FillExpirationMonthSelectControl(field_text, field); - } else if (storable_type == CREDIT_CARD_EXP_4_DIGIT_YEAR) { - // Attempt to fill the year as a 2-digit year. This compensates for the - // fact that our heuristics do not always correctly detect when a website - // requests a 2-digit rather than a 4-digit year. - FillSelectControl(AutofillType(CREDIT_CARD_EXP_2_DIGIT_YEAR), app_locale, - field); - } else if (storable_type == CREDIT_CARD_TYPE) { - FillCreditCardTypeSelectControl(field_text, field); - } -} - -bool AutofillDataModel::FillCountrySelectControl( - const std::string& app_locale, - FormFieldData* field_data) const { - return false; +base::string16 AutofillDataModel::GetInfoForVariant( + const AutofillType& type, + size_t variant, + const std::string& app_locale) const { + return GetInfo(type, app_locale); } bool AutofillDataModel::IsVerified() const { diff --git a/components/autofill/core/browser/autofill_data_model.h b/components/autofill/core/browser/autofill_data_model.h index 0f2cd33f0f..04499f39db 100644 --- a/components/autofill/core/browser/autofill_data_model.h +++ b/components/autofill/core/browser/autofill_data_model.h @@ -7,13 +7,12 @@ #include <string> -#include "components/autofill/core/browser/field_types.h" +#include "base/strings/string16.h" #include "components/autofill/core/browser/form_group.h" namespace autofill { -class AutofillField; -struct FormFieldData; +class AutofillType; // This class is an interface for the primary data models that back Autofill. // The information in objects of this class is managed by the @@ -23,18 +22,13 @@ class AutofillDataModel : public FormGroup { AutofillDataModel(const std::string& guid, const std::string& origin); virtual ~AutofillDataModel(); - // Set |field_data|'s value based on |field| and contents of |this| (using - // data variant |variant|). - virtual void FillFormField(const AutofillField& field, - size_t variant, - const std::string& app_locale, - FormFieldData* field_data) const = 0; - - // Fills in select control with data matching |type| from |this|. - // Public for testing purposes. - void FillSelectControl(const AutofillType& type, - const std::string& app_locale, - FormFieldData* field_data) const; + // Returns the string that should be auto-filled into a text field given the + // |type| of that field, localized to the given |app_locale| if appropriate. + // If the data model supports multiple values for the given |type|, returns + // the |variant|th value for the |type|. + virtual base::string16 GetInfoForVariant(const AutofillType& type, + size_t variant, + const std::string& app_locale) const; // Returns true if the data in this model was entered directly by the user, // rather than automatically aggregated. @@ -46,12 +40,6 @@ class AutofillDataModel : public FormGroup { std::string origin() const { return origin_; } void set_origin(const std::string& origin) { origin_ = origin; } - protected: - // Fills in a select control for a country from data in |this|. Returns true - // for success. - virtual bool FillCountrySelectControl(const std::string& app_locale, - FormFieldData* field_data) const; - private: // A globally unique ID for this object. std::string guid_; diff --git a/components/autofill/core/browser/autofill_data_model_unittest.cc b/components/autofill/core/browser/autofill_data_model_unittest.cc index 8004df4642..8540ecf718 100644 --- a/components/autofill/core/browser/autofill_data_model_unittest.cc +++ b/components/autofill/core/browser/autofill_data_model_unittest.cc @@ -26,10 +26,6 @@ class TestAutofillDataModel : public AutofillDataModel { const base::string16& value) OVERRIDE {} virtual void GetSupportedTypes( ServerFieldTypeSet* supported_types) const OVERRIDE {} - virtual void FillFormField(const AutofillField& field, - size_t variant, - const std::string& app_locale, - FormFieldData* field_data) const OVERRIDE {} DISALLOW_COPY_AND_ASSIGN(TestAutofillDataModel); }; diff --git a/components/autofill/core/browser/autofill_field.cc b/components/autofill/core/browser/autofill_field.cc index 4bcb118536..56f7204b6a 100644 --- a/components/autofill/core/browser/autofill_field.cc +++ b/components/autofill/core/browser/autofill_field.cc @@ -7,12 +7,278 @@ #include "base/logging.h" #include "base/sha1.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" +#include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "components/autofill/core/browser/autofill_country.h" #include "components/autofill/core/browser/autofill_type.h" +#include "components/autofill/core/browser/phone_number.h" +#include "components/autofill/core/browser/state_names.h" +#include "grit/component_strings.h" +#include "ui/base/l10n/l10n_util.h" +using base::StringToInt; + +namespace autofill { namespace { -static std::string Hash32Bit(const std::string& str) { +const char* const kMonthsAbbreviated[] = { + NULL, // Padding so index 1 = month 1 = January. + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", +}; + +const char* const kMonthsFull[] = { + NULL, // Padding so index 1 = month 1 = January. + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December", +}; + +// Returns true if the value was successfully set, meaning |value| was found in +// the list of select options in |field|. +bool SetSelectControlValue(const base::string16& value, + FormFieldData* field) { + base::string16 value_lowercase = StringToLowerASCII(value); + + DCHECK_EQ(field->option_values.size(), field->option_contents.size()); + base::string16 best_match; + for (size_t i = 0; i < field->option_values.size(); ++i) { + if (value == field->option_values[i] || + value == field->option_contents[i]) { + // An exact match, use it. + best_match = field->option_values[i]; + break; + } + + if (value_lowercase == StringToLowerASCII(field->option_values[i]) || + value_lowercase == StringToLowerASCII(field->option_contents[i])) { + // A match, but not in the same case. Save it in case an exact match is + // not found. + best_match = field->option_values[i]; + } + } + + if (best_match.empty()) + return false; + + field->value = best_match; + return true; +} + + +// Try to fill a numeric |value| into the given |field|. +bool FillNumericSelectControl(int value, + FormFieldData* field) { + DCHECK_EQ(field->option_values.size(), field->option_contents.size()); + for (size_t i = 0; i < field->option_values.size(); ++i) { + int option; + if ((StringToInt(field->option_values[i], &option) && option == value) || + (StringToInt(field->option_contents[i], &option) && option == value)) { + field->value = field->option_values[i]; + return true; + } + } + + return false; +} + +bool FillStateSelectControl(const base::string16& value, + FormFieldData* field) { + base::string16 full, abbreviation; + state_names::GetNameAndAbbreviation(value, &full, &abbreviation); + + // Try the abbreviation first. + if (!abbreviation.empty() && SetSelectControlValue(abbreviation, field)) + return true; + + return !full.empty() && SetSelectControlValue(full, field); +} + +bool FillCountrySelectControl(const base::string16& value, + const std::string& app_locale, + FormFieldData* field_data) { + std::string country_code = AutofillCountry::GetCountryCode(value, app_locale); + if (country_code.empty()) + return false; + + DCHECK_EQ(field_data->option_values.size(), + field_data->option_contents.size()); + for (size_t i = 0; i < field_data->option_values.size(); ++i) { + // Canonicalize each <option> value to a country code, and compare to the + // target country code. + base::string16 value = field_data->option_values[i]; + base::string16 contents = field_data->option_contents[i]; + if (country_code == AutofillCountry::GetCountryCode(value, app_locale) || + country_code == AutofillCountry::GetCountryCode(contents, app_locale)) { + field_data->value = value; + return true; + } + } + + return false; +} + +bool FillExpirationMonthSelectControl(const base::string16& value, + FormFieldData* field) { + int index = 0; + if (!StringToInt(value, &index) || + index <= 0 || + static_cast<size_t>(index) >= arraysize(kMonthsFull)) + return false; + + bool filled = + SetSelectControlValue(ASCIIToUTF16(kMonthsAbbreviated[index]), field) || + SetSelectControlValue(ASCIIToUTF16(kMonthsFull[index]), field) || + FillNumericSelectControl(index, field); + return filled; +} + +// Returns true if the last two digits in |year| match those in |str|. +bool LastTwoDigitsMatch(const base::string16& year, + const base::string16& str) { + int year_int; + int str_int; + if (!StringToInt(year, &year_int) || !StringToInt(str, &str_int)) + return false; + + return (year_int % 100) == (str_int % 100); +} + +// Try to fill a year |value| into the given |field| by comparing the last two +// digits of the year to the field's options. +bool FillYearSelectControl(const base::string16& value, + FormFieldData* field) { + if (value.size() != 2U && value.size() != 4U) + return false; + + DCHECK_EQ(field->option_values.size(), field->option_contents.size()); + for (size_t i = 0; i < field->option_values.size(); ++i) { + if (LastTwoDigitsMatch(value, field->option_values[i]) || + LastTwoDigitsMatch(value, field->option_contents[i])) { + field->value = field->option_values[i]; + return true; + } + } + + return false; +} + +// Try to fill a credit card type |value| (Visa, MasterCard, etc.) into the +// given |field|. +bool FillCreditCardTypeSelectControl(const base::string16& value, + FormFieldData* field) { + // Try stripping off spaces. + base::string16 value_stripped; + RemoveChars(StringToLowerASCII(value), kWhitespaceUTF16, &value_stripped); + + for (size_t i = 0; i < field->option_values.size(); ++i) { + base::string16 option_value_lowercase; + RemoveChars(StringToLowerASCII(field->option_values[i]), kWhitespaceUTF16, + &option_value_lowercase); + base::string16 option_contents_lowercase; + RemoveChars(StringToLowerASCII(field->option_contents[i]), kWhitespaceUTF16, + &option_contents_lowercase); + + // Perform a case-insensitive comparison; but fill the form with the + // original text, not the lowercased version. + if (value_stripped == option_value_lowercase || + value_stripped == option_contents_lowercase) { + field->value = field->option_values[i]; + return true; + } + } + + // For American Express, also try filling as "AmEx". + if (value == l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_AMEX)) + return FillCreditCardTypeSelectControl(ASCIIToUTF16("AmEx"), field); + + return false; +} + +// Set |field_data|'s value to |number|, or possibly an appropriate substring of +// |number|. The |field| specifies the type of the phone and whether this is a +// phone prefix or suffix. +void FillPhoneNumberField(const AutofillField& field, + const base::string16& number, + FormFieldData* field_data) { + // Check to see if the size field matches the "prefix" or "suffix" sizes and + // fill accordingly. + base::string16 value = number; + if (number.length() == + PhoneNumber::kPrefixLength + PhoneNumber::kSuffixLength) { + if (field.phone_part() == AutofillField::PHONE_PREFIX || + field_data->max_length == PhoneNumber::kPrefixLength) { + value = number.substr(PhoneNumber::kPrefixOffset, + PhoneNumber::kPrefixLength); + } else if (field.phone_part() == AutofillField::PHONE_SUFFIX || + field_data->max_length == PhoneNumber::kSuffixLength) { + value = number.substr(PhoneNumber::kSuffixOffset, + PhoneNumber::kSuffixLength); + } + } + + field_data->value = value; +} + +// Fills in the select control |field| with |value|. If an exact match is not +// found, falls back to alternate filling strategies based on the |type|. +void FillSelectControl(const AutofillType& type, + const base::string16& value, + const std::string& app_locale, + FormFieldData* field) { + DCHECK_EQ("select-one", field->form_control_type); + + // Guard against corrupted values passed over IPC. + if (field->option_values.size() != field->option_contents.size()) + return; + + if (value.empty()) + return; + + // First, search for exact matches. + if (SetSelectControlValue(value, field)) + return; + + // If that fails, try specific fallbacks based on the field type. + ServerFieldType storable_type = type.GetStorableType(); + if (storable_type == ADDRESS_HOME_STATE) { + FillStateSelectControl(value, field); + } else if (storable_type == ADDRESS_HOME_COUNTRY) { + FillCountrySelectControl(value, app_locale, field); + } else if (storable_type == CREDIT_CARD_EXP_MONTH) { + FillExpirationMonthSelectControl(value, field); + } else if (storable_type == CREDIT_CARD_EXP_2_DIGIT_YEAR || + storable_type == CREDIT_CARD_EXP_4_DIGIT_YEAR) { + FillYearSelectControl(value, field); + } else if (storable_type == CREDIT_CARD_TYPE) { + FillCreditCardTypeSelectControl(value, field); + } +} + +// Fills in the month control |field| with |value|. |value| should be a date +// formatted as MM/YYYY. If it isn't, filling will fail. +bool FillMonthControl(const base::string16& value, FormFieldData* field) { + // Autofill formats a combined date as month/year. + std::vector<base::string16> pieces; + base::SplitString(value, char16('/'), &pieces); + if (pieces.size() != 2) + return false; + + // HTML5 input="month" is formatted as year-month. + base::string16 month = pieces[0]; + base::string16 year = pieces[1]; + if ((month.size() != 1 && month.size() != 2) || year.size() != 4) + return false; + + // HTML5 input="month" expects zero-padded months. + if (month.size() == 1) + month = ASCIIToUTF16("0") + month; + + field->value = year + ASCIIToUTF16("-") + month; + return true; +} + +std::string Hash32Bit(const std::string& str) { std::string hash_bin = base::SHA1HashString(str); DCHECK_EQ(20U, hash_bin.length()); @@ -26,8 +292,6 @@ static std::string Hash32Bit(const std::string& str) { } // namespace -namespace autofill { - AutofillField::AutofillField() : server_type_(NO_SERVER_DATA), heuristic_type_(UNKNOWN_TYPE), @@ -74,9 +338,11 @@ void AutofillField::SetHtmlType(HtmlFieldType type, HtmlFieldMode mode) { html_mode_ = mode; if (type == HTML_TYPE_TEL_LOCAL_PREFIX) - phone_part_ = AutofillField::PHONE_PREFIX; + phone_part_ = PHONE_PREFIX; else if (type == HTML_TYPE_TEL_LOCAL_SUFFIX) - phone_part_ = AutofillField::PHONE_SUFFIX; + phone_part_ = PHONE_SUFFIX; + else + phone_part_ = IGNORED; } AutofillType AutofillField::Type() const { @@ -103,4 +369,21 @@ bool AutofillField::IsFieldFillable() const { return !Type().IsUnknown(); } +// static +void AutofillField::FillFormField(const AutofillField& field, + const base::string16& value, + const std::string& app_locale, + FormFieldData* field_data) { + AutofillType type = field.Type(); + + if (type.GetStorableType() == PHONE_HOME_NUMBER) + FillPhoneNumberField(field, value, field_data); + else if (field_data->form_control_type == "select-one") + FillSelectControl(type, value, app_locale, field_data); + else if (field_data->form_control_type == "month") + FillMonthControl(value, field_data); + else + field_data->value = value; +} + } // namespace autofill diff --git a/components/autofill/core/browser/autofill_field.h b/components/autofill/core/browser/autofill_field.h index 6f57484d53..38aeaead36 100644 --- a/components/autofill/core/browser/autofill_field.h +++ b/components/autofill/core/browser/autofill_field.h @@ -65,6 +65,14 @@ class AutofillField : public FormFieldData { void set_default_value(const std::string& value) { default_value_ = value; } const std::string& default_value() const { return default_value_; } + // Set |field_data|'s value to |value|. Uses |field| and |app_locale| as + // hints when filling exceptional cases like phone number values and <select> + // fields. + static void FillFormField(const AutofillField& field, + const base::string16& value, + const std::string& app_locale, + FormFieldData* field_data); + private: // The unique name of this field, generated by Autofill. base::string16 unique_name_; diff --git a/components/autofill/core/browser/autofill_field_unittest.cc b/components/autofill/core/browser/autofill_field_unittest.cc index 3c26302378..b7daedaedd 100644 --- a/components/autofill/core/browser/autofill_field_unittest.cc +++ b/components/autofill/core/browser/autofill_field_unittest.cc @@ -2,7 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/format_macros.h" #include "base/strings/string_util.h" +#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/autofill_field.h" #include "components/autofill/core/browser/autofill_type.h" @@ -12,6 +14,22 @@ namespace autofill { namespace { +// Returns a FormFieldData object corresponding to a <select> field populated +// with the given |options|. +FormFieldData GenerateSelectFieldWithOptions(const char* const* options, + size_t options_size) { + std::vector<base::string16> options16(options_size); + for (size_t i = 0; i < options_size; ++i) { + options16[i] = ASCIIToUTF16(options[i]); + } + + FormFieldData form_field; + form_field.form_control_type = "select-one"; + form_field.option_values = options16; + form_field.option_contents = options16; + return form_field; +} + TEST(AutofillFieldTest, Type) { AutofillField field; ASSERT_EQ(NO_SERVER_DATA, field.server_type()); @@ -95,5 +113,241 @@ TEST(AutofillFieldTest, IsFieldFillable) { EXPECT_TRUE(field.IsFieldFillable()); } +TEST(AutofillFieldTest, FillPhoneNumber) { + AutofillField field; + field.SetHtmlType(HTML_TYPE_TEL_LOCAL_PREFIX, HtmlFieldMode()); + + // Fill with a non-phone number; should fill normally. + AutofillField::FillFormField(field, ASCIIToUTF16("Oh hai"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("Oh hai"), field.value); + + // Fill with a phone number; should fill just the prefix. + AutofillField::FillFormField(field, ASCIIToUTF16("5551234"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("555"), field.value); + + // Now reset the type, and set a max-length instead. + field.SetHtmlType(HTML_TYPE_UNKNOWN, HtmlFieldMode()); + field.set_heuristic_type(PHONE_HOME_NUMBER); + field.max_length = 4; + + // Fill with a phone-number; should fill just the suffix. + AutofillField::FillFormField(field, ASCIIToUTF16("5551234"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("1234"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlByValue) { + const char* const kOptions[] = { + "Eenie", "Meenie", "Miney", "Mo", + }; + AutofillField field( + GenerateSelectFieldWithOptions(kOptions, arraysize(kOptions)), + base::string16()); + + // Set semantically empty contents for each option, so that only the values + // can be used for matching. + for (size_t i = 0; i < field.option_contents.size(); ++i) { + field.option_contents[i] = ASCIIToUTF16(base::StringPrintf("%" PRIuS, i)); + } + + AutofillField::FillFormField(field, ASCIIToUTF16("Meenie"), "en-US", + &field); + EXPECT_EQ(ASCIIToUTF16("Meenie"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlByContents) { + const char* const kOptions[] = { + "Eenie", "Meenie", "Miney", "Mo", + }; + AutofillField field( + GenerateSelectFieldWithOptions(kOptions, arraysize(kOptions)), + base::string16()); + + // Set semantically empty values for each option, so that only the contents + // can be used for matching. + for (size_t i = 0; i < field.option_values.size(); ++i) { + field.option_values[i] = ASCIIToUTF16(base::StringPrintf("%" PRIuS, i)); + } + + AutofillField::FillFormField(field, ASCIIToUTF16("Miney"), "en-US", + &field); + EXPECT_EQ(ASCIIToUTF16("2"), field.value); // Corresponds to "Miney". +} + +TEST(AutofillFieldTest, FillSelectControlWithFullCountryNames) { + const char* const kCountries[] = { + "Albania", "Canada" + }; + AutofillField field( + GenerateSelectFieldWithOptions(kCountries, arraysize(kCountries)), + base::string16()); + field.set_heuristic_type(ADDRESS_HOME_COUNTRY); + + AutofillField::FillFormField(field, ASCIIToUTF16("CA"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("Canada"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlWithAbbreviatedCountryNames) { + const char* const kCountries[] = { + "AL", "CA" + }; + AutofillField field( + GenerateSelectFieldWithOptions(kCountries, arraysize(kCountries)), + base::string16()); + field.set_heuristic_type(ADDRESS_HOME_COUNTRY); + + AutofillField::FillFormField(field, ASCIIToUTF16("Canada"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("CA"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlWithFullStateNames) { + const char* const kStates[] = { + "Alabama", "California" + }; + AutofillField field( + GenerateSelectFieldWithOptions(kStates, arraysize(kStates)), + base::string16()); + field.set_heuristic_type(ADDRESS_HOME_STATE); + + AutofillField::FillFormField(field, ASCIIToUTF16("CA"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("California"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlWithWithAbbreviateStateNames) { + const char* const kStates[] = { + "AL", "CA" + }; + AutofillField field( + GenerateSelectFieldWithOptions(kStates, arraysize(kStates)), + base::string16()); + field.set_heuristic_type(ADDRESS_HOME_STATE); + + AutofillField::FillFormField(field, ASCIIToUTF16("California"), "en-US", + &field); + EXPECT_EQ(ASCIIToUTF16("CA"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlWithNumericMonth) { + const char* const kMonthsNumeric[] = { + "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", + }; + AutofillField field( + GenerateSelectFieldWithOptions(kMonthsNumeric, arraysize(kMonthsNumeric)), + base::string16()); + field.set_heuristic_type(CREDIT_CARD_EXP_MONTH); + + // Try with a leading zero. + AutofillField::FillFormField(field, ASCIIToUTF16("03"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("03"), field.value); + + // Try without a leading zero. + AutofillField::FillFormField(field, ASCIIToUTF16("4"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("04"), field.value); + + // Try a two-digit month. + AutofillField::FillFormField(field, ASCIIToUTF16("11"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("11"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlWithAbbreviatedMonthName) { + const char* const kMonthsAbbreviated[] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", + }; + AutofillField field( + GenerateSelectFieldWithOptions( + kMonthsAbbreviated, arraysize(kMonthsAbbreviated)), + base::string16()); + field.set_heuristic_type(CREDIT_CARD_EXP_MONTH); + + AutofillField::FillFormField(field, ASCIIToUTF16("04"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("Apr"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlWithFullMonthName) { + const char* const kMonthsFull[] = { + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December", + }; + AutofillField field( + GenerateSelectFieldWithOptions(kMonthsFull, arraysize(kMonthsFull)), + base::string16()); + field.set_heuristic_type(CREDIT_CARD_EXP_MONTH); + + AutofillField::FillFormField(field, ASCIIToUTF16("04"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("April"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlWithNumericMonthSansLeadingZero) { + const char* const kMonthsNumeric[] = { + "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", + }; + AutofillField field( + GenerateSelectFieldWithOptions(kMonthsNumeric, arraysize(kMonthsNumeric)), + base::string16()); + field.set_heuristic_type(CREDIT_CARD_EXP_MONTH); + + AutofillField::FillFormField(field, ASCIIToUTF16("04"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("4"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlWithTwoDigitCreditCardYear) { + const char* const kYears[] = { + "12", "13", "14", "15", "16", "17", "18", "19" + }; + AutofillField field(GenerateSelectFieldWithOptions(kYears, arraysize(kYears)), + base::string16()); + field.set_heuristic_type(CREDIT_CARD_EXP_2_DIGIT_YEAR); + + AutofillField::FillFormField(field, ASCIIToUTF16("2017"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("17"), field.value); +} + +TEST(AutofillFieldTest, FillSelectControlWithCreditCardType) { + const char* const kCreditCardTypes[] = { + "Visa", "Master Card", "AmEx", "discover" + }; + AutofillField field( + GenerateSelectFieldWithOptions( + kCreditCardTypes, arraysize(kCreditCardTypes)), + base::string16()); + field.set_heuristic_type(CREDIT_CARD_TYPE); + + // Normal case: + AutofillField::FillFormField(field, ASCIIToUTF16("Visa"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("Visa"), field.value); + + // Filling should be able to handle intervening whitespace: + AutofillField::FillFormField(field, ASCIIToUTF16("MasterCard"), "en-US", + &field); + EXPECT_EQ(ASCIIToUTF16("Master Card"), field.value); + + // American Express is sometimes abbreviated as AmEx: + AutofillField::FillFormField(field, ASCIIToUTF16("American Express"), "en-US", + &field); + EXPECT_EQ(ASCIIToUTF16("AmEx"), field.value); + + // Case insensitivity: + AutofillField::FillFormField(field, ASCIIToUTF16("Discover"), "en-US", + &field); + EXPECT_EQ(ASCIIToUTF16("discover"), field.value); +} + +TEST(AutofillFieldTest, FillMonthControl) { + AutofillField field; + field.form_control_type = "month"; + + // Try a month with two digits. + AutofillField::FillFormField(field, ASCIIToUTF16("12/2017"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("2017-12"), field.value); + + // Try a month with a leading zero. + AutofillField::FillFormField(field, ASCIIToUTF16("03/2019"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("2019-03"), field.value); + + // Try a month without a leading zero. + AutofillField::FillFormField(field, ASCIIToUTF16("4/2018"), "en-US", &field); + EXPECT_EQ(ASCIIToUTF16("2018-04"), field.value); +} + } // namespace } // namespace autofill diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index d6d55dfa94..4c76295dfd 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc @@ -483,8 +483,10 @@ void AutofillManager::OnFillAutofillFormData(int query_id, for (std::vector<FormFieldData>::iterator iter = result.fields.begin(); iter != result.fields.end(); ++iter) { if ((*iter) == field) { - data_model->FillFormField( - *autofill_field, variant, app_locale_, &(*iter)); + base::string16 value = data_model->GetInfoForVariant( + autofill_field->Type(), variant, app_locale_); + AutofillField::FillFormField(*autofill_field, value, app_locale_, + &(*iter)); // Mark the cached field as autofilled, so that we can detect when a // user edits an autofilled field (for metrics). autofill_field->is_autofilled = true; @@ -518,10 +520,10 @@ void AutofillManager::OnFillAutofillFormData(int query_id, field_group_type == initiating_group_type) { use_variant = variant; } - data_model->FillFormField(*cached_field, - use_variant, - app_locale_, - &result.fields[i]); + base::string16 value = data_model->GetInfoForVariant( + cached_field->Type(), use_variant, app_locale_); + AutofillField::FillFormField(*cached_field, value, app_locale_, + &result.fields[i]); // Mark the cached field as autofilled, so that we can detect when a user // edits an autofilled field (for metrics). form_structure->field(i)->is_autofilled = true; diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc index 735549f776..53a056f092 100644 --- a/components/autofill/core/browser/autofill_profile.cc +++ b/components/autofill/core/browser/autofill_profile.cc @@ -309,6 +309,22 @@ bool AutofillProfile::SetInfo(const AutofillType& type, form_group->SetInfo(type, CollapseWhitespace(value, false), app_locale); } +base::string16 AutofillProfile::GetInfoForVariant( + const AutofillType& type, + size_t variant, + const std::string& app_locale) const { + std::vector<base::string16> values; + GetMultiInfo(type, app_locale, &values); + + if (variant >= values.size()) { + // If the variant is unavailable, bail. This case is reachable, for + // example if Sync updates a profile during the filling process. + return base::string16(); + } + + return values[variant]; +} + void AutofillProfile::SetRawMultiInfo( ServerFieldType type, const std::vector<base::string16>& values) { @@ -352,58 +368,6 @@ void AutofillProfile::GetMultiInfo(const AutofillType& type, GetMultiInfoImpl(type, app_locale, values); } -void AutofillProfile::FillFormField(const AutofillField& field, - size_t variant, - const std::string& app_locale, - FormFieldData* field_data) const { - AutofillType type = field.Type(); - DCHECK_NE(CREDIT_CARD, type.group()); - DCHECK(field_data); - - if (type.GetStorableType() == PHONE_HOME_NUMBER) { - FillPhoneNumberField(field, variant, app_locale, field_data); - } else if (field_data->form_control_type == "select-one") { - FillSelectControl(type, app_locale, field_data); - } else { - std::vector<base::string16> values; - GetMultiInfo(type, app_locale, &values); - if (variant >= values.size()) { - // If the variant is unavailable, bail. This case is reachable, for - // example if Sync updates a profile during the filling process. - return; - } - - field_data->value = values[variant]; - } -} - -void AutofillProfile::FillPhoneNumberField(const AutofillField& field, - size_t variant, - const std::string& app_locale, - FormFieldData* field_data) const { - std::vector<base::string16> values; - GetMultiInfo(field.Type(), app_locale, &values); - DCHECK(variant < values.size()); - - // If we are filling a phone number, check to see if the size field - // matches the "prefix" or "suffix" sizes and fill accordingly. - base::string16 number = values[variant]; - if (number.length() == - PhoneNumber::kPrefixLength + PhoneNumber::kSuffixLength) { - if (field.phone_part() == AutofillField::PHONE_PREFIX || - field_data->max_length == PhoneNumber::kPrefixLength) { - number = number.substr(PhoneNumber::kPrefixOffset, - PhoneNumber::kPrefixLength); - } else if (field.phone_part() == AutofillField::PHONE_SUFFIX || - field_data->max_length == PhoneNumber::kSuffixLength) { - number = number.substr(PhoneNumber::kSuffixOffset, - PhoneNumber::kSuffixLength); - } - } - - field_data->value = number; -} - const base::string16 AutofillProfile::Label() const { return label_; } @@ -661,28 +625,6 @@ void AutofillProfile::GetSupportedTypes( (*it)->GetSupportedTypes(supported_types); } -bool AutofillProfile::FillCountrySelectControl( - const std::string& app_locale, - FormFieldData* field_data) const { - std::string country_code = UTF16ToASCII(GetRawInfo(ADDRESS_HOME_COUNTRY)); - - DCHECK_EQ(field_data->option_values.size(), - field_data->option_contents.size()); - for (size_t i = 0; i < field_data->option_values.size(); ++i) { - // Canonicalize each <option> value to a country code, and compare to the - // target country code. - base::string16 value = field_data->option_values[i]; - base::string16 contents = field_data->option_contents[i]; - if (country_code == AutofillCountry::GetCountryCode(value, app_locale) || - country_code == AutofillCountry::GetCountryCode(contents, app_locale)) { - field_data->value = value; - return true; - } - } - - return false; -} - void AutofillProfile::GetMultiInfoImpl( const AutofillType& type, const std::string& app_locale, diff --git a/components/autofill/core/browser/autofill_profile.h b/components/autofill/core/browser/autofill_profile.h index 5a3f65c756..0611fd3879 100644 --- a/components/autofill/core/browser/autofill_profile.h +++ b/components/autofill/core/browser/autofill_profile.h @@ -54,10 +54,10 @@ class AutofillProfile : public AutofillDataModel { const std::string& app_locale) OVERRIDE; // AutofillDataModel: - virtual void FillFormField(const AutofillField& field, - size_t variant, - const std::string& app_locale, - FormFieldData* field_data) const OVERRIDE; + virtual base::string16 GetInfoForVariant( + const AutofillType& type, + size_t variant, + const std::string& app_locale) const OVERRIDE; // Multi-value equivalents to |GetInfo| and |SetInfo|. void SetRawMultiInfo(ServerFieldType type, @@ -68,15 +68,6 @@ class AutofillProfile : public AutofillDataModel { const std::string& app_locale, std::vector<base::string16>* values) const; - // Set |field_data|'s value for phone number based on contents of |this|. - // The |field| specifies the type of the phone and whether this is a - // phone prefix or suffix. The |variant| parameter specifies which value in a - // multi-valued profile. - void FillPhoneNumberField(const AutofillField& field, - size_t variant, - const std::string& app_locale, - FormFieldData* field_data) const; - // The user-visible label of the profile, generated in relation to other // profiles. Shows at least 2 fields that differentiate profile from other // profiles. See AdjustInferredLabels() further down for more description. @@ -153,8 +144,6 @@ class AutofillProfile : public AutofillDataModel { typedef std::vector<const FormGroup*> FormGroupList; // FormGroup: - virtual bool FillCountrySelectControl(const std::string& app_locale, - FormFieldData* field) const OVERRIDE; virtual void GetSupportedTypes( ServerFieldTypeSet* supported_types) const OVERRIDE; diff --git a/components/autofill/core/browser/autofill_profile_unittest.cc b/components/autofill/core/browser/autofill_profile_unittest.cc index f67c536324..e652fdfd97 100644 --- a/components/autofill/core/browser/autofill_profile_unittest.cc +++ b/components/autofill/core/browser/autofill_profile_unittest.cc @@ -8,7 +8,6 @@ #include "base/memory/scoped_vector.h" #include "base/stl_util.h" #include "base/strings/string16.h" -#include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/autofill_common_test.h" #include "components/autofill/core/browser/autofill_profile.h" @@ -772,132 +771,6 @@ TEST(AutofillProfileTest, MultiValuePhone) { EXPECT_EQ(base::string16(), p.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); } -TEST(AutofillProfileTest, AddressCountryFull) { - const char* const kCountries[] = { - "Albania", "Canada" - }; - std::vector<base::string16> options(arraysize(kCountries)); - for (size_t i = 0; i < arraysize(kCountries); ++i) { - options[i] = ASCIIToUTF16(kCountries[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = options; - field.option_contents = options; - - AutofillProfile profile(base::GenerateGUID(), "https://www.example.com/"); - profile.SetRawInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("CA")); - profile.FillSelectControl( - AutofillType(ADDRESS_HOME_COUNTRY), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("Canada"), field.value); -} - -TEST(AutofillProfileTest, AddressCountryAbbrev) { - const char* const kCountries[] = { - "AL", "CA" - }; - std::vector<base::string16> options(arraysize(kCountries)); - for (size_t i = 0; i < arraysize(kCountries); ++i) { - options[i] = ASCIIToUTF16(kCountries[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = options; - field.option_contents = options; - - AutofillProfile profile(base::GenerateGUID(), "https://www.example.com/"); - profile.SetRawInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("CA")); - profile.FillSelectControl( - AutofillType(ADDRESS_HOME_COUNTRY), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("CA"), field.value); -} - -TEST(AutofillProfileTest, AddressStateFull) { - const char* const kStates[] = { - "Alabama", "California" - }; - std::vector<base::string16> options(arraysize(kStates)); - for (size_t i = 0; i < arraysize(kStates); ++i) { - options[i] = ASCIIToUTF16(kStates[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = options; - field.option_contents = options; - - AutofillProfile profile(base::GenerateGUID(), "https://www.example.com/"); - profile.SetRawInfo(ADDRESS_HOME_STATE, ASCIIToUTF16("CA")); - profile.FillSelectControl(AutofillType(ADDRESS_HOME_STATE), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("California"), field.value); -} - -TEST(AutofillProfileTest, AddressStateAbbrev) { - const char* const kStates[] = { - "AL", "CA" - }; - std::vector<base::string16> options(arraysize(kStates)); - for (size_t i = 0; i < arraysize(kStates); ++i) { - options[i] = ASCIIToUTF16(kStates[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = options; - field.option_contents = options; - - AutofillProfile profile(base::GenerateGUID(), "https://www.example.com/"); - profile.SetRawInfo(ADDRESS_HOME_STATE, ASCIIToUTF16("California")); - profile.FillSelectControl(AutofillType(ADDRESS_HOME_STATE), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("CA"), field.value); -} - -TEST(AutofillProfileTest, FillByValue) { - const char* const kStates[] = { - "Alabama", "California" - }; - std::vector<base::string16> values(arraysize(kStates)); - std::vector<base::string16> contents(arraysize(kStates)); - for (unsigned int i = 0; i < arraysize(kStates); ++i) { - values[i] = ASCIIToUTF16(kStates[i]); - contents[i] = ASCIIToUTF16(base::StringPrintf("%u", i)); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = values; - field.option_contents = contents; - - AutofillProfile profile(base::GenerateGUID(), "https://www.example.com/"); - profile.SetRawInfo(ADDRESS_HOME_STATE, ASCIIToUTF16("California")); - profile.FillSelectControl(AutofillType(ADDRESS_HOME_STATE), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("California"), field.value); -} - -TEST(AutofillProfileTest, FillByContents) { - const char* const kStates[] = { - "Alabama", "California" - }; - std::vector<base::string16> values(arraysize(kStates)); - std::vector<base::string16> contents(arraysize(kStates)); - for (unsigned int i = 0; i < arraysize(kStates); ++i) { - values[i] = ASCIIToUTF16(base::StringPrintf("%u", i + 1)); - contents[i] = ASCIIToUTF16(kStates[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = values; - field.option_contents = contents; - - AutofillProfile profile(base::GenerateGUID(), "https://www.example.com/"); - profile.SetRawInfo(ADDRESS_HOME_STATE, ASCIIToUTF16("California")); - profile.FillSelectControl(AutofillType(ADDRESS_HOME_STATE), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("2"), field.value); -} - TEST(AutofillProfileTest, IsPresentButInvalid) { AutofillProfile profile(base::GenerateGUID(), "https://www.example.com/"); EXPECT_FALSE(profile.IsPresentButInvalid(ADDRESS_HOME_STATE)); diff --git a/components/autofill/core/browser/autofill_regex_constants.cc.utf8 b/components/autofill/core/browser/autofill_regex_constants.cc.utf8 index 960f43269d..a39a9cf95b 100644 --- a/components/autofill/core/browser/autofill_regex_constants.cc.utf8 +++ b/components/autofill/core/browser/autofill_regex_constants.cc.utf8 @@ -77,6 +77,7 @@ const char kCountryRe[] = "|국가|나라"; // ko-KR const char kZipCodeRe[] = "zip|postal|post.*code|pcode|^1z$" + "|pin.?code" // en-IN "|postleitzahl" // de-DE "|\\bcp\\b" // es "|\\bcdp\\b" // fr-FR diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc index a3e3044f18..9617798326 100644 --- a/components/autofill/core/browser/credit_card.cc +++ b/components/autofill/core/browser/credit_card.cc @@ -534,31 +534,6 @@ bool CreditCard::UpdateFromImportedCard(const CreditCard& imported_card, return true; } -void CreditCard::FillFormField(const AutofillField& field, - size_t /*variant*/, - const std::string& app_locale, - FormFieldData* field_data) const { - DCHECK_EQ(CREDIT_CARD, field.Type().group()); - DCHECK(field_data); - - if (field_data->form_control_type == "select-one") { - FillSelectControl(field.Type(), app_locale, field_data); - } else if (field_data->form_control_type == "month") { - // HTML5 input="month" consists of year-month. - base::string16 year = - GetInfo(AutofillType(CREDIT_CARD_EXP_4_DIGIT_YEAR), app_locale); - base::string16 month = - GetInfo(AutofillType(CREDIT_CARD_EXP_MONTH), app_locale); - if (!year.empty() && !month.empty()) { - // Fill the value only if |this| includes both year and month - // information. - field_data->value = year + ASCIIToUTF16("-") + month; - } - } else { - field_data->value = GetInfo(field.Type(), app_locale); - } -} - int CreditCard::Compare(const CreditCard& credit_card) const { // The following CreditCard field types are the only types we store in the // WebDB so far, so we're only concerned with matching these types in the diff --git a/components/autofill/core/browser/credit_card.h b/components/autofill/core/browser/credit_card.h index d5bf1a0f7d..4c92e62bfd 100644 --- a/components/autofill/core/browser/credit_card.h +++ b/components/autofill/core/browser/credit_card.h @@ -59,12 +59,6 @@ class CreditCard : public AutofillDataModel { const base::string16& value, const std::string& app_locale) OVERRIDE; - // AutofillDataModel: - virtual void FillFormField(const AutofillField& field, - size_t variant, - const std::string& app_locale, - FormFieldData* field_data) const OVERRIDE; - // Credit card preview summary, for example: ******1234, Exp: 01/2020 const base::string16 Label() const; diff --git a/components/autofill/core/browser/credit_card_field.cc b/components/autofill/core/browser/credit_card_field.cc index bba804c958..f9012caf98 100644 --- a/components/autofill/core/browser/credit_card_field.cc +++ b/components/autofill/core/browser/credit_card_field.cc @@ -95,7 +95,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { } if (LowerCaseEqualsASCII(scanner->Cursor()->form_control_type, "month")) { - credit_card_field->expiration_month_ = scanner->Cursor(); + credit_card_field->expiration_date_ = scanner->Cursor(); scanner->Advance(); } else { // First try to parse split month/year expiration fields. @@ -170,10 +170,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { if ((credit_card_field->number_ || credit_card_field->verification_) && (credit_card_field->expiration_date_ || (credit_card_field->expiration_month_ && - (credit_card_field->expiration_year_ || - (LowerCaseEqualsASCII( - credit_card_field->expiration_month_->form_control_type, - "month")))))) { + credit_card_field->expiration_year_))) { return credit_card_field.release(); } diff --git a/components/autofill/core/browser/credit_card_field.h b/components/autofill/core/browser/credit_card_field.h index 119e1ab79d..bf45e7ee6e 100644 --- a/components/autofill/core/browser/credit_card_field.h +++ b/components/autofill/core/browser/credit_card_field.h @@ -27,15 +27,7 @@ class CreditCardField : public FormField { virtual bool ClassifyField(ServerFieldTypeMap* map) const OVERRIDE; private: - FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseMiniumCreditCard); - FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseFullCreditCard); - FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseCreditCardType); - FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseExpMonthYear); - FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseExpMonthYear2); - FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseExpField); - FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, ParseExpField2DigitYear); - FRIEND_TEST_ALL_PREFIXES(CreditCardFieldTest, - ParseCreditCardHolderNameWithCCFullName); + friend class CreditCardFieldTest; CreditCardField(); diff --git a/components/autofill/core/browser/credit_card_field_unittest.cc b/components/autofill/core/browser/credit_card_field_unittest.cc index 9f60a1d6bd..073e5d7a6b 100644 --- a/components/autofill/core/browser/credit_card_field_unittest.cc +++ b/components/autofill/core/browser/credit_card_field_unittest.cc @@ -16,15 +16,25 @@ namespace autofill { class CreditCardFieldTest : public testing::Test { public: CreditCardFieldTest() {} + virtual ~CreditCardFieldTest() {} protected: ScopedVector<const AutofillField> list_; - scoped_ptr<CreditCardField> field_; + scoped_ptr<const CreditCardField> field_; ServerFieldTypeMap field_type_map_; - // Downcast for tests. - static CreditCardField* Parse(AutofillScanner* scanner) { - return static_cast<CreditCardField*>(CreditCardField::Parse(scanner)); + // Parses the contents of |list_| as a form, and stores the result into + // |field_|. + void Parse() { + AutofillScanner scanner(list_.get()); + field_.reset( + static_cast<const CreditCardField*>(CreditCardField::Parse(&scanner))); + } + + // Associates fields with their corresponding types, based on the previous + // call to Parse(). + bool ClassifyField() { + return field_->ClassifyField(&field_type_map_); } private: @@ -32,15 +42,13 @@ class CreditCardFieldTest : public testing::Test { }; TEST_F(CreditCardFieldTest, Empty) { - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_EQ(static_cast<CreditCardField*>(NULL), field_.get()); } TEST_F(CreditCardFieldTest, NonParse) { list_.push_back(new AutofillField); - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_EQ(static_cast<CreditCardField*>(NULL), field_.get()); } @@ -56,8 +64,7 @@ TEST_F(CreditCardFieldTest, ParseCreditCardNoNumber) { field.name = ASCIIToUTF16("ccyear"); list_.push_back(new AutofillField(field, ASCIIToUTF16("year2"))); - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_EQ(static_cast<CreditCardField*>(NULL), field_.get()); } @@ -69,8 +76,7 @@ TEST_F(CreditCardFieldTest, ParseCreditCardNoDate) { field.name = ASCIIToUTF16("card_number"); list_.push_back(new AutofillField(field, ASCIIToUTF16("number1"))); - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_EQ(static_cast<CreditCardField*>(NULL), field_.get()); } @@ -90,10 +96,9 @@ TEST_F(CreditCardFieldTest, ParseMiniumCreditCard) { field.name = ASCIIToUTF16("ccyear"); list_.push_back(new AutofillField(field, ASCIIToUTF16("year3"))); - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_NE(static_cast<CreditCardField*>(NULL), field_.get()); - ASSERT_TRUE(field_->ClassifyField(&field_type_map_)); + EXPECT_TRUE(ClassifyField()); ASSERT_TRUE( field_type_map_.find(ASCIIToUTF16("number1")) != field_type_map_.end()); EXPECT_EQ(CREDIT_CARD_NUMBER, field_type_map_[ASCIIToUTF16("number1")]); @@ -134,10 +139,9 @@ TEST_F(CreditCardFieldTest, ParseFullCreditCard) { field.name = ASCIIToUTF16("verification"); list_.push_back(new AutofillField(field, ASCIIToUTF16("cvc"))); - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_NE(static_cast<CreditCardField*>(NULL), field_.get()); - ASSERT_TRUE(field_->ClassifyField(&field_type_map_)); + EXPECT_TRUE(ClassifyField()); ASSERT_TRUE( field_type_map_.find(ASCIIToUTF16("type")) != field_type_map_.end()); EXPECT_EQ(CREDIT_CARD_TYPE, field_type_map_[ASCIIToUTF16("type")]); @@ -180,10 +184,9 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear) { field.name = ASCIIToUTF16("ExpDate"); list_.push_back(new AutofillField(field, ASCIIToUTF16("year4"))); - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_NE(static_cast<CreditCardField*>(NULL), field_.get()); - ASSERT_TRUE(field_->ClassifyField(&field_type_map_)); + EXPECT_TRUE(ClassifyField()); ASSERT_TRUE( field_type_map_.find(ASCIIToUTF16("name1")) != field_type_map_.end()); EXPECT_EQ(CREDIT_CARD_NAME, field_type_map_[ASCIIToUTF16("name1")]); @@ -219,10 +222,9 @@ TEST_F(CreditCardFieldTest, ParseExpMonthYear2) { field.name = ASCIIToUTF16("ExpDate"); list_.push_back(new AutofillField(field, ASCIIToUTF16("year4"))); - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_NE(static_cast<CreditCardField*>(NULL), field_.get()); - ASSERT_TRUE(field_->ClassifyField(&field_type_map_)); + EXPECT_TRUE(ClassifyField()); ASSERT_TRUE( field_type_map_.find(ASCIIToUTF16("name1")) != field_type_map_.end()); EXPECT_EQ(CREDIT_CARD_NAME, field_type_map_[ASCIIToUTF16("name1")]); @@ -254,10 +256,9 @@ TEST_F(CreditCardFieldTest, ParseExpField) { field.name = ASCIIToUTF16("cc_exp"); list_.push_back(new AutofillField(field, ASCIIToUTF16("exp3"))); - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_NE(static_cast<CreditCardField*>(NULL), field_.get()); - ASSERT_TRUE(field_->ClassifyField(&field_type_map_)); + EXPECT_TRUE(ClassifyField()); ASSERT_TRUE( field_type_map_.find(ASCIIToUTF16("name1")) != field_type_map_.end()); EXPECT_EQ(CREDIT_CARD_NAME, field_type_map_[ASCIIToUTF16("name1")]); @@ -286,10 +287,9 @@ TEST_F(CreditCardFieldTest, ParseExpField2DigitYear) { field.name = ASCIIToUTF16("cc_exp"); list_.push_back(new AutofillField(field, ASCIIToUTF16("exp3"))); - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_NE(static_cast<CreditCardField*>(NULL), field_.get()); - ASSERT_TRUE(field_->ClassifyField(&field_type_map_)); + EXPECT_TRUE(ClassifyField()); ASSERT_TRUE( field_type_map_.find(ASCIIToUTF16("name1")) != field_type_map_.end()); EXPECT_EQ(CREDIT_CARD_NAME, field_type_map_[ASCIIToUTF16("name1")]); @@ -310,13 +310,39 @@ TEST_F(CreditCardFieldTest, ParseCreditCardHolderNameWithCCFullName) { field.name = ASCIIToUTF16("ccfullname"); list_.push_back(new AutofillField(field, ASCIIToUTF16("name1"))); - AutofillScanner scanner(list_.get()); - field_.reset(Parse(&scanner)); + Parse(); ASSERT_NE(static_cast<CreditCardField*>(NULL), field_.get()); - ASSERT_TRUE(field_->ClassifyField(&field_type_map_)); + EXPECT_TRUE(ClassifyField()); ASSERT_TRUE( field_type_map_.find(ASCIIToUTF16("name1")) != field_type_map_.end()); EXPECT_EQ(CREDIT_CARD_NAME, field_type_map_[ASCIIToUTF16("name1")]); } +// Verifies that <input type="month"> controls are able to be parsed correctly. +TEST_F(CreditCardFieldTest, ParseMonthControl) { + FormFieldData field; + + field.form_control_type = "text"; + field.label = ASCIIToUTF16("Card number:"); + field.name = ASCIIToUTF16("ccnumber"); + list_.push_back(new AutofillField(field, ASCIIToUTF16("number1"))); + + field.form_control_type = "month"; + field.label = ASCIIToUTF16("Expiration date:"); + field.name = ASCIIToUTF16("ccexp"); + list_.push_back(new AutofillField(field, ASCIIToUTF16("date2"))); + + Parse(); + ASSERT_NE(static_cast<CreditCardField*>(NULL), field_.get()); + EXPECT_TRUE(ClassifyField()); + ASSERT_TRUE( + field_type_map_.find(ASCIIToUTF16("number1")) != field_type_map_.end()); + EXPECT_EQ(CREDIT_CARD_NUMBER, + field_type_map_[ASCIIToUTF16("number1")]); + ASSERT_TRUE( + field_type_map_.find(ASCIIToUTF16("date2")) != field_type_map_.end()); + EXPECT_EQ(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR, + field_type_map_[ASCIIToUTF16("date2")]); +} + } // namespace autofill diff --git a/components/autofill/core/browser/credit_card_unittest.cc b/components/autofill/core/browser/credit_card_unittest.cc index 837d729f97..ee3b7d937a 100644 --- a/components/autofill/core/browser/credit_card_unittest.cc +++ b/components/autofill/core/browser/credit_card_unittest.cc @@ -360,172 +360,6 @@ TEST(CreditCardTest, CreditCardVerificationCode) { } -TEST(CreditCardTest, CreditCardMonthExact) { - const char* const kMonthsNumeric[] = { - "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", - }; - std::vector<base::string16> options(arraysize(kMonthsNumeric)); - for (size_t i = 0; i < arraysize(kMonthsNumeric); ++i) { - options[i] = ASCIIToUTF16(kMonthsNumeric[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = options; - field.option_contents = options; - - CreditCard credit_card(base::GenerateGUID(), "https://www.example.com/"); - credit_card.SetRawInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("01")); - credit_card.FillSelectControl( - AutofillType(CREDIT_CARD_EXP_MONTH), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("01"), field.value); -} - -TEST(CreditCardTest, CreditCardMonthAbbreviated) { - const char* const kMonthsAbbreviated[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", - }; - std::vector<base::string16> options(arraysize(kMonthsAbbreviated)); - for (size_t i = 0; i < arraysize(kMonthsAbbreviated); ++i) { - options[i] = ASCIIToUTF16(kMonthsAbbreviated[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = options; - field.option_contents = options; - - CreditCard credit_card(base::GenerateGUID(), "https://www.example.com/"); - credit_card.SetRawInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("01")); - credit_card.FillSelectControl( - AutofillType(CREDIT_CARD_EXP_MONTH), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("Jan"), field.value); -} - -TEST(CreditCardTest, CreditCardMonthFull) { - const char* const kMonthsFull[] = { - "January", "February", "March", "April", "May", "June", - "July", "August", "September", "October", "November", "December", - }; - std::vector<base::string16> options(arraysize(kMonthsFull)); - for (size_t i = 0; i < arraysize(kMonthsFull); ++i) { - options[i] = ASCIIToUTF16(kMonthsFull[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = options; - field.option_contents = options; - - CreditCard credit_card(base::GenerateGUID(), "https://www.example.com/"); - credit_card.SetRawInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("01")); - credit_card.FillSelectControl( - AutofillType(CREDIT_CARD_EXP_MONTH), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("January"), field.value); -} - -TEST(CreditCardTest, CreditCardMonthNumeric) { - const char* const kMonthsNumeric[] = { - "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", - }; - std::vector<base::string16> options(arraysize(kMonthsNumeric)); - for (size_t i = 0; i < arraysize(kMonthsNumeric); ++i) { - options[i] = ASCIIToUTF16(kMonthsNumeric[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = options; - field.option_contents = options; - - CreditCard credit_card(base::GenerateGUID(), "https://www.example.com/"); - credit_card.SetRawInfo(CREDIT_CARD_EXP_MONTH, ASCIIToUTF16("01")); - credit_card.FillSelectControl( - AutofillType(CREDIT_CARD_EXP_MONTH), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("1"), field.value); -} - -TEST(CreditCardTest, CreditCardTwoDigitYear) { - const char* const kYears[] = { - "12", "13", "14", "15", "16", "17", "18", "19" - }; - std::vector<base::string16> options(arraysize(kYears)); - for (size_t i = 0; i < arraysize(kYears); ++i) { - options[i] = ASCIIToUTF16(kYears[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = options; - field.option_contents = options; - - CreditCard credit_card(base::GenerateGUID(), "https://www.example.com/"); - credit_card.SetRawInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR, ASCIIToUTF16("2017")); - credit_card.FillSelectControl( - AutofillType(CREDIT_CARD_EXP_4_DIGIT_YEAR), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("17"), field.value); - EXPECT_EQ(2017, credit_card.expiration_year()); -} - -TEST(CreditCardTest, CreditCardTypeSelectControl) { - const char* const kCreditCardTypes[] = { - "Visa", "Master Card", "AmEx", "discover" - }; - std::vector<base::string16> options(arraysize(kCreditCardTypes)); - for (size_t i = 0; i < arraysize(kCreditCardTypes); ++i) { - options[i] = ASCIIToUTF16(kCreditCardTypes[i]); - } - - FormFieldData field; - field.form_control_type = "select-one"; - field.option_values = options; - field.option_contents = options; - - // Credit card types are inferred from the numbers, so we use test numbers for - // each card type. Test card numbers are drawn from - // http://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm - - { - // Normal case: - CreditCard credit_card(base::GenerateGUID(), "https://www.example.com/"); - credit_card.SetRawInfo(CREDIT_CARD_NUMBER, - ASCIIToUTF16("4111111111111111")); - credit_card.FillSelectControl( - AutofillType(CREDIT_CARD_TYPE), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("Visa"), field.value); - } - - { - // Filling should be able to handle intervening whitespace: - CreditCard credit_card(base::GenerateGUID(), "https://www.example.com/"); - credit_card.SetRawInfo(CREDIT_CARD_NUMBER, - ASCIIToUTF16("5105105105105100")); - credit_card.FillSelectControl( - AutofillType(CREDIT_CARD_TYPE), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("Master Card"), field.value); - } - - { - // American Express is sometimes abbreviated as AmEx: - CreditCard credit_card(base::GenerateGUID(), "https://www.example.com/"); - credit_card.SetRawInfo(CREDIT_CARD_NUMBER, ASCIIToUTF16("371449635398431")); - credit_card.FillSelectControl( - AutofillType(CREDIT_CARD_TYPE), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("AmEx"), field.value); - } - - { - // Case insensitivity: - CreditCard credit_card(base::GenerateGUID(), "https://www.example.com/"); - credit_card.SetRawInfo(CREDIT_CARD_NUMBER, - ASCIIToUTF16("6011111111111117")); - credit_card.FillSelectControl( - AutofillType(CREDIT_CARD_TYPE), "en-US", &field); - EXPECT_EQ(ASCIIToUTF16("discover"), field.value); - } -} - TEST(CreditCardTest, GetCreditCardType) { struct { std::string card_number; diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc index 1ea9913bd0..37e0bc98e8 100644 --- a/components/autofill/core/browser/form_structure.cc +++ b/components/autofill/core/browser/form_structure.cc @@ -334,8 +334,7 @@ FormStructure::FormStructure(const FormData& form) std::map<base::string16, size_t> unique_names; for (std::vector<FormFieldData>::const_iterator field = form.fields.begin(); - field != form.fields.end(); field++) { - + field != form.fields.end(); ++field) { if (!ShouldSkipField(*field)) { // Add all supported form fields (including with empty names) to the // signature. This is a requirement for Autofill servers. diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc index 5c9c80ceea..9298047bca 100644 --- a/components/autofill/core/browser/personal_data_manager.cc +++ b/components/autofill/core/browser/personal_data_manager.cc @@ -291,7 +291,7 @@ bool PersonalDataManager::ImportFormData( if (group == CREDIT_CARD) { if (LowerCaseEqualsASCII(field->form_control_type, "month")) { - DCHECK_EQ(CREDIT_CARD_EXP_MONTH, server_field_type); + DCHECK_EQ(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR, server_field_type); local_imported_credit_card->SetInfoForMonthInputType(value); } else { local_imported_credit_card->SetInfo(field_type, value, app_locale_); diff --git a/components/autofill_content_browser.target.darwin-arm.mk b/components/autofill_content_browser.target.darwin-arm.mk index 9110cde1ba..5dd32d7518 100644 --- a/components/autofill_content_browser.target.darwin-arm.mk +++ b/components/autofill_content_browser.target.darwin-arm.mk @@ -83,13 +83,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -217,13 +217,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_browser.target.darwin-mips.mk b/components/autofill_content_browser.target.darwin-mips.mk index 5e25b7f08a..cef4130365 100644 --- a/components/autofill_content_browser.target.darwin-mips.mk +++ b/components/autofill_content_browser.target.darwin-mips.mk @@ -82,13 +82,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -215,13 +215,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_browser.target.darwin-x86.mk b/components/autofill_content_browser.target.darwin-x86.mk index 5ce77837d0..0f2e381cb3 100644 --- a/components/autofill_content_browser.target.darwin-x86.mk +++ b/components/autofill_content_browser.target.darwin-x86.mk @@ -85,13 +85,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -221,13 +221,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_browser.target.linux-arm.mk b/components/autofill_content_browser.target.linux-arm.mk index 9110cde1ba..5dd32d7518 100644 --- a/components/autofill_content_browser.target.linux-arm.mk +++ b/components/autofill_content_browser.target.linux-arm.mk @@ -83,13 +83,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -217,13 +217,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_browser.target.linux-mips.mk b/components/autofill_content_browser.target.linux-mips.mk index 5e25b7f08a..cef4130365 100644 --- a/components/autofill_content_browser.target.linux-mips.mk +++ b/components/autofill_content_browser.target.linux-mips.mk @@ -82,13 +82,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -215,13 +215,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_browser.target.linux-x86.mk b/components/autofill_content_browser.target.linux-x86.mk index 5ce77837d0..0f2e381cb3 100644 --- a/components/autofill_content_browser.target.linux-x86.mk +++ b/components/autofill_content_browser.target.linux-x86.mk @@ -85,13 +85,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -221,13 +221,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_renderer.target.darwin-arm.mk b/components/autofill_content_renderer.target.darwin-arm.mk index 283cedf54b..5f8096e6fa 100644 --- a/components/autofill_content_renderer.target.darwin-arm.mk +++ b/components/autofill_content_renderer.target.darwin-arm.mk @@ -72,13 +72,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -176,13 +176,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_renderer.target.darwin-mips.mk b/components/autofill_content_renderer.target.darwin-mips.mk index 665d6c0d5c..b8bbb16b26 100644 --- a/components/autofill_content_renderer.target.darwin-mips.mk +++ b/components/autofill_content_renderer.target.darwin-mips.mk @@ -71,13 +71,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -174,13 +174,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_renderer.target.darwin-x86.mk b/components/autofill_content_renderer.target.darwin-x86.mk index b6cfcdaeef..14b01f60ba 100644 --- a/components/autofill_content_renderer.target.darwin-x86.mk +++ b/components/autofill_content_renderer.target.darwin-x86.mk @@ -74,13 +74,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -181,13 +181,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_renderer.target.linux-arm.mk b/components/autofill_content_renderer.target.linux-arm.mk index 283cedf54b..5f8096e6fa 100644 --- a/components/autofill_content_renderer.target.linux-arm.mk +++ b/components/autofill_content_renderer.target.linux-arm.mk @@ -72,13 +72,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -176,13 +176,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_renderer.target.linux-mips.mk b/components/autofill_content_renderer.target.linux-mips.mk index 665d6c0d5c..b8bbb16b26 100644 --- a/components/autofill_content_renderer.target.linux-mips.mk +++ b/components/autofill_content_renderer.target.linux-mips.mk @@ -71,13 +71,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -174,13 +174,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_renderer.target.linux-x86.mk b/components/autofill_content_renderer.target.linux-x86.mk index b6cfcdaeef..14b01f60ba 100644 --- a/components/autofill_content_renderer.target.linux-x86.mk +++ b/components/autofill_content_renderer.target.linux-x86.mk @@ -74,13 +74,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -181,13 +181,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_risk_proto.target.darwin-arm.mk b/components/autofill_content_risk_proto.target.darwin-arm.mk index c57822fcfd..ed089b9742 100644 --- a/components/autofill_content_risk_proto.target.darwin-arm.mk +++ b/components/autofill_content_risk_proto.target.darwin-arm.mk @@ -90,13 +90,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -175,13 +175,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_risk_proto.target.darwin-mips.mk b/components/autofill_content_risk_proto.target.darwin-mips.mk index d604224f0d..68e3671362 100644 --- a/components/autofill_content_risk_proto.target.darwin-mips.mk +++ b/components/autofill_content_risk_proto.target.darwin-mips.mk @@ -89,13 +89,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -173,13 +173,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_risk_proto.target.darwin-x86.mk b/components/autofill_content_risk_proto.target.darwin-x86.mk index 044be20fb8..35d402ccb7 100644 --- a/components/autofill_content_risk_proto.target.darwin-x86.mk +++ b/components/autofill_content_risk_proto.target.darwin-x86.mk @@ -92,13 +92,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -180,13 +180,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_risk_proto.target.linux-arm.mk b/components/autofill_content_risk_proto.target.linux-arm.mk index c57822fcfd..ed089b9742 100644 --- a/components/autofill_content_risk_proto.target.linux-arm.mk +++ b/components/autofill_content_risk_proto.target.linux-arm.mk @@ -90,13 +90,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -175,13 +175,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_risk_proto.target.linux-mips.mk b/components/autofill_content_risk_proto.target.linux-mips.mk index d604224f0d..68e3671362 100644 --- a/components/autofill_content_risk_proto.target.linux-mips.mk +++ b/components/autofill_content_risk_proto.target.linux-mips.mk @@ -89,13 +89,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -173,13 +173,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_content_risk_proto.target.linux-x86.mk b/components/autofill_content_risk_proto.target.linux-x86.mk index 044be20fb8..35d402ccb7 100644 --- a/components/autofill_content_risk_proto.target.linux-x86.mk +++ b/components/autofill_content_risk_proto.target.linux-x86.mk @@ -92,13 +92,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -180,13 +180,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_browser.target.darwin-arm.mk b/components/autofill_core_browser.target.darwin-arm.mk index 0afd61f48b..4f50e40c66 100644 --- a/components/autofill_core_browser.target.darwin-arm.mk +++ b/components/autofill_core_browser.target.darwin-arm.mk @@ -112,13 +112,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -246,13 +246,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_browser.target.darwin-mips.mk b/components/autofill_core_browser.target.darwin-mips.mk index f8023a1315..db34df616a 100644 --- a/components/autofill_core_browser.target.darwin-mips.mk +++ b/components/autofill_core_browser.target.darwin-mips.mk @@ -111,13 +111,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -244,13 +244,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_browser.target.darwin-x86.mk b/components/autofill_core_browser.target.darwin-x86.mk index a5910c5d16..193d262331 100644 --- a/components/autofill_core_browser.target.darwin-x86.mk +++ b/components/autofill_core_browser.target.darwin-x86.mk @@ -114,13 +114,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -250,13 +250,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_browser.target.linux-arm.mk b/components/autofill_core_browser.target.linux-arm.mk index 0afd61f48b..4f50e40c66 100644 --- a/components/autofill_core_browser.target.linux-arm.mk +++ b/components/autofill_core_browser.target.linux-arm.mk @@ -112,13 +112,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -246,13 +246,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_browser.target.linux-mips.mk b/components/autofill_core_browser.target.linux-mips.mk index f8023a1315..db34df616a 100644 --- a/components/autofill_core_browser.target.linux-mips.mk +++ b/components/autofill_core_browser.target.linux-mips.mk @@ -111,13 +111,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -244,13 +244,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_browser.target.linux-x86.mk b/components/autofill_core_browser.target.linux-x86.mk index a5910c5d16..193d262331 100644 --- a/components/autofill_core_browser.target.linux-x86.mk +++ b/components/autofill_core_browser.target.linux-x86.mk @@ -114,13 +114,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -250,13 +250,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_common.target.darwin-arm.mk b/components/autofill_core_common.target.darwin-arm.mk index afcde49188..de4f7628fd 100644 --- a/components/autofill_core_common.target.darwin-arm.mk +++ b/components/autofill_core_common.target.darwin-arm.mk @@ -82,13 +82,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -191,13 +191,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_common.target.darwin-mips.mk b/components/autofill_core_common.target.darwin-mips.mk index 8095eab2c8..82cd02be9b 100644 --- a/components/autofill_core_common.target.darwin-mips.mk +++ b/components/autofill_core_common.target.darwin-mips.mk @@ -81,13 +81,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -189,13 +189,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_common.target.darwin-x86.mk b/components/autofill_core_common.target.darwin-x86.mk index 0a1b06199f..3082f8dafa 100644 --- a/components/autofill_core_common.target.darwin-x86.mk +++ b/components/autofill_core_common.target.darwin-x86.mk @@ -84,13 +84,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -195,13 +195,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_common.target.linux-arm.mk b/components/autofill_core_common.target.linux-arm.mk index afcde49188..de4f7628fd 100644 --- a/components/autofill_core_common.target.linux-arm.mk +++ b/components/autofill_core_common.target.linux-arm.mk @@ -82,13 +82,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -191,13 +191,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_common.target.linux-mips.mk b/components/autofill_core_common.target.linux-mips.mk index 8095eab2c8..82cd02be9b 100644 --- a/components/autofill_core_common.target.linux-mips.mk +++ b/components/autofill_core_common.target.linux-mips.mk @@ -81,13 +81,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -189,13 +189,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_core_common.target.linux-x86.mk b/components/autofill_core_common.target.linux-x86.mk index 0a1b06199f..3082f8dafa 100644 --- a/components/autofill_core_common.target.linux-x86.mk +++ b/components/autofill_core_common.target.linux-x86.mk @@ -84,13 +84,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -195,13 +195,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_jni_headers.target.darwin-arm.mk b/components/autofill_jni_headers.target.darwin-arm.mk index b87ef2f369..40660f404f 100644 --- a/components/autofill_jni_headers.target.darwin-arm.mk +++ b/components/autofill_jni_headers.target.darwin-arm.mk @@ -80,13 +80,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -158,13 +158,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_jni_headers.target.darwin-mips.mk b/components/autofill_jni_headers.target.darwin-mips.mk index 342292e7eb..20b8092bf3 100644 --- a/components/autofill_jni_headers.target.darwin-mips.mk +++ b/components/autofill_jni_headers.target.darwin-mips.mk @@ -79,13 +79,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -156,13 +156,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_jni_headers.target.darwin-x86.mk b/components/autofill_jni_headers.target.darwin-x86.mk index f4ade00b7a..ce3d1b3587 100644 --- a/components/autofill_jni_headers.target.darwin-x86.mk +++ b/components/autofill_jni_headers.target.darwin-x86.mk @@ -82,13 +82,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -163,13 +163,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_jni_headers.target.linux-arm.mk b/components/autofill_jni_headers.target.linux-arm.mk index b87ef2f369..40660f404f 100644 --- a/components/autofill_jni_headers.target.linux-arm.mk +++ b/components/autofill_jni_headers.target.linux-arm.mk @@ -80,13 +80,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -158,13 +158,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_jni_headers.target.linux-mips.mk b/components/autofill_jni_headers.target.linux-mips.mk index 342292e7eb..20b8092bf3 100644 --- a/components/autofill_jni_headers.target.linux-mips.mk +++ b/components/autofill_jni_headers.target.linux-mips.mk @@ -79,13 +79,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -156,13 +156,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_jni_headers.target.linux-x86.mk b/components/autofill_jni_headers.target.linux-x86.mk index f4ade00b7a..ce3d1b3587 100644 --- a/components/autofill_jni_headers.target.linux-x86.mk +++ b/components/autofill_jni_headers.target.linux-x86.mk @@ -82,13 +82,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -163,13 +163,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/autofill_strings.grdp b/components/autofill_strings.grdp index 16fe9390d2..8f0621c7d8 100644 --- a/components/autofill_strings.grdp +++ b/components/autofill_strings.grdp @@ -103,4 +103,11 @@ Chrome Autofill settings </message> + <message name="IDS_AUTOFILL_CREDIT_CARD_NOT_SUPPORTED_BY_WALLET" desc="Message displayed to user when user entered a credit card number that is not supported by Google Wallet."> + This type of card is not supported by Google Wallet. Please select a different card. + </message> + <message name="IDS_AUTOFILL_CREDIT_CARD_NOT_SUPPORTED_BY_WALLET_FOR_MERCHANT" desc="Message displayed to user when user entered a credit card number that is not supported by Google Wallet for the particular merchant site the user is on."> + This type of card is not supported by Google Wallet for this merchant. Please select a different card. + </message> + </grit-part> diff --git a/components/breakpad.gypi b/components/breakpad.gypi index b125713db4..f613bfb953 100644 --- a/components/breakpad.gypi +++ b/components/breakpad.gypi @@ -101,6 +101,9 @@ 'variables': { 'breakpad_component_target': 1, }, + 'defines': [ + 'COMPILE_CONTENT_STATICALLY', + ], 'dependencies': [ '../base/base.gyp:base_nacl_win64', '../breakpad/breakpad.gyp:breakpad_handler_win64', diff --git a/components/breakpad/app/breakpad_client.cc b/components/breakpad/app/breakpad_client.cc index 0c488da67b..16f7dc774c 100644 --- a/components/breakpad/app/breakpad_client.cc +++ b/components/breakpad/app/breakpad_client.cc @@ -50,7 +50,7 @@ bool BreakpadClient::ShouldShowRestartDialog(base::string16* title, } bool BreakpadClient::AboutToRestart() { - return true; + return false; } bool BreakpadClient::GetDeferredUploadsSupported(bool is_per_usr_install) { @@ -58,7 +58,7 @@ bool BreakpadClient::GetDeferredUploadsSupported(bool is_per_usr_install) { } bool BreakpadClient::GetIsPerUserInstall(const base::FilePath& exe_path) { - return false; + return true; } bool BreakpadClient::GetShouldDumpLargerDumps(bool is_per_user_install) { @@ -100,7 +100,7 @@ size_t BreakpadClient::RegisterCrashKeys() { } bool BreakpadClient::IsRunningUnattended() { - return false; + return true; } #if defined(OS_WIN) || defined(OS_MACOSX) diff --git a/components/breakpad/app/breakpad_win.cc b/components/breakpad/app/breakpad_win.cc index 84ee9bbfe1..e2fca70f57 100644 --- a/components/breakpad/app/breakpad_win.cc +++ b/components/breakpad/app/breakpad_win.cc @@ -421,6 +421,9 @@ long WINAPI ServiceExceptionFilter(EXCEPTION_POINTERS* info) { // before doing so! extern "C" void __declspec(dllexport) __cdecl SetCrashKeyValueImpl( const wchar_t* key, const wchar_t* value) { + if (!g_dynamic_entries) + return; + // CustomInfoEntry limits the length of key and value. If they exceed // their maximum length the underlying string handling functions raise // an exception and prematurely trigger a crash. Truncate here. @@ -448,6 +451,9 @@ extern "C" void __declspec(dllexport) __cdecl SetCrashKeyValueImpl( extern "C" void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl( const wchar_t* key) { + if (!g_dynamic_entries) + return; + std::wstring key_string(key); DynamicEntriesMap::iterator it = g_dynamic_entries->find(key_string); if (it == g_dynamic_entries->end()) diff --git a/components/breakpad/tools/dmp2minidump.py b/components/breakpad/tools/dmp2minidump.py new file mode 100755 index 0000000000..7823d48368 --- /dev/null +++ b/components/breakpad/tools/dmp2minidump.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""A tool to extract minidumps from dmp crash dumps.""" + +import os +import sys +from cgi import parse_multipart + + +def ProcessDump(dump_file, minidump_file): + """Extracts the part of the dump file that minidump_stackwalk can read. + + The dump files generated by the breakpad integration multi-part form data + that include the minidump as file attachment. + + Args: + dump_file: the dump file that needs to be processed. + minidump_file: the file to write the minidump to. + """ + try: + dump = open(dump_file, 'rb') + boundary = dump.readline().strip()[2:] + data = parse_multipart(dump, {'boundary': boundary}) + except: + print 'Failed to read dmp file %s' % dump_file + return + + if not 'upload_file_minidump' in data: + print 'Could not find minidump file in dump.' + return + + f = open(minidump_file, 'w') + f.write("\r\n".join(data['upload_file_minidump'])) + f.close() + + +def main(): + if len(sys.argv) != 3: + print 'Usage: %s [dmp file] [minidump]' % sys.argv[0] + print '' + print 'Extracts the minidump stored in the crash dump file' + return 1 + + ProcessDump(sys.argv[1], sys.argv[2]) + + +if '__main__' == __name__: + sys.exit(main()) diff --git a/components/breakpad/tools/generate_breakpad_symbols.py b/components/breakpad/tools/generate_breakpad_symbols.py new file mode 100755 index 0000000000..e7ec3a9ad8 --- /dev/null +++ b/components/breakpad/tools/generate_breakpad_symbols.py @@ -0,0 +1,227 @@ +#!/usr/bin/env python +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""A tool to generate symbols for a binary suitable for breakpad. + +Currently, the tool only supports Linux, Android, and Mac. Support for other +platforms is planned. +""" + +import errno +import optparse +import os +import Queue +import re +import shutil +import subprocess +import sys +import threading + + +CONCURRENT_TASKS=4 + + +def GetCommandOutput(command): + """Runs the command list, returning its output. + + Prints the given command (which should be a list of one or more strings), + then runs it and returns its output (stdout) as a string. + + From chromium_utils. + """ + devnull = open(os.devnull, 'w') + proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=devnull, + bufsize=1) + output = proc.communicate()[0] + return output + + +def GetDumpSymsBinary(build_dir=None): + """Returns the path to the dump_syms binary.""" + DUMP_SYMS = 'dump_syms' + dump_syms_bin = os.path.join(os.path.expanduser(build_dir), DUMP_SYMS) + if not os.access(dump_syms_bin, os.X_OK): + print 'Cannot find %s.' % DUMP_SYMS + sys.exit(1) + + return dump_syms_bin + + +def Resolve(path, exe_path, loader_path, rpaths): + """Resolve a dyld path. + + @executable_path is replaced with |exe_path| + @loader_path is replaced with |loader_path| + @rpath is replaced with the first path in |rpaths| where the referenced file + is found + """ + path = path.replace('@loader_path', loader_path) + path = path.replace('@executable_path', exe_path) + if path.find('@rpath') != -1: + for rpath in rpaths: + new_path = Resolve(path.replace('@rpath', rpath), exe_path, loader_path, + []) + if os.access(new_path, os.X_OK): + return new_path + return '' + return path + + +def GetSharedLibraryDependenciesLinux(binary): + """Return absolute paths to all shared library dependecies of the binary. + + This implementation assumes that we're running on a Linux system.""" + ldd = GetCommandOutput(['ldd', binary]) + lib_re = re.compile('\t.* => (.+) \(.*\)$') + result = [] + for line in ldd.splitlines(): + m = lib_re.match(line) + if m: + result.append(m.group(1)) + return result + + +def GetSharedLibraryDependenciesMac(binary, exe_path): + """Return absolute paths to all shared library dependecies of the binary. + + This implementation assumes that we're running on a Mac system.""" + loader_path = os.path.dirname(binary) + otool = GetCommandOutput(['otool', '-l', binary]).splitlines() + rpaths = [] + for idx, line in enumerate(otool): + if line.find('cmd LC_RPATH') != -1: + m = re.match(' *path (.*) \(offset .*\)$', otool[idx+2]) + rpaths.append(m.group(1)) + + otool = GetCommandOutput(['otool', '-L', binary]).splitlines() + lib_re = re.compile('\t(.*) \(compatibility .*\)$') + deps = [] + for line in otool: + m = lib_re.match(line) + if m: + dep = Resolve(m.group(1), exe_path, loader_path, rpaths) + if dep: + deps.append(os.path.normpath(dep)) + return deps + + +def GetSharedLibraryDependencies(options, binary, exe_path): + """Return absolute paths to all shared library dependecies of the binary.""" + deps = [] + if sys.platform.startswith('linux'): + deps = GetSharedLibraryDependenciesLinux(binary) + elif sys.platform == 'darwin': + deps = GetSharedLibraryDependenciesMac(binary, exe_path) + else: + print "Platform not supported." + sys.exit(1) + + result = [] + build_dir = os.path.abspath(options.build_dir) + for dep in deps: + if (os.access(dep, os.X_OK) and + os.path.abspath(os.path.dirname(dep)).startswith(build_dir)): + result.append(dep) + return result + + +def mkdir_p(path): + """Simulates mkdir -p.""" + try: + os.makedirs(path) + except OSError as e: + if e.errno == errno.EEXIST and os.path.isdir(path): + pass + else: raise + + +def GenerateSymbols(options, binaries): + """Dumps the symbols of binary and places them in the given directory.""" + + queue = Queue.Queue() + + def _Worker(): + while True: + binary = queue.get() + + syms = GetCommandOutput([GetDumpSymsBinary(options.build_dir), + binary]) + module_line = re.match("MODULE [^ ]+ [^ ]+ ([0-9A-F]+) (.*)\n", syms) + output_path = os.path.join(options.symbols_dir, module_line.group(2), + module_line.group(1)) + mkdir_p(output_path) + symbol_file = "%s.sym" % module_line.group(2) + f = open(os.path.join(output_path, symbol_file), 'w') + f.write(syms) + f.close() + + queue.task_done() + + for binary in binaries: + queue.put(binary) + + for _ in range(options.jobs): + t = threading.Thread(target=_Worker) + t.daemon = True + t.start() + + queue.join() + + +def main(): + parser = optparse.OptionParser() + parser.add_option('', '--build-dir', default='', + help='The build output directory.') + parser.add_option('', '--symbols-dir', default='', + help='The directory where to write the symbols file.') + parser.add_option('', '--binary', default='', + help='The path of the binary to generate symbols for.') + parser.add_option('', '--clear', default=False, action='store_true', + help='Clear the symbols directory before writing new ' + 'symbols.') + parser.add_option('-j', '--jobs', default=CONCURRENT_TASKS, action='store', + type='int', help='Number of parallel tasks to run.') + + (options, _) = parser.parse_args() + + if not options.symbols_dir: + print "Required option --symbols-dir missing." + return 1 + + if not options.build_dir: + print "Required option --build-dir missing." + return 1 + + if not options.binary: + print "Required option --binary missing." + return 1 + + if not os.access(options.binary, os.X_OK): + print "Cannot find %s." % options.binary + return 1 + + if options.clear: + try: + shutil.rmtree(options.symbols_dir) + except: + pass + + # Build the transitive closure of all dependencies. + binaries = set([options.binary]) + queue = [options.binary] + exe_path = os.path.dirname(options.binary) + while queue: + deps = GetSharedLibraryDependencies(options, queue.pop(0), exe_path) + new_deps = set(deps) - binaries + binaries |= new_deps + queue.extend(list(new_deps)) + + GenerateSymbols(options, binaries) + + return 0 + + +if '__main__' == __name__: + sys.exit(main()) diff --git a/components/breakpad/tools/process_dumps_linux.py b/components/breakpad/tools/process_dumps_linux.py deleted file mode 100755 index 1f0ba9d898..0000000000 --- a/components/breakpad/tools/process_dumps_linux.py +++ /dev/null @@ -1,300 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2011 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. - -"""A tool to collect crash signatures for Chrome builds on Linux.""" - -import fnmatch -import optparse -import os -import shutil -import subprocess -import struct -import sys -import tempfile - - -def VerifySymbolAndCopyToTempDir(symbol_file, temp_dir, sym_module_name): - """Verify the symbol file looks correct and copy it to the right place - in temp_dir. - - Args: - symbol_file: the path to the symbol file. - temp_dir: the base of the temp directory where the symbol file will reside. - Returns: - True on success. - """ - symbol = open(symbol_file) - signature_line = symbol.readline().strip().split() - symbol.close() - # signature_line should look like: - # MODULE Linux x86 28D8A79A426807B5462CBA24F56746750 chrome - if (len(signature_line) == 5 and signature_line[0] == 'MODULE' and - signature_line[1] == 'Linux' and signature_line[4] == sym_module_name and - len(signature_line[3]) == 33): - dest = os.path.join(temp_dir, signature_line[4], signature_line[3]) - os.makedirs(dest) - dest_file = os.path.join(dest, '%s.sym' % signature_line[4]) - shutil.copyfile(symbol_file, dest_file) - return True - return False - - -def GetCommandOutput(command): - """Runs the command list, returning its output. - - Prints the given command (which should be a list of one or more strings), - then runs it and returns its output (stdout and stderr) as a string. - - If the command exits with an error, raises OSError. - - From chromium_utils. - """ - proc = subprocess.Popen(command, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, bufsize=1) - output = proc.communicate()[0] - if proc.returncode: - raise OSError('%s: %s' % (subprocess.list2cmdline(command), output)) - return output - - -def GetCrashDumpDir(): - """Returns the default crash dump directory used by Chromium.""" - config_home = os.environ.get('XDG_CONFIG_HOME') - if not config_home: - home = os.path.expanduser('~') - if not home: - return '' - config_home = os.path.join(home, '.config') - return os.path.join(config_home, 'chromium', 'Crash Reports') - - -def GetStackTrace(processor_bin, symbol_path, dump_file): - """Gets and prints the stack trace from a crash dump file. - - Args: - processor_bin: the path to the processor. - symbol_path: root dir for the symbols. - dump_file: the path to the dump file. - Returns: - A string representing the stack trace. - """ - # Run processor to analyze crash dump. - cmd = [processor_bin, '-m', dump_file, symbol_path] - - try: - output = GetCommandOutput(cmd) - except OSError: - return 'Cannot get stack trace.' - - # Retrieve stack trace from processor output. Processor output looks like: - # ---------------- - # Debug output - # ... - # Debug output - # Module ... - # ... - # Module ... - # - # N|... <--+ - # ... |--- crashed thread stack trace - # N|... <--+ - # M|... - # ... - # ---------------- - # where each line of the stack trace looks like: - # ThreadNumber|FrameNumber|ExeName|Function|SourceFile|LineNo|Offset - - stack_trace_frames = [] - idx = output.find('\nModule') - if idx >= 0: - output = output[idx+1:] - idx = output.find('\n\n') - if idx >= 0: - output = output[idx+2:].splitlines() - if output: - first_line = output[0].split('|') - if first_line: - crashed_thread = first_line[0] - for line in output: - line_split = line.split('|') - if not line_split: - break - if line_split[0] != crashed_thread: - break - stack_trace_frames.append(line_split) - if not stack_trace_frames: - return 'Cannot get stack trace.' - stack_trace = [] - for frame in stack_trace_frames: - if len(frame) != 7: - continue - (exe, func, source, line, offset) = frame[2:] - if not exe or not source or not line or not offset: - continue - idx = func.find('(') - if idx >= 0: - func = func[:idx] - if not func: - continue - frame_output = '%s!%s+%s [%s @ %s]' % (exe, func, offset, source, line) - stack_trace.append(frame_output) - return '\n'.join(stack_trace) - - -def LocateFiles(pattern, root=os.curdir): - """Yields files matching pattern found in root and its subdirectories. - - An exception is thrown if root doesn't exist. - - From chromium_utils.""" - root = os.path.expanduser(root) - for path, dirs, files in os.walk(os.path.abspath(root)): - for filename in fnmatch.filter(files, pattern): - yield os.path.join(path, filename) - - -def ProcessDump(dump_file, temp_dir): - """Extracts the part of the dump file that minidump_stackwalk can read. - - Args: - dump_file: the dump file that needs to be processed. - temp_dir: the temp directory to put the dump file in. - Returns: - path of the processed dump file. - """ - dump = open(dump_file, 'rb') - dump_data = dump.read() - dump.close() - idx = dump_data.find('MDMP') - if idx < 0: - return '' - - dump_data = dump_data[idx:] - if not dump_data: - return '' - (dump_fd, dump_name) = tempfile.mkstemp(suffix='chromedump', dir=temp_dir) - os.write(dump_fd, dump_data) - os.close(dump_fd) - return dump_name - - -def main_linux(options, args): - # minidump_stackwalk is part of Google Breakpad. You may need to checkout - # the code and build your own copy. http://google-breakpad.googlecode.com/ - LINUX_PROCESSOR = 'minidump_stackwalk' - processor_bin = None - if options.processor_dir: - bin = os.path.join(os.path.expanduser(options.processor_dir), - LINUX_PROCESSOR) - if os.access(bin, os.X_OK): - processor_bin = bin - else: - for path in os.environ['PATH'].split(':'): - bin = os.path.join(path, LINUX_PROCESSOR) - if os.access(bin, os.X_OK): - processor_bin = bin - break - if not processor_bin: - print 'Cannot find minidump_stackwalk.' - return 1 - - if options.symbol_filename: - symbol_file = options.symbol_filename - else: - if options.architecture: - bits = options.architecture - else: - bits = struct.calcsize('P') * 8 - if bits == 32: - symbol_file = 'chrome.breakpad.ia32' - elif bits == 64: - symbol_file = 'chrome.breakpad.x64' - else: - print 'Unknown architecture' - return 1 - - symbol_dir = options.symbol_dir - if not options.symbol_dir: - symbol_dir = os.curdir - symbol_dir = os.path.abspath(os.path.expanduser(symbol_dir)) - symbol_file = os.path.join(symbol_dir, symbol_file) - if not os.path.exists(symbol_file): - print 'Cannot find symbols.' - return 1 - symbol_time = os.path.getmtime(symbol_file) - - dump_files = [] - if options.dump_file: - dump_files.append(options.dump_file) - else: - dump_dir = options.dump_dir - if not dump_dir: - dump_dir = GetCrashDumpDir() - if not dump_dir: - print 'Cannot find dump files.' - return 1 - for dump_file in LocateFiles(pattern='*.dmp', root=dump_dir): - file_time = os.path.getmtime(dump_file) - if file_time < symbol_time: - # Ignore dumps older than symbol file. - continue - dump_files.append(dump_file) - - temp_dir = tempfile.mkdtemp(suffix='chromedump') - if not VerifySymbolAndCopyToTempDir(symbol_file, temp_dir, - options.sym_module_name): - print 'Cannot parse symbols.' - shutil.rmtree(temp_dir) - return 1 - - dump_count = 0 - for dump_file in dump_files: - processed_dump_file = ProcessDump(dump_file, temp_dir) - if not processed_dump_file: - continue - print '-------------------------' - print GetStackTrace(processor_bin, temp_dir, processed_dump_file) - print - os.remove(processed_dump_file) - dump_count += 1 - - shutil.rmtree(temp_dir) - print '%s dumps found' % dump_count - return 0 - - -def main(): - if not sys.platform.startswith('linux'): - return 1 - parser = optparse.OptionParser() - parser.add_option('', '--processor-dir', type='string', default='', - help='The directory where the processor is installed. ' - 'The processor is used to get stack trace from dumps. ' - 'Searches $PATH by default') - parser.add_option('', '--dump-file', type='string', default='', - help='The path of the dump file to be processed. ' - 'Overwrites dump-path.') - parser.add_option('', '--dump-dir', type='string', default='', - help='The directory where dump files are stored. ' - 'Searches this directory if dump-file is not ' - 'specified. Default is the Chromium crash directory.') - parser.add_option('', '--symbol-dir', default='', - help='The directory with the symbols file. [Required]') - parser.add_option('', '--symbol-filename', default='', - help='The name of the symbols file to use. ' - 'This argument overrides --architecture.') - parser.add_option('', '--architecture', type='int', default=None, - help='Override automatic x86/x86-64 detection. ' - 'Valid values are 32 and 64') - parser.add_option('', '--sym-module-name', type='string', default='chrome', - help='The module name for the symbol file. ' - 'Default: chrome') - - (options, args) = parser.parse_args() - return main_linux(options, args) - - -if '__main__' == __name__: - sys.exit(main()) diff --git a/components/components.gyp b/components/components.gyp index 1c2a77444e..d9b31c4a61 100644 --- a/components/components.gyp +++ b/components/components.gyp @@ -14,10 +14,10 @@ 'auto_login_parser.gypi', 'breakpad.gypi', 'browser_context_keyed_service.gypi', - 'components_tests.gypi', 'dom_distiller.gypi', 'json_schema.gypi', 'navigation_interception.gypi', + 'navigation_metrics.gypi', 'onc.gypi', 'plugins.gypi', 'policy.gypi', diff --git a/components/components_tests.gypi b/components/components_tests.gyp index 12a79dc060..02e5df64e5 100644 --- a/components/components_tests.gypi +++ b/components/components_tests.gyp @@ -3,6 +3,12 @@ # found in the LICENSE file. { + 'variables': { + # This turns on e.g. the filename-based detection of which + # platforms to include source files on (e.g. files ending in + # _mac.h or _mac.cc are only compiled on MacOSX). + 'chromium_code': 1, + }, 'conditions': [ ['android_webview_build == 0', { 'targets': [ @@ -10,13 +16,15 @@ 'target_name': 'components_unittests', 'type': '<(gtest_target_type)', 'sources': [ + 'auto_login_parser/auto_login_parser_unittest.cc', 'autofill/core/common/form_data_unittest.cc', 'autofill/core/common/form_field_data_unittest.cc', - 'auto_login_parser/auto_login_parser_unittest.cc', + 'autofill/core/common/password_form_fill_data_unittest.cc', 'browser_context_keyed_service/browser_context_dependency_manager_unittest.cc', 'browser_context_keyed_service/dependency_graph_unittest.cc', 'dom_distiller/core/distiller_url_fetcher_unittest.cc', 'dom_distiller/core/dom_distiller_database_unittest.cc', + 'dom_distiller/core/dom_distiller_model_unittest.cc', 'dom_distiller/core/dom_distiller_store_unittest.cc', 'dom_distiller/core/article_entry_unittest.cc', 'json_schema/json_schema_validator_unittest.cc', @@ -49,55 +57,55 @@ '../testing/gtest.gyp:gtest', # Dependencies of autofill - 'autofill_core_common', + 'components.gyp:autofill_core_common', # Dependencies of auto_login_parser - 'auto_login_parser', + 'components.gyp:auto_login_parser', # Dependencies of browser_context_keyed_service - 'browser_context_keyed_service', + 'components.gyp:browser_context_keyed_service', # Dependencies of dom_distiller - 'distilled_page_proto', - 'dom_distiller_core', + 'components.gyp:distilled_page_proto', + 'components.gyp:dom_distiller_core', # Dependencies of encryptor - 'encryptor', + 'components.gyp:encryptor', # Dependencies of json_schema - 'json_schema', + 'components.gyp:json_schema', # Dependencies of intercept_navigation_resource_throttle_unittest.cc '../content/content_shell_and_tests.gyp:test_support_content', '../skia/skia.gyp:skia', - 'navigation_interception', + 'components.gyp:navigation_interception', # Dependencies of policy - 'policy_component', + 'components.gyp:policy_component', # Dependencies of precache - 'precache_core', - 'precache_core_proto', + 'components.gyp:precache_core', + 'components.gyp:precache_core_proto', # Dependencies of sessions '../third_party/protobuf/protobuf.gyp:protobuf_lite', - 'sessions', - 'sessions_test_support', + 'components.gyp:sessions', + 'components.gyp:sessions_test_support', # Dependencies of translate. - 'translate_common', - 'translate_language_detection', + 'components.gyp:translate_common', + 'components.gyp:translate_language_detection', # Dependencies of variations - 'variations', + 'components.gyp:variations', # Dependencies of visitedlink - 'visitedlink_browser', - 'visitedlink_renderer', + 'components.gyp:visitedlink_browser', + 'components.gyp:visitedlink_renderer', '../content/content_resources.gyp:content_resources', - 'web_modal', - 'web_modal_test_support', + 'components.gyp:web_modal', + 'components.gyp:web_modal_test_support', ], 'conditions': [ ['OS == "ios"', { @@ -121,8 +129,8 @@ 'web_modal/web_contents_modal_dialog_manager_unittest.cc', ], 'dependencies!': [ - 'web_modal', - 'web_modal_test_support', + 'components.gyp:web_modal', + 'components.gyp:web_modal_test_support', ], }], ['OS == "android" and gtest_target_type == "shared_library"', { @@ -165,7 +173,7 @@ '../content/content_shell_and_tests.gyp:test_support_content', '../testing/gtest.gyp:gtest', '../ui/compositor/compositor.gyp:compositor', - 'visitedlink_browser', + 'components.gyp:visitedlink_browser', ], 'include_dirs': [ '..', diff --git a/components/dom_distiller.gypi b/components/dom_distiller.gypi index 4efe807489..abece3fb14 100644 --- a/components/dom_distiller.gypi +++ b/components/dom_distiller.gypi @@ -82,6 +82,8 @@ 'dom_distiller/core/dom_distiller_constants.h', 'dom_distiller/core/dom_distiller_database.cc', 'dom_distiller/core/dom_distiller_database.h', + 'dom_distiller/core/dom_distiller_model.cc', + 'dom_distiller/core/dom_distiller_model.h', 'dom_distiller/core/dom_distiller_service.cc', 'dom_distiller/core/dom_distiller_service.h', 'dom_distiller/core/dom_distiller_store.cc', diff --git a/components/dom_distiller/core/article_entry.cc b/components/dom_distiller/core/article_entry.cc index 2e370a40b7..1550caf2b8 100644 --- a/components/dom_distiller/core/article_entry.cc +++ b/components/dom_distiller/core/article_entry.cc @@ -5,6 +5,7 @@ #include "components/dom_distiller/core/article_entry.h" #include "base/logging.h" +#include "sync/api/sync_change.h" using sync_pb::EntitySpecifics; using sync_pb::ArticlePage; @@ -45,4 +46,24 @@ EntitySpecifics SpecificsFromEntry(const ArticleEntry& entry) { return specifics; } +ArticleEntry GetEntryFromChange(const syncer::SyncChange& change) { + DCHECK(change.IsValid()); + DCHECK(change.sync_data().IsValid()); + return EntryFromSpecifics(change.sync_data().GetSpecifics()); +} + +std::string GetEntryIdFromSyncData(const syncer::SyncData& data) { + const EntitySpecifics& entity = data.GetSpecifics(); + DCHECK(entity.has_article()); + const ArticleSpecifics& specifics = entity.article(); + DCHECK(specifics.has_entry_id()); + return specifics.entry_id(); +} + +syncer::SyncData CreateLocalData(const ArticleEntry& entry) { + EntitySpecifics specifics = SpecificsFromEntry(entry); + const std::string& entry_id = entry.entry_id(); + return syncer::SyncData::CreateLocalData(entry_id, entry_id, specifics); +} + } // namespace dom_distiller diff --git a/components/dom_distiller/core/article_entry.h b/components/dom_distiller/core/article_entry.h index 38116126a3..388dc51e18 100644 --- a/components/dom_distiller/core/article_entry.h +++ b/components/dom_distiller/core/article_entry.h @@ -5,9 +5,14 @@ #ifndef COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ENTRY_H_ #define COMPONENTS_DOM_DISTILLER_CORE_ARTICLE_ENTRY_H_ +#include "sync/api/sync_data.h" #include "sync/protocol/article_specifics.pb.h" #include "sync/protocol/sync.pb.h" +namespace syncer { +class SyncChange; +} + namespace dom_distiller { typedef sync_pb::ArticleSpecifics ArticleEntry; @@ -20,6 +25,11 @@ bool AreEntriesEqual(const ArticleEntry& left, const ArticleEntry& right); sync_pb::EntitySpecifics SpecificsFromEntry(const ArticleEntry& entry); ArticleEntry EntryFromSpecifics(const sync_pb::EntitySpecifics& specifics); +ArticleEntry GetEntryFromChange(const syncer::SyncChange& change); +std::string GetEntryIdFromSyncData(const syncer::SyncData& data); +syncer::SyncData CreateLocalData(const ArticleEntry& entry); + + } // namespace dom_distiller #endif diff --git a/components/dom_distiller/core/dom_distiller_model.cc b/components/dom_distiller/core/dom_distiller_model.cc new file mode 100644 index 0000000000..79a95ab068 --- /dev/null +++ b/components/dom_distiller/core/dom_distiller_model.cc @@ -0,0 +1,208 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/dom_distiller/core/dom_distiller_model.h" + +using syncer::SyncChange; +using syncer::SyncChangeList; +using syncer::SyncData; +using syncer::SyncDataList; + +namespace dom_distiller { + +DomDistillerModel::DomDistillerModel() + : next_key_(1) {} + +DomDistillerModel::DomDistillerModel( + const std::vector<ArticleEntry>& initial_data) + : next_key_(1) { + for (size_t i = 0; i < initial_data.size(); ++i) { + AddEntry(initial_data[i]); + } +} + +DomDistillerModel::~DomDistillerModel() {} + +bool DomDistillerModel::GetEntryById(const std::string& entry_id, + ArticleEntry* entry) const { + KeyType key = 0; + if (!GetKeyById(entry_id, &key)) { + return false; + } + GetEntryByKey(key, entry); + return true; +} + +bool DomDistillerModel::GetEntryByUrl(const GURL& url, + ArticleEntry* entry) const { + KeyType key = 0; + if (!GetKeyByUrl(url, &key)) { + return false; + } + GetEntryByKey(key, entry); + return true; +} + +bool DomDistillerModel::GetKeyById(const std::string& entry_id, + KeyType* key) const { + StringToKeyMap::const_iterator it = entry_id_to_key_map_.find(entry_id); + if (it == entry_id_to_key_map_.end()) { + return false; + } + if (key != NULL) { + *key = it->second; + } + return true; +} + +bool DomDistillerModel::GetKeyByUrl(const GURL& url, KeyType* key) const { + StringToKeyMap::const_iterator it = url_to_key_map_.find(url.spec()); + if (it == url_to_key_map_.end()) { + return false; + } + if (key != NULL) { + *key = it->second; + } + return true; +} + +void DomDistillerModel::GetEntryByKey(KeyType key, ArticleEntry* entry) const { + if (entry != NULL) { + EntryMap::const_iterator it = entries_.find(key); + DCHECK(it != entries_.end()); + *entry = it->second; + } +} + +size_t DomDistillerModel::GetNumEntries() const { + return entries_.size(); +} + +std::vector<ArticleEntry> DomDistillerModel::GetEntries() const { + std::vector<ArticleEntry> entries_list; + for (EntryMap::const_iterator it = entries_.begin(); it != entries_.end(); + ++it) { + entries_list.push_back(it->second); + } + return entries_list; +} + +SyncDataList DomDistillerModel::GetAllSyncData() const { + SyncDataList data; + for (EntryMap::const_iterator it = entries_.begin(); it != entries_.end(); + ++it) { + data.push_back(CreateLocalData(it->second)); + } + return data; +} + +void DomDistillerModel::CalculateChangesForMerge( + const SyncDataList& data, + SyncChangeList* changes_to_apply, + SyncChangeList* changes_missing) { + typedef base::hash_set<std::string> StringSet; + StringSet entries_to_change; + for (SyncDataList::const_iterator it = data.begin(); it != data.end(); ++it) { + std::string entry_id = GetEntryIdFromSyncData(*it); + std::pair<StringSet::iterator, bool> insert_result = + entries_to_change.insert(entry_id); + + DCHECK(insert_result.second); + + SyncChange::SyncChangeType change_type = SyncChange::ACTION_ADD; + if (GetEntryById(entry_id, NULL)) { + change_type = SyncChange::ACTION_UPDATE; + } + changes_to_apply->push_back(SyncChange(FROM_HERE, change_type, *it)); + } + + for (EntryMap::const_iterator it = entries_.begin(); it != entries_.end(); + ++it) { + if (entries_to_change.find(it->second.entry_id()) == + entries_to_change.end()) { + changes_missing->push_back(SyncChange( + FROM_HERE, SyncChange::ACTION_ADD, CreateLocalData(it->second))); + } + } +} + +DomDistillerModel::ChangeResult DomDistillerModel::ApplyChangesToModel( + const SyncChangeList& changes, + SyncChangeList* changes_applied, + SyncChangeList* changes_missing) { + DCHECK(changes_applied); + DCHECK(changes_missing); + + ChangeResult result = SUCCESS; + + for (SyncChangeList::const_iterator it = changes.begin(); it != changes.end(); + ++it) { + result = ApplyChangeToModel(*it, changes_applied, changes_missing); + if (result != SUCCESS) { + break; + } + } + return result; +} + +void DomDistillerModel::AddEntry(const ArticleEntry& entry) { + const std::string& entry_id = entry.entry_id(); + KeyType key = next_key_++; + DCHECK(!GetKeyById(entry_id, NULL)); + entries_.insert(std::make_pair(key, entry)); + entry_id_to_key_map_.insert(std::make_pair(entry_id, key)); + for (int i = 0; i < entry.pages_size(); ++i) { + url_to_key_map_.insert(std::make_pair(entry.pages(i).url(), key)); + } +} + +void DomDistillerModel::RemoveEntry(const ArticleEntry& entry) { + const std::string& entry_id = entry.entry_id(); + KeyType key = 0; + bool success = GetKeyById(entry_id, &key); + DCHECK(success); + + entries_.erase(key); + entry_id_to_key_map_.erase(entry_id); + for (int i = 0; i < entry.pages_size(); ++i) { + url_to_key_map_.erase(entry.pages(i).url()); + } +} + +DomDistillerModel::ChangeResult DomDistillerModel::ApplyChangeToModel( + const SyncChange& change, + SyncChangeList* changes_applied, + SyncChangeList* changes_missing) { + DCHECK(change.IsValid()); + DCHECK(changes_applied); + DCHECK(changes_missing); + + const std::string& entry_id = GetEntryIdFromSyncData(change.sync_data()); + + if (change.change_type() == SyncChange::ACTION_DELETE) { + // TODO(cjhopman): Support delete. + NOTIMPLEMENTED(); + return DELETE_NOT_SUPPORTED; + } + + ArticleEntry entry = GetEntryFromChange(change); + ArticleEntry current_entry; + if (!GetEntryById(entry_id, ¤t_entry)) { + AddEntry(entry); + changes_applied->push_back(SyncChange( + change.location(), SyncChange::ACTION_ADD, change.sync_data())); + } else { + if (!AreEntriesEqual(current_entry, entry)) { + // Currently, conflicts are simply resolved by accepting the last one to + // arrive. + RemoveEntry(current_entry); + AddEntry(entry); + changes_applied->push_back(SyncChange( + change.location(), SyncChange::ACTION_UPDATE, change.sync_data())); + } + } + return SUCCESS; +} + +} // namespace dom_distiller diff --git a/components/dom_distiller/core/dom_distiller_model.h b/components/dom_distiller/core/dom_distiller_model.h new file mode 100644 index 0000000000..1bc2ec2ab6 --- /dev/null +++ b/components/dom_distiller/core/dom_distiller_model.h @@ -0,0 +1,94 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_MODEL_H_ +#define COMPONENTS_DOM_DISTILLER_CORE_DOM_DISTILLER_MODEL_H_ + +#include <vector> + +#include "base/containers/hash_tables.h" +#include "base/id_map.h" +#include "components/dom_distiller/core/article_entry.h" +#include "sync/api/sync_change.h" +#include "sync/api/sync_change_processor.h" // syncer::SyncChangeList +#include "sync/api/sync_data.h" +#include "url/gurl.h" + +namespace dom_distiller { + +// This stores the in-memory model of the DOM distiller list. Entries can be +// looked up by URL or by entry_id. +// The model assumes that an URL corresponds to at most a single entry. If this +// assumption is broken, lookup by URL may return unexpected results. +class DomDistillerModel { + public: + enum ChangeResult { + SUCCESS = 0, + DELETE_NOT_SUPPORTED, + }; + + DomDistillerModel(); + explicit DomDistillerModel(const std::vector<ArticleEntry>& initial_data); + + ~DomDistillerModel(); + + // Lookup an ArticleEntry by ID or URL. Returns whether a corresponding entry + // was found. On success, if |entry| is not null, it will contain the entry. + bool GetEntryById(const std::string& entry_id, ArticleEntry* entry) const; + bool GetEntryByUrl(const GURL& url, ArticleEntry* entry) const; + + std::vector<ArticleEntry> GetEntries() const; + size_t GetNumEntries() const; + + syncer::SyncDataList GetAllSyncData() const; + + // Convert a SyncDataList to a SyncChangeList of add or update changes based + // on the state of the model. Also calculate the entries missing from the + // SyncDataList. + void CalculateChangesForMerge(const syncer::SyncDataList& data, + syncer::SyncChangeList* changes_to_apply, + syncer::SyncChangeList* changes_missing); + + // Applies the change list to the model, appending the actual changes made to + // the model to |changes_applied|. If conflict resolution does not apply the + // requested change, then adds the "diff" between what was requested and what + // was actually applied to |changes_missing|. + // Note: Currently conflicts are resolved by just applying the requested + // change. This means nothing will be added to |changes_missing|. + ChangeResult ApplyChangesToModel(const syncer::SyncChangeList& change_list, + syncer::SyncChangeList* changes_applied, + syncer::SyncChangeList* changes_missing); + + private: + typedef int32 KeyType; + typedef base::hash_map<KeyType, ArticleEntry> EntryMap; + typedef base::hash_map<std::string, KeyType> StringToKeyMap; + + void AddEntry(const ArticleEntry& entry); + void RemoveEntry(const ArticleEntry& entry); + + // Lookup an entry's key by ID or URL. Returns whether a corresponding key was + // found. On success, if |key| is not null, it will contain the entry. + bool GetKeyById(const std::string& entry_id, KeyType* key) const; + bool GetKeyByUrl(const GURL& url, KeyType* key) const; + + // If |entry| is not null, assigns the entry for |key| to it. |key| must map + // to an entry in |entries_|. + void GetEntryByKey(KeyType key, ArticleEntry* entry) const; + + ChangeResult ApplyChangeToModel(const syncer::SyncChange& change, + syncer::SyncChangeList* changes_applied, + syncer::SyncChangeList* changes_missing); + + KeyType next_key_; + EntryMap entries_; + StringToKeyMap url_to_key_map_; + StringToKeyMap entry_id_to_key_map_; + + DISALLOW_COPY_AND_ASSIGN(DomDistillerModel); +}; + +} // namespace dom_distiller + +#endif diff --git a/components/dom_distiller/core/dom_distiller_model_unittest.cc b/components/dom_distiller/core/dom_distiller_model_unittest.cc new file mode 100644 index 0000000000..0220439c56 --- /dev/null +++ b/components/dom_distiller/core/dom_distiller_model_unittest.cc @@ -0,0 +1,131 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/dom_distiller/core/dom_distiller_model.h" + +#include "testing/gtest/include/gtest/gtest.h" + +namespace dom_distiller { + +TEST(DomDistillerModelTest, TestGetByEntryId) { + ArticleEntry entry1; + entry1.set_entry_id("id1"); + entry1.set_title("title1"); + ArticleEntry entry2; + entry2.set_entry_id("id2"); + entry2.set_title("title1"); + + std::vector<ArticleEntry> initial_model; + initial_model.push_back(entry1); + initial_model.push_back(entry2); + + DomDistillerModel model(initial_model); + + ArticleEntry found_entry; + EXPECT_TRUE(model.GetEntryById(entry1.entry_id(), &found_entry)); + ASSERT_TRUE(IsEntryValid(found_entry)); + EXPECT_TRUE(AreEntriesEqual(entry1, found_entry)); + + EXPECT_TRUE(model.GetEntryById(entry2.entry_id(), &found_entry)); + ASSERT_TRUE(IsEntryValid(found_entry)); + EXPECT_TRUE(AreEntriesEqual(entry2, found_entry)); + + EXPECT_FALSE(model.GetEntryById("some_other_id", NULL)); +} + +TEST(DomDistillerModelTest, TestGetByUrl) { + ArticleEntry entry1; + entry1.set_entry_id("id1"); + entry1.set_title("title1"); + ArticleEntryPage* page1 = entry1.add_pages(); + page1->set_url("http://example.com/1"); + ArticleEntryPage* page2 = entry1.add_pages(); + page2->set_url("http://example.com/2"); + + ArticleEntry entry2; + entry2.set_entry_id("id2"); + entry2.set_title("title1"); + ArticleEntryPage* page3 = entry2.add_pages(); + page3->set_url("http://example.com/a1"); + + std::vector<ArticleEntry> initial_model; + initial_model.push_back(entry1); + initial_model.push_back(entry2); + + DomDistillerModel model(initial_model); + + ArticleEntry found_entry; + EXPECT_TRUE(model.GetEntryByUrl(GURL(page1->url()), &found_entry)); + ASSERT_TRUE(IsEntryValid(found_entry)); + EXPECT_TRUE(AreEntriesEqual(entry1, found_entry)); + + EXPECT_TRUE(model.GetEntryByUrl(GURL(page2->url()), &found_entry)); + ASSERT_TRUE(IsEntryValid(found_entry)); + EXPECT_TRUE(AreEntriesEqual(entry1, found_entry)); + + EXPECT_TRUE(model.GetEntryByUrl(GURL(page3->url()), &found_entry)); + ASSERT_TRUE(IsEntryValid(found_entry)); + EXPECT_TRUE(AreEntriesEqual(entry2, found_entry)); + + EXPECT_FALSE(model.GetEntryByUrl(GURL("http://example.com/foo"), NULL)); +} + +// This test ensures that the model handles the case where an URL maps to +// multiple entries. In that case, the model is allowed to have an inconsistent +// url-to-entry mapping, but it should not fail in other ways (i.e. id-to-entry +// should be correct, shouldn't crash). +TEST(DomDistillerModelTest, TestUrlToMultipleEntries) { + ArticleEntry entry1; + entry1.set_entry_id("id1"); + entry1.set_title("title1"); + ArticleEntryPage* page1 = entry1.add_pages(); + page1->set_url("http://example.com/1"); + ArticleEntryPage* page2 = entry1.add_pages(); + page2->set_url("http://example.com/2"); + + ArticleEntry entry2; + entry2.set_entry_id("id2"); + entry2.set_title("title1"); + ArticleEntryPage* page3 = entry2.add_pages(); + page3->set_url("http://example.com/1"); + + std::vector<ArticleEntry> initial_model; + initial_model.push_back(entry1); + initial_model.push_back(entry2); + + DomDistillerModel model(initial_model); + + EXPECT_TRUE(model.GetEntryByUrl(GURL(page1->url()), NULL)); + EXPECT_TRUE(model.GetEntryByUrl(GURL(page2->url()), NULL)); + EXPECT_TRUE(model.GetEntryByUrl(GURL(page3->url()), NULL)); + + ArticleEntry found_entry; + EXPECT_TRUE(model.GetEntryById(entry1.entry_id(), &found_entry)); + ASSERT_TRUE(IsEntryValid(found_entry)); + EXPECT_TRUE(AreEntriesEqual(entry1, found_entry)); + + EXPECT_TRUE(model.GetEntryById(entry2.entry_id(), &found_entry)); + ASSERT_TRUE(IsEntryValid(found_entry)); + EXPECT_TRUE(AreEntriesEqual(entry2, found_entry)); + + syncer::SyncChangeList changes_to_apply; + syncer::SyncChangeList changes_applied; + syncer::SyncChangeList changes_missing; + + entry2.mutable_pages(0)->set_url("http://example.com/foo1"); + changes_to_apply.push_back(syncer::SyncChange( + FROM_HERE, syncer::SyncChange::ACTION_UPDATE, CreateLocalData(entry2))); + model.ApplyChangesToModel( + changes_to_apply, &changes_applied, &changes_missing); + + EXPECT_TRUE(model.GetEntryById(entry1.entry_id(), &found_entry)); + ASSERT_TRUE(IsEntryValid(found_entry)); + EXPECT_TRUE(AreEntriesEqual(entry1, found_entry)); + + EXPECT_TRUE(model.GetEntryById(entry2.entry_id(), &found_entry)); + ASSERT_TRUE(IsEntryValid(found_entry)); + EXPECT_TRUE(AreEntriesEqual(entry2, found_entry)); +} + +} // namespace dom_distiller diff --git a/components/dom_distiller/core/dom_distiller_store.cc b/components/dom_distiller/core/dom_distiller_store.cc index f5a7a7098f..8be2cb6d52 100644 --- a/components/dom_distiller/core/dom_distiller_store.cc +++ b/components/dom_distiller/core/dom_distiller_store.cc @@ -23,24 +23,6 @@ using syncer::SyncMergeResult; namespace dom_distiller { -namespace { - -std::string GetEntryIdFromSyncData(const SyncData& data) { - const EntitySpecifics& entity = data.GetSpecifics(); - DCHECK(entity.has_article()); - const ArticleSpecifics& specifics = entity.article(); - DCHECK(specifics.has_entry_id()); - return specifics.entry_id(); -} - -SyncData CreateLocalData(const ArticleEntry& entry) { - EntitySpecifics specifics = SpecificsFromEntry(entry); - const std::string& entry_id = entry.entry_id(); - return SyncData::CreateLocalData(entry_id, entry_id, specifics); -} - -} // namespace - DomDistillerStore::DomDistillerStore( scoped_ptr<DomDistillerDatabaseInterface> database, const base::FilePath& database_dir) @@ -54,11 +36,11 @@ DomDistillerStore::DomDistillerStore( DomDistillerStore::DomDistillerStore( scoped_ptr<DomDistillerDatabaseInterface> database, - const EntryMap& initial_model, + const std::vector<ArticleEntry>& initial_data, const base::FilePath& database_dir) : database_(database.Pass()), database_loaded_(false), - model_(initial_model), + model_(initial_data), weak_ptr_factory_(this) { database_->Init(database_dir, base::Bind(&DomDistillerStore::OnDatabaseInit, @@ -72,11 +54,23 @@ syncer::SyncableService* DomDistillerStore::GetSyncableService() { return this; } +bool DomDistillerStore::GetEntryById(const std::string& entry_id, + ArticleEntry* entry) { + return model_.GetEntryById(entry_id, entry); +} + +bool DomDistillerStore::GetEntryByUrl(const GURL& url, + ArticleEntry* entry) { + return model_.GetEntryByUrl(url, entry); +} + + bool DomDistillerStore::AddEntry(const ArticleEntry& entry) { if (!database_loaded_) { return false; } - if (model_.find(entry.entry_id()) != model_.end()) { + + if (model_.GetEntryById(entry.entry_id(), NULL)) { return false; } @@ -86,7 +80,11 @@ bool DomDistillerStore::AddEntry(const ArticleEntry& entry) { SyncChangeList changes_applied; SyncChangeList changes_missing; - ApplyChangesToModel(changes_to_apply, &changes_applied, &changes_missing); + + if (!ApplyChangesToModel( + changes_to_apply, &changes_applied, &changes_missing)) { + return false; + } DCHECK_EQ(size_t(0), changes_missing.size()); DCHECK_EQ(size_t(1), changes_applied.size()); @@ -98,11 +96,7 @@ bool DomDistillerStore::AddEntry(const ArticleEntry& entry) { } std::vector<ArticleEntry> DomDistillerStore::GetEntries() const { - std::vector<ArticleEntry> entries; - for (EntryMap::const_iterator it = model_.begin(); it != model_.end(); ++it) { - entries.push_back(it->second); - } - return entries; + return model_.GetEntries(); } // syncer::SyncableService implementation. @@ -133,11 +127,7 @@ void DomDistillerStore::StopSyncing(ModelType type) { } SyncDataList DomDistillerStore::GetAllSyncData(ModelType type) const { - SyncDataList data; - for (EntryMap::const_iterator it = model_.begin(); it != model_.end(); ++it) { - data.push_back(CreateLocalData(it->second)); - } - return data; + return model_.GetAllSyncData(); } SyncError DomDistillerStore::ProcessSyncChanges( @@ -146,17 +136,34 @@ SyncError DomDistillerStore::ProcessSyncChanges( DCHECK(database_loaded_); SyncChangeList database_changes; SyncChangeList sync_changes; - SyncError error = - ApplyChangesToModel(change_list, &database_changes, &sync_changes); + if (!ApplyChangesToModel(change_list, &database_changes, &sync_changes)) { + return SyncError(FROM_HERE, + SyncError::DATATYPE_ERROR, + "Applying changes to the DOM distiller model failed", + syncer::ARTICLES); + } ApplyChangesToDatabase(database_changes); DCHECK_EQ(size_t(0), sync_changes.size()); - return error; + return SyncError(); } -ArticleEntry DomDistillerStore::GetEntryFromChange(const SyncChange& change) { - DCHECK(change.IsValid()); - DCHECK(change.sync_data().IsValid()); - return EntryFromSpecifics(change.sync_data().GetSpecifics()); +bool DomDistillerStore::ApplyChangesToModel( + const SyncChangeList& changes, + SyncChangeList* changes_applied, + SyncChangeList* changes_missing) { + DomDistillerModel::ChangeResult change_result = + model_.ApplyChangesToModel(changes, changes_applied, changes_missing); + if (change_result == DomDistillerModel::SUCCESS) { + return true; + } + + LOG(WARNING) << "Applying changes to DOM distiller model failed with error " + << change_result; + + database_.reset(); + database_loaded_ = false; + StopSyncing(syncer::ARTICLES); + return false; } void DomDistillerStore::OnDatabaseInit(bool success) { @@ -238,35 +245,6 @@ bool DomDistillerStore::ApplyChangesToDatabase( return true; } -void DomDistillerStore::CalculateChangesForMerge( - const SyncDataList& data, - SyncChangeList* changes_to_apply, - SyncChangeList* changes_missing) { - typedef base::hash_set<std::string> StringSet; - StringSet entries_to_change; - for (SyncDataList::const_iterator it = data.begin(); it != data.end(); ++it) { - std::string entry_id = GetEntryIdFromSyncData(*it); - std::pair<StringSet::iterator, bool> insert_result = - entries_to_change.insert(entry_id); - - DCHECK(insert_result.second); - - SyncChange::SyncChangeType change_type = SyncChange::ACTION_ADD; - EntryMap::const_iterator current = model_.find(entry_id); - if (current != model_.end()) { - change_type = SyncChange::ACTION_UPDATE; - } - changes_to_apply->push_back(SyncChange(FROM_HERE, change_type, *it)); - } - - for (EntryMap::const_iterator it = model_.begin(); it != model_.end(); ++it) { - if (entries_to_change.find(it->first) == entries_to_change.end()) { - changes_missing->push_back(SyncChange( - FROM_HERE, SyncChange::ACTION_ADD, CreateLocalData(it->second))); - } - } -} - SyncMergeResult DomDistillerStore::MergeDataWithModel( const SyncDataList& data, SyncChangeList* changes_applied, @@ -275,12 +253,18 @@ SyncMergeResult DomDistillerStore::MergeDataWithModel( DCHECK(changes_missing); SyncMergeResult result(syncer::ARTICLES); - result.set_num_items_before_association(model_.size()); + result.set_num_items_before_association(model_.GetNumEntries()); SyncChangeList changes_to_apply; - CalculateChangesForMerge(data, &changes_to_apply, changes_missing); - SyncError error = - ApplyChangesToModel(changes_to_apply, changes_applied, changes_missing); + model_.CalculateChangesForMerge(data, &changes_to_apply, changes_missing); + SyncError error; + if (!ApplyChangesToModel( + changes_to_apply, changes_applied, changes_missing)) { + error = SyncError(FROM_HERE, + SyncError::DATATYPE_ERROR, + "Applying changes to the DOM distiller model failed", + syncer::ARTICLES); + } int num_added = 0; int num_modified = 0; @@ -304,57 +288,10 @@ SyncMergeResult DomDistillerStore::MergeDataWithModel( result.set_num_items_deleted(0); result.set_pre_association_version(0); - result.set_num_items_after_association(model_.size()); + result.set_num_items_after_association(model_.GetNumEntries()); result.set_error(error); return result; } -SyncError DomDistillerStore::ApplyChangesToModel( - const SyncChangeList& changes, - SyncChangeList* changes_applied, - SyncChangeList* changes_missing) { - DCHECK(changes_applied); - DCHECK(changes_missing); - - for (SyncChangeList::const_iterator it = changes.begin(); it != changes.end(); - ++it) { - ApplyChangeToModel(*it, changes_applied, changes_missing); - } - return SyncError(); -} - -void DomDistillerStore::ApplyChangeToModel(const SyncChange& change, - SyncChangeList* changes_applied, - SyncChangeList* changes_missing) { - DCHECK(changes_applied); - DCHECK(changes_missing); - DCHECK(change.IsValid()); - - const std::string& entry_id = GetEntryIdFromSyncData(change.sync_data()); - EntryMap::iterator entry_it = model_.find(entry_id); - - if (change.change_type() == SyncChange::ACTION_DELETE) { - // TODO(cjhopman): Support delete. - NOTIMPLEMENTED(); - StopSyncing(syncer::ARTICLES); - return; - } - - ArticleEntry entry = GetEntryFromChange(change); - if (entry_it == model_.end()) { - model_.insert(std::make_pair(entry.entry_id(), entry)); - changes_applied->push_back(SyncChange( - change.location(), SyncChange::ACTION_ADD, change.sync_data())); - } else { - if (!AreEntriesEqual(entry_it->second, entry)) { - // Currently, conflicts are simply resolved by accepting the last one to - // arrive. - entry_it->second = entry; - changes_applied->push_back(SyncChange( - change.location(), SyncChange::ACTION_UPDATE, change.sync_data())); - } - } -} - } // namespace dom_distiller diff --git a/components/dom_distiller/core/dom_distiller_store.h b/components/dom_distiller/core/dom_distiller_store.h index fdc1851ff2..18641b790e 100644 --- a/components/dom_distiller/core/dom_distiller_store.h +++ b/components/dom_distiller/core/dom_distiller_store.h @@ -11,12 +11,14 @@ #include "base/memory/weak_ptr.h" #include "components/dom_distiller/core/article_entry.h" #include "components/dom_distiller/core/dom_distiller_database.h" +#include "components/dom_distiller/core/dom_distiller_model.h" #include "sync/api/sync_change.h" #include "sync/api/sync_data.h" #include "sync/api/sync_error.h" #include "sync/api/sync_error_factory.h" #include "sync/api/sync_merge_result.h" #include "sync/api/syncable_service.h" +#include "url/gurl.h" namespace base { class FilePath; @@ -34,6 +36,12 @@ class DomDistillerStoreInterface { virtual bool AddEntry(const ArticleEntry& entry) = 0; + // Lookup an ArticleEntry by ID or URL. Returns whether a corresponding entry + // was found. On success, if |entry| is not null, it will contain the entry. + virtual bool GetEntryById(const std::string& entry_id, + ArticleEntry* entry) = 0; + virtual bool GetEntryByUrl(const GURL& url, ArticleEntry* entry) = 0; + // Gets a copy of all the current entries. virtual std::vector<ArticleEntry> GetEntries() const = 0; @@ -59,8 +67,6 @@ class DomDistillerStoreInterface { class DomDistillerStore : public syncer::SyncableService, DomDistillerStoreInterface { public: - typedef base::hash_map<std::string, ArticleEntry> EntryMap; - // Creates storage using the given database for local storage. Initializes the // database with |database_dir|. DomDistillerStore(scoped_ptr<DomDistillerDatabaseInterface> database, @@ -70,7 +76,7 @@ class DomDistillerStore : public syncer::SyncableService, // database with |database_dir|. Also initializes the internal model to // |initial_model|. DomDistillerStore(scoped_ptr<DomDistillerDatabaseInterface> database, - const EntryMap& initial_model, + const std::vector<ArticleEntry>& initial_data, const base::FilePath& database_dir); virtual ~DomDistillerStore(); @@ -78,6 +84,9 @@ class DomDistillerStore : public syncer::SyncableService, // DomDistillerStoreInterface implementation. virtual syncer::SyncableService* GetSyncableService() OVERRIDE; virtual bool AddEntry(const ArticleEntry& entry) OVERRIDE; + virtual bool GetEntryById(const std::string& entry_id, + ArticleEntry* entry) OVERRIDE; + virtual bool GetEntryByUrl(const GURL& url, ArticleEntry* entry) OVERRIDE; virtual std::vector<ArticleEntry> GetEntries() const OVERRIDE; // syncer::SyncableService implementation. @@ -92,9 +101,6 @@ class DomDistillerStore : public syncer::SyncableService, virtual syncer::SyncError ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) OVERRIDE; - - static ArticleEntry GetEntryFromChange(const syncer::SyncChange& change); - private: void OnDatabaseInit(bool success); void OnDatabaseLoad(bool success, scoped_ptr<EntryVector> entries); @@ -116,24 +122,18 @@ class DomDistillerStore : public syncer::SyncableService, const syncer::SyncChangeList& change_list); bool ApplyChangesToDatabase(const syncer::SyncChangeList& change_list); - // Applies the change list to the in-memory model, appending the actual - // changes made to the model to changes_applied. If conflict resolution does - // not apply the requested change, then adds the "diff" to changes_missing. - syncer::SyncError ApplyChangesToModel( - const syncer::SyncChangeList& change_list, - syncer::SyncChangeList* changes_applied, - syncer::SyncChangeList* changes_missing); - - void ApplyChangeToModel(const syncer::SyncChange& change, - syncer::SyncChangeList* changes_applied, - syncer::SyncChangeList* changes_missing); + // Applies the changes to |model_|. If the model returns an error, disables + // syncing and database changes and returns false. + bool ApplyChangesToModel(const syncer::SyncChangeList& change_list, + syncer::SyncChangeList* changes_applied, + syncer::SyncChangeList* changes_missing); scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; scoped_ptr<syncer::SyncErrorFactory> error_factory_; scoped_ptr<DomDistillerDatabaseInterface> database_; bool database_loaded_; - EntryMap model_; + DomDistillerModel model_; base::WeakPtrFactory<DomDistillerStore> weak_ptr_factory_; diff --git a/components/dom_distiller/core/dom_distiller_store_unittest.cc b/components/dom_distiller/core/dom_distiller_store_unittest.cc index 333d72dc28..9e4cf35f55 100644 --- a/components/dom_distiller/core/dom_distiller_store_unittest.cc +++ b/components/dom_distiller/core/dom_distiller_store_unittest.cc @@ -34,12 +34,21 @@ namespace { const ModelType kDomDistillerModelType = syncer::ARTICLES; -typedef DomDistillerStore::EntryMap EntryMap; +typedef base::hash_map<std::string, ArticleEntry> EntryMap; void AddEntry(const ArticleEntry& e, EntryMap* map) { (*map)[e.entry_id()] = e; } +std::vector<ArticleEntry> EntryMapToList(const EntryMap& entries) { + std::vector<ArticleEntry> entry_list; + for (EntryMap::const_iterator it = entries.begin(); it != entries.end(); + ++it) { + entry_list.push_back(it->second); + } + return entry_list; +} + class FakeDB : public DomDistillerDatabaseInterface { typedef base::Callback<void(bool)> Callback; @@ -134,7 +143,7 @@ class FakeSyncChangeProcessor : public syncer::SyncChangeProcessor { for (SyncChangeList::const_iterator it = changes.begin(); it != changes.end(); ++it) { - AddEntry(DomDistillerStore::GetEntryFromChange(*it), model_); + AddEntry(GetEntryFromChange(*it), model_); } return SyncError(); } @@ -203,7 +212,7 @@ class DomDistillerStoreTest : public testing::Test { fake_db_ = new FakeDB(&db_model_); store_.reset(new DomDistillerStore( scoped_ptr<DomDistillerDatabaseInterface>(fake_db_), - store_model_, + EntryMapToList(store_model_), db_dir_)); } @@ -448,7 +457,7 @@ TEST_F(DomDistillerStoreTest, TestSyncMergeWithSecondDomDistillerStore) { FakeDB* other_fake_db = new FakeDB(&other_db_model); scoped_ptr<DomDistillerStore> owned_other_store(new DomDistillerStore( scoped_ptr<DomDistillerDatabaseInterface>(other_fake_db), - EntryMap(), + std::vector<ArticleEntry>(), base::FilePath(FILE_PATH_LITERAL("/fake/other/path")))); DomDistillerStore* other_store = owned_other_store.get(); other_fake_db->InitCallback(true); diff --git a/components/encryptor.target.darwin-arm.mk b/components/encryptor.target.darwin-arm.mk index 4d699538e7..1aa2b16d71 100644 --- a/components/encryptor.target.darwin-arm.mk +++ b/components/encryptor.target.darwin-arm.mk @@ -63,13 +63,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -143,13 +143,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/encryptor.target.darwin-mips.mk b/components/encryptor.target.darwin-mips.mk index 41ffc22e42..50e47fae16 100644 --- a/components/encryptor.target.darwin-mips.mk +++ b/components/encryptor.target.darwin-mips.mk @@ -62,13 +62,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -141,13 +141,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/encryptor.target.darwin-x86.mk b/components/encryptor.target.darwin-x86.mk index 487157b9e4..97f436b005 100644 --- a/components/encryptor.target.darwin-x86.mk +++ b/components/encryptor.target.darwin-x86.mk @@ -65,13 +65,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -148,13 +148,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/encryptor.target.linux-arm.mk b/components/encryptor.target.linux-arm.mk index 4d699538e7..1aa2b16d71 100644 --- a/components/encryptor.target.linux-arm.mk +++ b/components/encryptor.target.linux-arm.mk @@ -63,13 +63,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -143,13 +143,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/encryptor.target.linux-mips.mk b/components/encryptor.target.linux-mips.mk index 41ffc22e42..50e47fae16 100644 --- a/components/encryptor.target.linux-mips.mk +++ b/components/encryptor.target.linux-mips.mk @@ -62,13 +62,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -141,13 +141,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/encryptor.target.linux-x86.mk b/components/encryptor.target.linux-x86.mk index 487157b9e4..97f436b005 100644 --- a/components/encryptor.target.linux-x86.mk +++ b/components/encryptor.target.linux-x86.mk @@ -65,13 +65,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -148,13 +148,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/json_schema/json_schema_validator.cc b/components/json_schema/json_schema_validator.cc index 3816a76097..3cc9e2bd3f 100644 --- a/components/json_schema/json_schema_validator.cc +++ b/components/json_schema/json_schema_validator.cc @@ -53,6 +53,18 @@ bool CompareToString(const ExpectedType& entry, const std::string& key) { return entry.key < key; } +// If |value| is a dictionary, returns the "name" attribute of |value| or NULL +// if |value| does not contain a "name" attribute. Otherwise, returns |value|. +const base::Value* ExtractNameFromDictionary(const base::Value* value) { + const base::DictionaryValue* value_dict = NULL; + const base::Value* name_value = NULL; + if (value->GetAsDictionary(&value_dict)) { + value_dict->Get("name", &name_value); + return name_value; + } + return value; +} + bool IsValidSchema(const base::DictionaryValue* dict, std::string* error) { // This array must be sorted, so that std::lower_bound can perform a // binary search. @@ -195,6 +207,13 @@ bool IsValidSchema(const base::DictionaryValue* dict, std::string* error) { for (size_t i = 0; i < list_value->GetSize(); ++i) { const base::Value* value = NULL; list_value->Get(i, &value); + // Sometimes the enum declaration is a dictionary with the enum value + // under "name". + value = ExtractNameFromDictionary(value); + if (!value) { + *error = "Invalid value in enum attribute"; + return false; + } switch (value->GetType()) { case base::Value::TYPE_NULL: case base::Value::TYPE_BOOLEAN: @@ -479,6 +498,12 @@ void JSONSchemaValidator::ValidateEnum(const base::Value* instance, for (size_t i = 0; i < choices->GetSize(); ++i) { const base::Value* choice = NULL; CHECK(choices->Get(i, &choice)); + // Sometimes the enum declaration is a dictionary with the enum value under + // "name". + choice = ExtractNameFromDictionary(choice); + if (!choice) { + NOTREACHED(); + } switch (choice->GetType()) { case base::Value::TYPE_NULL: case base::Value::TYPE_BOOLEAN: diff --git a/components/json_schema/json_schema_validator_unittest.cc b/components/json_schema/json_schema_validator_unittest.cc index 4844ed1a88..6372032c13 100644 --- a/components/json_schema/json_schema_validator_unittest.cc +++ b/components/json_schema/json_schema_validator_unittest.cc @@ -77,10 +77,16 @@ TEST(JSONSchemaValidator, IsValidSchema) { EXPECT_FALSE(JSONSchemaValidator::IsValidSchema( "{" " \"type\": \"string\"," - " \"enum\": [ {} ]," // "enum" must contain simple values. + " \"enum\": [ {} ]" // "enum" dict values must contain "name". "}", &error)); EXPECT_FALSE(JSONSchemaValidator::IsValidSchema( "{" + " \"type\": \"string\"," + " \"enum\": [ { \"name\": {} } ]" // "enum" name must be a simple value. + "}", + &error)); + EXPECT_FALSE(JSONSchemaValidator::IsValidSchema( + "{" " \"type\": \"array\"," " \"items\": [ 123 ]," // "items" must contain a schema or schemas. "}", &error)); @@ -106,7 +112,7 @@ TEST(JSONSchemaValidator, IsValidSchema) { " }," " \"enum-property\": {" " \"type\": \"integer\"," - " \"enum\": [0, 1, 10, 100]" + " \"enum\": [0, 1, {\"name\": 10}, 100]" " }," " \"items-property\": {" " \"type\": \"array\"," diff --git a/components/nacl/common/nacl_browser_delegate.h b/components/nacl/common/nacl_browser_delegate.h index dc0d8c7b8a..ba577de94a 100644 --- a/components/nacl/common/nacl_browser_delegate.h +++ b/components/nacl/common/nacl_browser_delegate.h @@ -74,6 +74,12 @@ class NaClBrowserDelegate { // TODO(jvoung): Add the progress callback as well. virtual void TryInstallPnacl( const base::Callback<void(bool)>& installed) = 0; + + // Set match patterns which will be checked before enabling debug stub. + virtual void SetDebugPatterns(std::string debug_patterns) = 0; + + // Returns whether NaCl application with this manifest URL should be debugged. + virtual bool URLMatchesDebugPatterns(const GURL& manifest_url) = 0; }; #endif // COMPONENTS_NACL_COMMON_NACL_BROWSER_DELEGATE_H_ diff --git a/components/nacl/loader/nacl_ipc_adapter.cc b/components/nacl/loader/nacl_ipc_adapter.cc index 3399bbbf35..8134d3c751 100644 --- a/components/nacl/loader/nacl_ipc_adapter.cc +++ b/components/nacl/loader/nacl_ipc_adapter.cc @@ -515,8 +515,7 @@ bool NaClIPCAdapter::SendCompleteMessage(const char* buffer, // We actually discard the flags and only copy the ones we care about. This // is just because message doesn't have a constructor that takes raw flags. scoped_ptr<IPC::Message> msg( - new IPC::Message(header->routing, header->type, - IPC::Message::PRIORITY_NORMAL)); + new IPC::Message(header->routing, header->type)); if (header->flags & IPC::Message::SYNC_BIT) msg->set_sync(); if (header->flags & IPC::Message::REPLY_BIT) diff --git a/components/nacl/loader/nacl_ipc_adapter_unittest.cc b/components/nacl/loader/nacl_ipc_adapter_unittest.cc index 80fd4080d4..21e5f7fc98 100644 --- a/components/nacl/loader/nacl_ipc_adapter_unittest.cc +++ b/components/nacl/loader/nacl_ipc_adapter_unittest.cc @@ -75,7 +75,7 @@ class NaClIPCAdapterTest : public testing::Test { TEST_F(NaClIPCAdapterTest, SimpleReceiveRewriting) { int routing_id = 0x89898989; uint32 type = 0x55555555; - IPC::Message input(routing_id, type, IPC::Message::PRIORITY_NORMAL); + IPC::Message input(routing_id, type); uint32 flags = input.flags(); int value = 0x12345678; @@ -175,14 +175,14 @@ TEST_F(NaClIPCAdapterTest, SendRewriting) { TEST_F(NaClIPCAdapterTest, PartialReceive) { int routing_id_1 = 0x89898989; uint32 type_1 = 0x55555555; - IPC::Message input_1(routing_id_1, type_1, IPC::Message::PRIORITY_NORMAL); + IPC::Message input_1(routing_id_1, type_1); int value_1 = 0x12121212; input_1.WriteInt(value_1); adapter_->OnMessageReceived(input_1); int routing_id_2 = 0x90909090; uint32 type_2 = 0x66666666; - IPC::Message input_2(routing_id_2, type_2, IPC::Message::PRIORITY_NORMAL); + IPC::Message input_2(routing_id_2, type_2); int value_2 = 0x23232323; input_2.WriteInt(value_2); adapter_->OnMessageReceived(input_2); diff --git a/components/nacl/zygote/nacl_fork_delegate_linux.cc b/components/nacl/zygote/nacl_fork_delegate_linux.cc index 7bd2e9fdb4..3dbe6e6658 100644 --- a/components/nacl/zygote/nacl_fork_delegate_linux.cc +++ b/components/nacl/zygote/nacl_fork_delegate_linux.cc @@ -257,7 +257,7 @@ bool NaClForkDelegate::CanHelp(const std::string& process_type, *uma_name = "NaCl.Client.Helper.StateOnFork"; *uma_sample = status_; *uma_boundary_value = kNaClHelperStatusBoundary; - return status_ == kNaClHelperSuccess; + return true; } pid_t NaClForkDelegate::Fork(const std::vector<int>& fds) { @@ -265,6 +265,11 @@ pid_t NaClForkDelegate::Fork(const std::vector<int>& fds) { DCHECK(fds.size() == kNumPassedFDs); + if (status_ != kNaClHelperSuccess) { + LOG(ERROR) << "Cannot launch NaCl process: nacl_helper failed to start"; + return -1; + } + // First, send a remote fork request. Pickle write_pickle; write_pickle.WriteInt(kNaClForkRequest); diff --git a/components/nacl_common.gyp b/components/nacl_common.gyp index 1364ef2cd6..cedf675769 100644 --- a/components/nacl_common.gyp +++ b/components/nacl_common.gyp @@ -53,6 +53,9 @@ { 'target_name': 'nacl_common_win64', 'type': 'static_library', + 'defines': [ + 'COMPILE_CONTENT_STATICALLY', + ], 'sources': [ 'nacl/common/nacl_cmd_line.cc', 'nacl/common/nacl_cmd_line.h', diff --git a/components/navigation_interception.target.darwin-arm.mk b/components/navigation_interception.target.darwin-arm.mk index c65d841cab..176bdcd7b8 100644 --- a/components/navigation_interception.target.darwin-arm.mk +++ b/components/navigation_interception.target.darwin-arm.mk @@ -68,13 +68,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -155,13 +155,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception.target.darwin-mips.mk b/components/navigation_interception.target.darwin-mips.mk index fc331f1f6a..cc20f6f6ae 100644 --- a/components/navigation_interception.target.darwin-mips.mk +++ b/components/navigation_interception.target.darwin-mips.mk @@ -67,13 +67,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -153,13 +153,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception.target.darwin-x86.mk b/components/navigation_interception.target.darwin-x86.mk index f8e6ff3e68..d7def75302 100644 --- a/components/navigation_interception.target.darwin-x86.mk +++ b/components/navigation_interception.target.darwin-x86.mk @@ -70,13 +70,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -159,13 +159,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception.target.linux-arm.mk b/components/navigation_interception.target.linux-arm.mk index c65d841cab..176bdcd7b8 100644 --- a/components/navigation_interception.target.linux-arm.mk +++ b/components/navigation_interception.target.linux-arm.mk @@ -68,13 +68,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -155,13 +155,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception.target.linux-mips.mk b/components/navigation_interception.target.linux-mips.mk index fc331f1f6a..cc20f6f6ae 100644 --- a/components/navigation_interception.target.linux-mips.mk +++ b/components/navigation_interception.target.linux-mips.mk @@ -67,13 +67,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -153,13 +153,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception.target.linux-x86.mk b/components/navigation_interception.target.linux-x86.mk index f8e6ff3e68..d7def75302 100644 --- a/components/navigation_interception.target.linux-x86.mk +++ b/components/navigation_interception.target.linux-x86.mk @@ -70,13 +70,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -159,13 +159,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception_jni_headers.target.darwin-arm.mk b/components/navigation_interception_jni_headers.target.darwin-arm.mk index 1a4672ea30..c82c00290f 100644 --- a/components/navigation_interception_jni_headers.target.darwin-arm.mk +++ b/components/navigation_interception_jni_headers.target.darwin-arm.mk @@ -92,13 +92,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -170,13 +170,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception_jni_headers.target.darwin-mips.mk b/components/navigation_interception_jni_headers.target.darwin-mips.mk index 6723897ac9..3aa11a4e27 100644 --- a/components/navigation_interception_jni_headers.target.darwin-mips.mk +++ b/components/navigation_interception_jni_headers.target.darwin-mips.mk @@ -91,13 +91,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -168,13 +168,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception_jni_headers.target.darwin-x86.mk b/components/navigation_interception_jni_headers.target.darwin-x86.mk index f70d2898ee..56f182e963 100644 --- a/components/navigation_interception_jni_headers.target.darwin-x86.mk +++ b/components/navigation_interception_jni_headers.target.darwin-x86.mk @@ -94,13 +94,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -175,13 +175,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception_jni_headers.target.linux-arm.mk b/components/navigation_interception_jni_headers.target.linux-arm.mk index 1a4672ea30..c82c00290f 100644 --- a/components/navigation_interception_jni_headers.target.linux-arm.mk +++ b/components/navigation_interception_jni_headers.target.linux-arm.mk @@ -92,13 +92,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -170,13 +170,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception_jni_headers.target.linux-mips.mk b/components/navigation_interception_jni_headers.target.linux-mips.mk index 6723897ac9..3aa11a4e27 100644 --- a/components/navigation_interception_jni_headers.target.linux-mips.mk +++ b/components/navigation_interception_jni_headers.target.linux-mips.mk @@ -91,13 +91,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -168,13 +168,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_interception_jni_headers.target.linux-x86.mk b/components/navigation_interception_jni_headers.target.linux-x86.mk index f70d2898ee..56f182e963 100644 --- a/components/navigation_interception_jni_headers.target.linux-x86.mk +++ b/components/navigation_interception_jni_headers.target.linux-x86.mk @@ -94,13 +94,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -175,13 +175,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/navigation_metrics.gypi b/components/navigation_metrics.gypi new file mode 100644 index 0000000000..a8f223350d --- /dev/null +++ b/components/navigation_metrics.gypi @@ -0,0 +1,23 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'navigation_metrics', + 'type': 'static_library', + 'dependencies': [ + '../base/base.gyp:base', + '../url/url.gyp:url_lib', + ], + 'include_dirs': [ + '..', + ], + 'sources': [ + 'navigation_metrics/navigation_metrics.cc', + 'navigation_metrics/navigation_metrics.h', + ], + }, + ], +} diff --git a/components/navigation_metrics/navigation_metrics.cc b/components/navigation_metrics/navigation_metrics.cc new file mode 100644 index 0000000000..acbe25a9b0 --- /dev/null +++ b/components/navigation_metrics/navigation_metrics.cc @@ -0,0 +1,57 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/navigation_metrics/navigation_metrics.h" + +#include "base/metrics/histogram.h" +#include "url/gurl.h" + +namespace { + +enum Scheme { + SCHEME_UNKNOWN, + SCHEME_HTTP, + SCHEME_HTTPS, + SCHEME_FILE, + SCHEME_FTP, + SCHEME_DATA, + SCHEME_JAVASCRIPT, + SCHEME_ABOUT, + SCHEME_CHROME, + SCHEME_MAX, +}; + +static const char* kSchemeNames[] = { + "unknown", + "http", + "https", + "file", + "ftp", + "data", + "javascript", + "about", + "chrome", + "max", +}; + +COMPILE_ASSERT(arraysize(kSchemeNames) == SCHEME_MAX + 1, + NavigationMetricsRecorder_name_count_mismatch); + +} // namespace + +namespace navigation_metrics { + +void RecordMainFrameNavigation(const GURL& url) { + Scheme scheme = SCHEME_UNKNOWN; + for (int i = 1; i < SCHEME_MAX; ++i) { + if (url.SchemeIs(kSchemeNames[i])) { + scheme = static_cast<Scheme>(i); + break; + } + } + UMA_HISTOGRAM_ENUMERATION( + "Navigation.MainFrameScheme", scheme, SCHEME_MAX); +} + +} // namespace navigation_metrics diff --git a/components/navigation_metrics/navigation_metrics.h b/components/navigation_metrics/navigation_metrics.h new file mode 100644 index 0000000000..db5eb7f983 --- /dev/null +++ b/components/navigation_metrics/navigation_metrics.h @@ -0,0 +1,16 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_NAVIGATION_METRICS_NAVIGATION_METRICS_H_ +#define COMPONENTS_NAVIGATION_METRICS_NAVIGATION_METRICS_H_ + +class GURL; + +namespace navigation_metrics { + +void RecordMainFrameNavigation(const GURL& url); + +} // namespace navigation_metrics + +#endif // COMPONENTS_NAVIGATION_METRICS_NAVIGATION_METRICS_H_ diff --git a/components/policy.gypi b/components/policy.gypi index 77fe110599..32aed7e467 100644 --- a/components/policy.gypi +++ b/components/policy.gypi @@ -20,6 +20,8 @@ 'conditions': [ ['configuration_policy==1', { 'sources': [ + 'policy/core/common/policy_namespace.cc', + 'policy/core/common/policy_namespace.h', 'policy/core/common/policy_pref_names.cc', 'policy/core/common/policy_pref_names.h', 'policy/core/common/policy_switches.cc', @@ -30,14 +32,12 @@ 'policy/policy_export.h', ], }, { # configuration_policy==0 - # The target 'policy_component' always exists. Later it will include - # some stubs when configuration_policy==0. For now this stub file is - # compiled so that an output is produced, otherwise the shared build - # breaks on iOS. - # TODO(joaodasilva): remove this comment and the temporary stub after - # moving one of the real stubs. http://crbug.com/271392 + # Some of the policy code is always enabled, so that other parts of + # Chrome can always interface with the PolicyService without having + # to #ifdef on ENABLE_CONFIGURATION_POLICY. 'sources': [ - 'policy/stub_to_remove.cc', + 'policy/core/common/policy_namespace.cc', + 'policy/core/common/policy_namespace.h', ], }], ], diff --git a/components/policy/core/common/policy_namespace.cc b/components/policy/core/common/policy_namespace.cc new file mode 100644 index 0000000000..0fac9ca1e4 --- /dev/null +++ b/components/policy/core/common/policy_namespace.cc @@ -0,0 +1,41 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/policy/core/common/policy_namespace.h" + +namespace policy { + +PolicyNamespace::PolicyNamespace() {} + +PolicyNamespace::PolicyNamespace(PolicyDomain domain, + const std::string& component_id) + : domain(domain), + component_id(component_id) {} + +PolicyNamespace::PolicyNamespace(const PolicyNamespace& other) + : domain(other.domain), + component_id(other.component_id) {} + +PolicyNamespace::~PolicyNamespace() {} + +PolicyNamespace& PolicyNamespace::operator=(const PolicyNamespace& other) { + domain = other.domain; + component_id = other.component_id; + return *this; +} + +bool PolicyNamespace::operator<(const PolicyNamespace& other) const { + return domain < other.domain || + (domain == other.domain && component_id < other.component_id); +} + +bool PolicyNamespace::operator==(const PolicyNamespace& other) const { + return domain == other.domain && component_id == other.component_id; +} + +bool PolicyNamespace::operator!=(const PolicyNamespace& other) const { + return !(*this == other); +} + +} // namespace policy diff --git a/components/policy/core/common/policy_namespace.h b/components/policy/core/common/policy_namespace.h new file mode 100644 index 0000000000..4d8cf1cc0f --- /dev/null +++ b/components/policy/core/common/policy_namespace.h @@ -0,0 +1,49 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_NAMESPACE_H_ +#define COMPONENTS_POLICY_CORE_COMMON_POLICY_NAMESPACE_H_ + +#include <string> + +#include "components/policy/policy_export.h" + +namespace policy { + +// Policies are namespaced by a (PolicyDomain, ID) pair. The meaning of the ID +// string depends on the domain; for example, if the PolicyDomain is +// "extensions" then the ID identifies the extension that the policies control. +enum POLICY_EXPORT PolicyDomain { + // The component ID for chrome policies is always the empty string. + POLICY_DOMAIN_CHROME, + + // The extensions policy domain is a work in progress. Included here for + // tests. + POLICY_DOMAIN_EXTENSIONS, + + // Must be the last entry. + POLICY_DOMAIN_SIZE, +}; + +// Groups a policy domain and a component ID in a single object representing +// a policy namespace. Objects of this class can be used as keys in std::maps. +struct POLICY_EXPORT PolicyNamespace { + public: + PolicyNamespace(); + PolicyNamespace(PolicyDomain domain, const std::string& component_id); + PolicyNamespace(const PolicyNamespace& other); + ~PolicyNamespace(); + + PolicyNamespace& operator=(const PolicyNamespace& other); + bool operator<(const PolicyNamespace& other) const; + bool operator==(const PolicyNamespace& other) const; + bool operator!=(const PolicyNamespace& other) const; + + PolicyDomain domain; + std::string component_id; +}; + +} // namespace policy + +#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_NAMESPACE_H_ diff --git a/components/policy/stub_to_remove.cc b/components/policy/stub_to_remove.cc deleted file mode 100644 index 6e352ace9c..0000000000 --- a/components/policy/stub_to_remove.cc +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// TODO(joaodasilva): remove this file and update the comment on policy.gypi. -// http://crbug.com/271392 diff --git a/components/test/data/json_schema/enum_schema.json b/components/test/data/json_schema/enum_schema.json index ae0c12af05..efb68de82e 100644 --- a/components/test/data/json_schema/enum_schema.json +++ b/components/test/data/json_schema/enum_schema.json @@ -1,3 +1,3 @@ { - "enum": ["foo", 42, false] + "enum": ["foo", 42, {"name": false, "description": "a false value"}] } diff --git a/components/tracing.target.darwin-arm.mk b/components/tracing.target.darwin-arm.mk index 1912f5095e..22c1cb9c28 100644 --- a/components/tracing.target.darwin-arm.mk +++ b/components/tracing.target.darwin-arm.mk @@ -67,13 +67,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -149,13 +149,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/tracing.target.darwin-mips.mk b/components/tracing.target.darwin-mips.mk index d6bd8cc44b..10da891d95 100644 --- a/components/tracing.target.darwin-mips.mk +++ b/components/tracing.target.darwin-mips.mk @@ -67,13 +67,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -149,13 +149,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/tracing.target.darwin-x86.mk b/components/tracing.target.darwin-x86.mk index d0249e0f13..1d41d4b24b 100644 --- a/components/tracing.target.darwin-x86.mk +++ b/components/tracing.target.darwin-x86.mk @@ -69,13 +69,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -154,13 +154,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/tracing.target.linux-arm.mk b/components/tracing.target.linux-arm.mk index 1912f5095e..22c1cb9c28 100644 --- a/components/tracing.target.linux-arm.mk +++ b/components/tracing.target.linux-arm.mk @@ -67,13 +67,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -149,13 +149,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/tracing.target.linux-mips.mk b/components/tracing.target.linux-mips.mk index d6bd8cc44b..10da891d95 100644 --- a/components/tracing.target.linux-mips.mk +++ b/components/tracing.target.linux-mips.mk @@ -67,13 +67,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -149,13 +149,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/tracing.target.linux-x86.mk b/components/tracing.target.linux-x86.mk index d0249e0f13..1d41d4b24b 100644 --- a/components/tracing.target.linux-x86.mk +++ b/components/tracing.target.linux-x86.mk @@ -69,13 +69,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -154,13 +154,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/tracing/child_trace_message_filter.cc b/components/tracing/child_trace_message_filter.cc index 9925f3fec4..721c676256 100644 --- a/components/tracing/child_trace_message_filter.cc +++ b/components/tracing/child_trace_message_filter.cc @@ -52,7 +52,8 @@ ChildTraceMessageFilter::~ChildTraceMessageFilter() {} void ChildTraceMessageFilter::OnBeginTracing( const std::string& category_filter_str, base::TimeTicks browser_time, - int options) { + int options, + bool tracing_startup) { #if defined(__native_client__) // NaCl and system times are offset by a bit, so subtract some time from // the captured timestamps. The value might be off by a bit due to messaging @@ -61,9 +62,15 @@ void ChildTraceMessageFilter::OnBeginTracing( browser_time; TraceLog::GetInstance()->SetTimeOffset(time_offset); #endif - TraceLog::GetInstance()->SetEnabled( - base::debug::CategoryFilter(category_filter_str), - static_cast<base::debug::TraceLog::Options>(options)); + + // Some subprocesses handle --trace-startup by themselves to begin + // trace as early as possible. Don't start twice, otherwise the trace + // buffer can't be correctly flushed on the end of startup tracing. + if (!tracing_startup || !TraceLog::GetInstance()->IsEnabled()) { + TraceLog::GetInstance()->SetEnabled( + base::debug::CategoryFilter(category_filter_str), + static_cast<base::debug::TraceLog::Options>(options)); + } } void ChildTraceMessageFilter::OnEndTracing() { diff --git a/components/tracing/child_trace_message_filter.h b/components/tracing/child_trace_message_filter.h index cbd300f38b..8fe301a9f5 100644 --- a/components/tracing/child_trace_message_filter.h +++ b/components/tracing/child_trace_message_filter.h @@ -32,7 +32,8 @@ class ChildTraceMessageFilter : public IPC::ChannelProxy::MessageFilter { // Message handlers. void OnBeginTracing(const std::string& category_filter_str, base::TimeTicks browser_time, - int options); + int options, + bool tracing_startup); void OnEndTracing(); void OnEnableMonitoring(const std::string& category_filter_str, base::TimeTicks browser_time, diff --git a/components/tracing/tracing_messages.h b/components/tracing/tracing_messages.h index 25b45bde77..2b491ba2ed 100644 --- a/components/tracing/tracing_messages.h +++ b/components/tracing/tracing_messages.h @@ -16,10 +16,11 @@ #define IPC_MESSAGE_START TracingMsgStart // Sent to all child processes to enable trace event recording. -IPC_MESSAGE_CONTROL3(TracingMsg_BeginTracing, +IPC_MESSAGE_CONTROL4(TracingMsg_BeginTracing, std::string /* category_filter_str */, base::TimeTicks /* browser_time */, - int /* base::debug::TraceLog::Options */) + int /* base::debug::TraceLog::Options */, + bool /* tracing_startup */) // Sent to all child processes to disable trace event recording. IPC_MESSAGE_CONTROL0(TracingMsg_EndTracing) diff --git a/components/translate/common/translate_metrics.cc b/components/translate/common/translate_metrics.cc index b095084464..54024913d4 100644 --- a/components/translate/common/translate_metrics.cc +++ b/components/translate/common/translate_metrics.cc @@ -23,6 +23,9 @@ const char kTranslateTimeToTranslate[] = "Translate.TimeToTranslate"; const char kTranslateUserActionDuration[] = "Translate.UserActionDuration"; const char kTranslatePageScheme[] = "Translate.PageScheme"; const char kTranslateSimilarLanguageMatch[] = "Translate.SimilarLanguageMatch"; +const char kTranslateModifyOriginalLang[] = "Translate.ModifyOriginalLang"; +const char kTranslateModifyTargetLang[] = "Translate.ModifyTargetlLang"; + const char kSchemeHttp[] = "http"; const char kSchemeHttps[] = "https"; @@ -33,6 +36,8 @@ struct MetricsEntry { }; // This entry table should be updated when new UMA items are added. +// TODO(miguelg) Move kTranslateModifyOriginalLang and +// kTranslateModifyTargetLang to the UX delegate once crbug/312720 is fixed. const MetricsEntry kMetricsEntries[] = { {UMA_LANGUAGE_DETECTION, kRenderer4LanguageDetection}, {UMA_CONTENT_LANGUAGE, kTranslateContentLanguage}, @@ -43,7 +48,9 @@ const MetricsEntry kMetricsEntries[] = { {UMA_TIME_TO_TRANSLATE, kTranslateTimeToTranslate}, {UMA_USER_ACTION_DURATION, kTranslateUserActionDuration}, {UMA_PAGE_SCHEME, kTranslatePageScheme}, - {UMA_SIMILAR_LANGUAGE_MATCH, kTranslateSimilarLanguageMatch}, }; + {UMA_SIMILAR_LANGUAGE_MATCH, kTranslateSimilarLanguageMatch}, + {UMA_MODIFY_ORIGINAL_LANG, kTranslateModifyOriginalLang}, + {UMA_MODIFY_TARGET_LANG, kTranslateModifyTargetLang}, }; COMPILE_ASSERT(arraysize(kMetricsEntries) == UMA_MAX, arraysize_of_kMetricsEntries_should_be_UMA_MAX); diff --git a/components/translate/common/translate_metrics.h b/components/translate/common/translate_metrics.h index 9baa268aa1..a38db44ad9 100644 --- a/components/translate/common/translate_metrics.h +++ b/components/translate/common/translate_metrics.h @@ -24,6 +24,8 @@ enum MetricsNameIndex { UMA_USER_ACTION_DURATION, UMA_PAGE_SCHEME, UMA_SIMILAR_LANGUAGE_MATCH, + UMA_MODIFY_ORIGINAL_LANG, + UMA_MODIFY_TARGET_LANG, UMA_MAX, }; diff --git a/components/user_prefs.target.darwin-arm.mk b/components/user_prefs.target.darwin-arm.mk index 50c1fbd5b1..70a256121b 100644 --- a/components/user_prefs.target.darwin-arm.mk +++ b/components/user_prefs.target.darwin-arm.mk @@ -65,13 +65,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -154,13 +154,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/user_prefs.target.darwin-mips.mk b/components/user_prefs.target.darwin-mips.mk index 079e437aaf..b4473ee8b5 100644 --- a/components/user_prefs.target.darwin-mips.mk +++ b/components/user_prefs.target.darwin-mips.mk @@ -64,13 +64,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -152,13 +152,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/user_prefs.target.darwin-x86.mk b/components/user_prefs.target.darwin-x86.mk index 604dd44252..1ef39166d5 100644 --- a/components/user_prefs.target.darwin-x86.mk +++ b/components/user_prefs.target.darwin-x86.mk @@ -67,13 +67,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -158,13 +158,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/user_prefs.target.linux-arm.mk b/components/user_prefs.target.linux-arm.mk index 50c1fbd5b1..70a256121b 100644 --- a/components/user_prefs.target.linux-arm.mk +++ b/components/user_prefs.target.linux-arm.mk @@ -65,13 +65,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -154,13 +154,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/user_prefs.target.linux-mips.mk b/components/user_prefs.target.linux-mips.mk index 079e437aaf..b4473ee8b5 100644 --- a/components/user_prefs.target.linux-mips.mk +++ b/components/user_prefs.target.linux-mips.mk @@ -64,13 +64,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -152,13 +152,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/user_prefs.target.linux-x86.mk b/components/user_prefs.target.linux-x86.mk index 604dd44252..1ef39166d5 100644 --- a/components/user_prefs.target.linux-x86.mk +++ b/components/user_prefs.target.linux-x86.mk @@ -67,13 +67,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -158,13 +158,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_browser.target.darwin-arm.mk b/components/visitedlink_browser.target.darwin-arm.mk index 65f6040061..dcfe8c6026 100644 --- a/components/visitedlink_browser.target.darwin-arm.mk +++ b/components/visitedlink_browser.target.darwin-arm.mk @@ -64,13 +64,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -149,13 +149,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_browser.target.darwin-mips.mk b/components/visitedlink_browser.target.darwin-mips.mk index bf5c886142..9c9efa46a0 100644 --- a/components/visitedlink_browser.target.darwin-mips.mk +++ b/components/visitedlink_browser.target.darwin-mips.mk @@ -63,13 +63,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -147,13 +147,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_browser.target.darwin-x86.mk b/components/visitedlink_browser.target.darwin-x86.mk index 37a34c7d5d..f6b390a321 100644 --- a/components/visitedlink_browser.target.darwin-x86.mk +++ b/components/visitedlink_browser.target.darwin-x86.mk @@ -66,13 +66,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -154,13 +154,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_browser.target.linux-arm.mk b/components/visitedlink_browser.target.linux-arm.mk index 65f6040061..dcfe8c6026 100644 --- a/components/visitedlink_browser.target.linux-arm.mk +++ b/components/visitedlink_browser.target.linux-arm.mk @@ -64,13 +64,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -149,13 +149,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_browser.target.linux-mips.mk b/components/visitedlink_browser.target.linux-mips.mk index bf5c886142..9c9efa46a0 100644 --- a/components/visitedlink_browser.target.linux-mips.mk +++ b/components/visitedlink_browser.target.linux-mips.mk @@ -63,13 +63,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -147,13 +147,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_browser.target.linux-x86.mk b/components/visitedlink_browser.target.linux-x86.mk index 37a34c7d5d..f6b390a321 100644 --- a/components/visitedlink_browser.target.linux-x86.mk +++ b/components/visitedlink_browser.target.linux-x86.mk @@ -66,13 +66,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -154,13 +154,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_common.target.darwin-arm.mk b/components/visitedlink_common.target.darwin-arm.mk index a8cd30ebca..a486d133d5 100644 --- a/components/visitedlink_common.target.darwin-arm.mk +++ b/components/visitedlink_common.target.darwin-arm.mk @@ -64,13 +64,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -148,13 +148,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_common.target.darwin-mips.mk b/components/visitedlink_common.target.darwin-mips.mk index 9c19cac95e..361eeef28a 100644 --- a/components/visitedlink_common.target.darwin-mips.mk +++ b/components/visitedlink_common.target.darwin-mips.mk @@ -63,13 +63,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -146,13 +146,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_common.target.darwin-x86.mk b/components/visitedlink_common.target.darwin-x86.mk index 5c03d40154..1ffd57790e 100644 --- a/components/visitedlink_common.target.darwin-x86.mk +++ b/components/visitedlink_common.target.darwin-x86.mk @@ -66,13 +66,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -153,13 +153,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_common.target.linux-arm.mk b/components/visitedlink_common.target.linux-arm.mk index a8cd30ebca..a486d133d5 100644 --- a/components/visitedlink_common.target.linux-arm.mk +++ b/components/visitedlink_common.target.linux-arm.mk @@ -64,13 +64,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -148,13 +148,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_common.target.linux-mips.mk b/components/visitedlink_common.target.linux-mips.mk index 9c19cac95e..361eeef28a 100644 --- a/components/visitedlink_common.target.linux-mips.mk +++ b/components/visitedlink_common.target.linux-mips.mk @@ -63,13 +63,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -146,13 +146,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_common.target.linux-x86.mk b/components/visitedlink_common.target.linux-x86.mk index 5c03d40154..1ffd57790e 100644 --- a/components/visitedlink_common.target.linux-x86.mk +++ b/components/visitedlink_common.target.linux-x86.mk @@ -66,13 +66,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -153,13 +153,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_renderer.target.darwin-arm.mk b/components/visitedlink_renderer.target.darwin-arm.mk index 8de84f45aa..3d69fb961b 100644 --- a/components/visitedlink_renderer.target.darwin-arm.mk +++ b/components/visitedlink_renderer.target.darwin-arm.mk @@ -65,13 +65,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -175,13 +175,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_renderer.target.darwin-mips.mk b/components/visitedlink_renderer.target.darwin-mips.mk index 34ae36201f..70f1e082f5 100644 --- a/components/visitedlink_renderer.target.darwin-mips.mk +++ b/components/visitedlink_renderer.target.darwin-mips.mk @@ -64,13 +64,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -173,13 +173,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_renderer.target.darwin-x86.mk b/components/visitedlink_renderer.target.darwin-x86.mk index 35bf3cd69e..735758f5ee 100644 --- a/components/visitedlink_renderer.target.darwin-x86.mk +++ b/components/visitedlink_renderer.target.darwin-x86.mk @@ -67,13 +67,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -180,13 +180,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_renderer.target.linux-arm.mk b/components/visitedlink_renderer.target.linux-arm.mk index 8de84f45aa..3d69fb961b 100644 --- a/components/visitedlink_renderer.target.linux-arm.mk +++ b/components/visitedlink_renderer.target.linux-arm.mk @@ -65,13 +65,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -175,13 +175,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_renderer.target.linux-mips.mk b/components/visitedlink_renderer.target.linux-mips.mk index 34ae36201f..70f1e082f5 100644 --- a/components/visitedlink_renderer.target.linux-mips.mk +++ b/components/visitedlink_renderer.target.linux-mips.mk @@ -64,13 +64,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -173,13 +173,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/visitedlink_renderer.target.linux-x86.mk b/components/visitedlink_renderer.target.linux-x86.mk index 35bf3cd69e..735758f5ee 100644 --- a/components/visitedlink_renderer.target.linux-x86.mk +++ b/components/visitedlink_renderer.target.linux-x86.mk @@ -67,13 +67,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -180,13 +180,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android.target.darwin-arm.mk b/components/web_contents_delegate_android.target.darwin-arm.mk index 8095c54db3..0f73802b39 100644 --- a/components/web_contents_delegate_android.target.darwin-arm.mk +++ b/components/web_contents_delegate_android.target.darwin-arm.mk @@ -70,13 +70,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -178,13 +178,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android.target.darwin-mips.mk b/components/web_contents_delegate_android.target.darwin-mips.mk index d752183c0c..52e14f4390 100644 --- a/components/web_contents_delegate_android.target.darwin-mips.mk +++ b/components/web_contents_delegate_android.target.darwin-mips.mk @@ -69,13 +69,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -176,13 +176,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android.target.darwin-x86.mk b/components/web_contents_delegate_android.target.darwin-x86.mk index d23ab538e8..af33556b44 100644 --- a/components/web_contents_delegate_android.target.darwin-x86.mk +++ b/components/web_contents_delegate_android.target.darwin-x86.mk @@ -72,13 +72,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -182,13 +182,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android.target.linux-arm.mk b/components/web_contents_delegate_android.target.linux-arm.mk index 8095c54db3..0f73802b39 100644 --- a/components/web_contents_delegate_android.target.linux-arm.mk +++ b/components/web_contents_delegate_android.target.linux-arm.mk @@ -70,13 +70,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -178,13 +178,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android.target.linux-mips.mk b/components/web_contents_delegate_android.target.linux-mips.mk index d752183c0c..52e14f4390 100644 --- a/components/web_contents_delegate_android.target.linux-mips.mk +++ b/components/web_contents_delegate_android.target.linux-mips.mk @@ -69,13 +69,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -176,13 +176,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android.target.linux-x86.mk b/components/web_contents_delegate_android.target.linux-x86.mk index d23ab538e8..af33556b44 100644 --- a/components/web_contents_delegate_android.target.linux-x86.mk +++ b/components/web_contents_delegate_android.target.linux-x86.mk @@ -72,13 +72,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -182,13 +182,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android_jni_headers.target.darwin-arm.mk b/components/web_contents_delegate_android_jni_headers.target.darwin-arm.mk index eea1368674..12654b9b33 100644 --- a/components/web_contents_delegate_android_jni_headers.target.darwin-arm.mk +++ b/components/web_contents_delegate_android_jni_headers.target.darwin-arm.mk @@ -92,13 +92,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -170,13 +170,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android_jni_headers.target.darwin-mips.mk b/components/web_contents_delegate_android_jni_headers.target.darwin-mips.mk index feff9d6b1b..c2e42aa3f8 100644 --- a/components/web_contents_delegate_android_jni_headers.target.darwin-mips.mk +++ b/components/web_contents_delegate_android_jni_headers.target.darwin-mips.mk @@ -91,13 +91,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -168,13 +168,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android_jni_headers.target.darwin-x86.mk b/components/web_contents_delegate_android_jni_headers.target.darwin-x86.mk index 39ac216baa..5db42f6861 100644 --- a/components/web_contents_delegate_android_jni_headers.target.darwin-x86.mk +++ b/components/web_contents_delegate_android_jni_headers.target.darwin-x86.mk @@ -94,13 +94,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -175,13 +175,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android_jni_headers.target.linux-arm.mk b/components/web_contents_delegate_android_jni_headers.target.linux-arm.mk index eea1368674..12654b9b33 100644 --- a/components/web_contents_delegate_android_jni_headers.target.linux-arm.mk +++ b/components/web_contents_delegate_android_jni_headers.target.linux-arm.mk @@ -92,13 +92,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -170,13 +170,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android_jni_headers.target.linux-mips.mk b/components/web_contents_delegate_android_jni_headers.target.linux-mips.mk index feff9d6b1b..c2e42aa3f8 100644 --- a/components/web_contents_delegate_android_jni_headers.target.linux-mips.mk +++ b/components/web_contents_delegate_android_jni_headers.target.linux-mips.mk @@ -91,13 +91,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -168,13 +168,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_contents_delegate_android_jni_headers.target.linux-x86.mk b/components/web_contents_delegate_android_jni_headers.target.linux-x86.mk index 39ac216baa..5db42f6861 100644 --- a/components/web_contents_delegate_android_jni_headers.target.linux-x86.mk +++ b/components/web_contents_delegate_android_jni_headers.target.linux-x86.mk @@ -94,13 +94,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -175,13 +175,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/web_modal/web_contents_modal_dialog_manager.cc b/components/web_modal/web_contents_modal_dialog_manager.cc index f454445b8f..85b0448d35 100644 --- a/components/web_modal/web_contents_modal_dialog_manager.cc +++ b/components/web_modal/web_contents_modal_dialog_manager.cc @@ -51,7 +51,7 @@ void WebContentsModalDialogManager::FocusTopmostDialog() { native_manager_->FocusDialog(child_dialogs_.front().dialog); } -void WebContentsModalDialogManager::SetCloseOnInterstitialWebUI( +void WebContentsModalDialogManager::SetCloseOnInterstitialPage( NativeWebContentsModalDialog dialog, bool close) { WebContentsModalDialogList::iterator loc = FindDialogState(dialog); @@ -93,7 +93,14 @@ WebContentsModalDialogManager::WebContentsModalDialogManager( WebContentsModalDialogManager::DialogState::DialogState( NativeWebContentsModalDialog dialog) : dialog(dialog), - close_on_interstitial_webui(false) { +#if defined(OS_WIN) || defined(USE_AURA) + close_on_interstitial_webui(true) +#else + // TODO(wittman): Test that closing on interstitial webui works properly + // on Mac and use the true default for all platforms. + close_on_interstitial_webui(false) +#endif + { } WebContentsModalDialogManager::WebContentsModalDialogList::iterator diff --git a/components/web_modal/web_contents_modal_dialog_manager.h b/components/web_modal/web_contents_modal_dialog_manager.h index 253de18d0b..dc32674147 100644 --- a/components/web_modal/web_contents_modal_dialog_manager.h +++ b/components/web_modal/web_contents_modal_dialog_manager.h @@ -43,8 +43,8 @@ class WebContentsModalDialogManager void FocusTopmostDialog(); // Set to true to close the window when a page load starts on the WebContents. - void SetCloseOnInterstitialWebUI(NativeWebContentsModalDialog dialog, - bool close); + void SetCloseOnInterstitialPage(NativeWebContentsModalDialog dialog, + bool close); // Overriden from NativeWebContentsModalDialogManagerDelegate: virtual content::WebContents* GetWebContents() const OVERRIDE; diff --git a/components/web_modal/web_contents_modal_dialog_manager_unittest.cc b/components/web_modal/web_contents_modal_dialog_manager_unittest.cc index 7095498a4b..1353f109ff 100644 --- a/components/web_modal/web_contents_modal_dialog_manager_unittest.cc +++ b/components/web_modal/web_contents_modal_dialog_manager_unittest.cc @@ -198,9 +198,8 @@ TEST_F(WebContentsModalDialogManagerTest, VisibilityObservation) { native_manager->GetDialogState(dialog1)); } -// Test that attaching an interstitial WebUI page closes dialogs configured to -// close on interstitial WebUI. -TEST_F(WebContentsModalDialogManagerTest, InterstitialWebUI) { +// Test that attaching an interstitial page closes dialogs configured to close. +TEST_F(WebContentsModalDialogManagerTest, InterstitialPage) { const NativeWebContentsModalDialog dialog1 = MakeFakeDialog(); const NativeWebContentsModalDialog dialog2 = MakeFakeDialog(); const NativeWebContentsModalDialog dialog3 = MakeFakeDialog(); @@ -209,8 +208,14 @@ TEST_F(WebContentsModalDialogManagerTest, InterstitialWebUI) { manager->ShowDialog(dialog2); manager->ShowDialog(dialog3); - manager->SetCloseOnInterstitialWebUI(dialog1, true); - manager->SetCloseOnInterstitialWebUI(dialog3, true); +#if defined(OS_WIN) || defined(USE_AURA) + manager->SetCloseOnInterstitialPage(dialog2, false); +#else + // TODO(wittman): Remove this section once Mac is changed to close on + // interstitial pages by default. + manager->SetCloseOnInterstitialPage(dialog1, true); + manager->SetCloseOnInterstitialPage(dialog3, true); +#endif test_api->DidAttachInterstitialPage(); EXPECT_EQ(TestNativeWebContentsModalDialogManager::CLOSED, diff --git a/components/webdata_common.target.darwin-arm.mk b/components/webdata_common.target.darwin-arm.mk index bf036238f1..9e5cd4a91c 100644 --- a/components/webdata_common.target.darwin-arm.mk +++ b/components/webdata_common.target.darwin-arm.mk @@ -69,13 +69,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -154,13 +154,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/webdata_common.target.darwin-mips.mk b/components/webdata_common.target.darwin-mips.mk index 5f410a6769..5d8adfc1f8 100644 --- a/components/webdata_common.target.darwin-mips.mk +++ b/components/webdata_common.target.darwin-mips.mk @@ -68,13 +68,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -152,13 +152,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/webdata_common.target.darwin-x86.mk b/components/webdata_common.target.darwin-x86.mk index ac4636ad67..9b8c1aba08 100644 --- a/components/webdata_common.target.darwin-x86.mk +++ b/components/webdata_common.target.darwin-x86.mk @@ -71,13 +71,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -159,13 +159,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/webdata_common.target.linux-arm.mk b/components/webdata_common.target.linux-arm.mk index bf036238f1..9e5cd4a91c 100644 --- a/components/webdata_common.target.linux-arm.mk +++ b/components/webdata_common.target.linux-arm.mk @@ -69,13 +69,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -154,13 +154,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/webdata_common.target.linux-mips.mk b/components/webdata_common.target.linux-mips.mk index 5f410a6769..5d8adfc1f8 100644 --- a/components/webdata_common.target.linux-mips.mk +++ b/components/webdata_common.target.linux-mips.mk @@ -68,13 +68,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -152,13 +152,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ diff --git a/components/webdata_common.target.linux-x86.mk b/components/webdata_common.target.linux-x86.mk index ac4636ad67..9b8c1aba08 100644 --- a/components/webdata_common.target.linux-x86.mk +++ b/components/webdata_common.target.linux-x86.mk @@ -71,13 +71,13 @@ MY_DEFS_Debug := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ @@ -159,13 +159,13 @@ MY_DEFS_Release := \ '-DANGLE_DX11' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ - '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ - '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DDISABLE_NACL' \ '-DCHROMIUM_BUILD' \ '-DUSE_LIBJPEG_TURBO=1' \ '-DUSE_PROPRIETARY_CODECS' \ '-DENABLE_CONFIGURATION_POLICY' \ + '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ + '-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ '-DCLD_VERSION=1' \ |