diff --git a/base/trace_event/trace_event_argument.cc b/base/trace_event/trace_event_argument.cc index fa1c91b..65965b1 100644 --- a/base/trace_event/trace_event_argument.cc +++ b/base/trace_event/trace_event_argument.cc
@@ -361,14 +361,13 @@ DCHECK((cur_dict && !cur_list) || (cur_list && !cur_dict)); switch (*type) { case kTypeStartDict: { - auto* new_dict = new DictionaryValue(); + auto new_dict = base::MakeUnique<DictionaryValue>(); if (cur_dict) { - cur_dict->SetWithoutPathExpansion(ReadKeyName(it), - WrapUnique(new_dict)); stack.push_back(cur_dict); - cur_dict = new_dict; + cur_dict = cur_dict->SetDictionaryWithoutPathExpansion( + ReadKeyName(it), std::move(new_dict)); } else { - cur_list->Append(WrapUnique(new_dict)); + cur_list->Append(std::move(new_dict)); // |new_dict| is invalidated at this point, so |cur_dict| needs to be // reset. cur_list->GetDictionary(cur_list->GetSize() - 1, &cur_dict); @@ -388,17 +387,17 @@ } break; case kTypeStartArray: { - auto* new_list = new ListValue(); + auto new_list = base::MakeUnique<ListValue>(); if (cur_dict) { - cur_dict->SetWithoutPathExpansion(ReadKeyName(it), - WrapUnique(new_list)); stack.push_back(cur_dict); + cur_list = cur_dict->SetListWithoutPathExpansion(ReadKeyName(it), + std::move(new_list)); cur_dict = nullptr; - cur_list = new_list; } else { - cur_list->Append(WrapUnique(new_list)); + cur_list->Append(std::move(new_list)); stack.push_back(cur_list); - // |cur_list| is invalidated at this point, so it needs to be reset. + // |cur_list| is invalidated at this point by the Append, so it needs + // to be reset. cur_list->GetList(cur_list->GetSize() - 1, &cur_list); } } break;
diff --git a/base/values_unittest.cc b/base/values_unittest.cc index 23f2960..38200868 100644 --- a/base/values_unittest.cc +++ b/base/values_unittest.cc
@@ -777,45 +777,25 @@ TEST(ValuesTest, DeepCopy) { DictionaryValue original_dict; - auto scoped_null = MakeUnique<Value>(); - Value* original_null = scoped_null.get(); - original_dict.Set("null", std::move(scoped_null)); - std::unique_ptr<Value> scoped_bool(new Value(true)); - Value* original_bool = scoped_bool.get(); - original_dict.Set("bool", std::move(scoped_bool)); - std::unique_ptr<Value> scoped_int(new Value(42)); - Value* original_int = scoped_int.get(); - original_dict.Set("int", std::move(scoped_int)); - std::unique_ptr<Value> scoped_double(new Value(3.14)); - Value* original_double = scoped_double.get(); - original_dict.Set("double", std::move(scoped_double)); - std::unique_ptr<Value> scoped_string(new Value("hello")); - Value* original_string = scoped_string.get(); - original_dict.Set("string", std::move(scoped_string)); - std::unique_ptr<Value> scoped_string16(new Value(ASCIIToUTF16("hello16"))); - Value* original_string16 = scoped_string16.get(); - original_dict.Set("string16", std::move(scoped_string16)); + Value* null_weak = original_dict.Set("null", MakeUnique<Value>()); + Value* bool_weak = original_dict.Set("bool", MakeUnique<Value>(true)); + Value* int_weak = original_dict.Set("int", MakeUnique<Value>(42)); + Value* double_weak = original_dict.Set("double", MakeUnique<Value>(3.14)); + Value* string_weak = original_dict.Set("string", MakeUnique<Value>("hello")); + Value* string16_weak = + original_dict.Set("string16", MakeUnique<Value>(ASCIIToUTF16("hello16"))); - Value::BlobStorage original_buffer(42, '!'); - std::unique_ptr<Value> scoped_binary(new Value(std::move(original_buffer))); - Value* original_binary = scoped_binary.get(); - original_dict.Set("binary", std::move(scoped_binary)); + Value* binary_weak = original_dict.Set( + "binary", MakeUnique<Value>(Value::BlobStorage(42, '!'))); - std::unique_ptr<ListValue> scoped_list(new ListValue()); - Value* original_list = scoped_list.get(); - std::unique_ptr<Value> scoped_list_element_0(new Value(0)); - Value* original_list_element_0 = scoped_list_element_0.get(); - scoped_list->Append(std::move(scoped_list_element_0)); - std::unique_ptr<Value> scoped_list_element_1(new Value(1)); - Value* original_list_element_1 = scoped_list_element_1.get(); - scoped_list->Append(std::move(scoped_list_element_1)); - original_dict.Set("list", std::move(scoped_list)); + Value* list_weak = original_dict.Set( + "list", MakeUnique<Value>(Value::ListStorage({Value(0), Value(1)}))); + Value* list_element_0_weak = &list_weak->GetList()[0]; + Value* list_element_1_weak = &list_weak->GetList()[1]; - std::unique_ptr<DictionaryValue> scoped_nested_dictionary( - new DictionaryValue()); - Value* original_nested_dictionary = scoped_nested_dictionary.get(); - scoped_nested_dictionary->SetString("key", "value"); - original_dict.Set("dictionary", std::move(scoped_nested_dictionary)); + DictionaryValue* dict_weak = + original_dict.SetDictionary("dictionary", MakeUnique<DictionaryValue>()); + dict_weak->SetString("key", "value"); auto copy_dict = MakeUnique<DictionaryValue>(original_dict); ASSERT_TRUE(copy_dict.get()); @@ -824,13 +804,13 @@ Value* copy_null = NULL; ASSERT_TRUE(copy_dict->Get("null", ©_null)); ASSERT_TRUE(copy_null); - ASSERT_NE(copy_null, original_null); + ASSERT_NE(copy_null, null_weak); ASSERT_TRUE(copy_null->IsType(Value::Type::NONE)); Value* copy_bool = NULL; ASSERT_TRUE(copy_dict->Get("bool", ©_bool)); ASSERT_TRUE(copy_bool); - ASSERT_NE(copy_bool, original_bool); + ASSERT_NE(copy_bool, bool_weak); ASSERT_TRUE(copy_bool->IsType(Value::Type::BOOLEAN)); bool copy_bool_value = false; ASSERT_TRUE(copy_bool->GetAsBoolean(©_bool_value)); @@ -839,7 +819,7 @@ Value* copy_int = NULL; ASSERT_TRUE(copy_dict->Get("int", ©_int)); ASSERT_TRUE(copy_int); - ASSERT_NE(copy_int, original_int); + ASSERT_NE(copy_int, int_weak); ASSERT_TRUE(copy_int->IsType(Value::Type::INTEGER)); int copy_int_value = 0; ASSERT_TRUE(copy_int->GetAsInteger(©_int_value)); @@ -848,7 +828,7 @@ Value* copy_double = NULL; ASSERT_TRUE(copy_dict->Get("double", ©_double)); ASSERT_TRUE(copy_double); - ASSERT_NE(copy_double, original_double); + ASSERT_NE(copy_double, double_weak); ASSERT_TRUE(copy_double->IsType(Value::Type::DOUBLE)); double copy_double_value = 0; ASSERT_TRUE(copy_double->GetAsDouble(©_double_value)); @@ -857,7 +837,7 @@ Value* copy_string = NULL; ASSERT_TRUE(copy_dict->Get("string", ©_string)); ASSERT_TRUE(copy_string); - ASSERT_NE(copy_string, original_string); + ASSERT_NE(copy_string, string_weak); ASSERT_TRUE(copy_string->IsType(Value::Type::STRING)); std::string copy_string_value; string16 copy_string16_value; @@ -869,7 +849,7 @@ Value* copy_string16 = NULL; ASSERT_TRUE(copy_dict->Get("string16", ©_string16)); ASSERT_TRUE(copy_string16); - ASSERT_NE(copy_string16, original_string16); + ASSERT_NE(copy_string16, string16_weak); ASSERT_TRUE(copy_string16->IsType(Value::Type::STRING)); ASSERT_TRUE(copy_string16->GetAsString(©_string_value)); ASSERT_TRUE(copy_string16->GetAsString(©_string16_value)); @@ -879,15 +859,15 @@ Value* copy_binary = NULL; ASSERT_TRUE(copy_dict->Get("binary", ©_binary)); ASSERT_TRUE(copy_binary); - ASSERT_NE(copy_binary, original_binary); + ASSERT_NE(copy_binary, binary_weak); ASSERT_TRUE(copy_binary->IsType(Value::Type::BINARY)); - ASSERT_NE(original_binary->GetBlob().data(), copy_binary->GetBlob().data()); - ASSERT_EQ(original_binary->GetBlob(), copy_binary->GetBlob()); + ASSERT_NE(binary_weak->GetBlob().data(), copy_binary->GetBlob().data()); + ASSERT_EQ(binary_weak->GetBlob(), copy_binary->GetBlob()); Value* copy_value = NULL; ASSERT_TRUE(copy_dict->Get("list", ©_value)); ASSERT_TRUE(copy_value); - ASSERT_NE(copy_value, original_list); + ASSERT_NE(copy_value, list_weak); ASSERT_TRUE(copy_value->IsType(Value::Type::LIST)); ListValue* copy_list = NULL; ASSERT_TRUE(copy_value->GetAsList(©_list)); @@ -897,7 +877,7 @@ Value* copy_list_element_0; ASSERT_TRUE(copy_list->Get(0, ©_list_element_0)); ASSERT_TRUE(copy_list_element_0); - ASSERT_NE(copy_list_element_0, original_list_element_0); + ASSERT_NE(copy_list_element_0, list_element_0_weak); int copy_list_element_0_value; ASSERT_TRUE(copy_list_element_0->GetAsInteger(©_list_element_0_value)); ASSERT_EQ(0, copy_list_element_0_value); @@ -905,7 +885,7 @@ Value* copy_list_element_1; ASSERT_TRUE(copy_list->Get(1, ©_list_element_1)); ASSERT_TRUE(copy_list_element_1); - ASSERT_NE(copy_list_element_1, original_list_element_1); + ASSERT_NE(copy_list_element_1, list_element_1_weak); int copy_list_element_1_value; ASSERT_TRUE(copy_list_element_1->GetAsInteger(©_list_element_1_value)); ASSERT_EQ(1, copy_list_element_1_value); @@ -913,7 +893,7 @@ copy_value = NULL; ASSERT_TRUE(copy_dict->Get("dictionary", ©_value)); ASSERT_TRUE(copy_value); - ASSERT_NE(copy_value, original_nested_dictionary); + ASSERT_NE(copy_value, dict_weak); ASSERT_TRUE(copy_value->IsType(Value::Type::DICTIONARY)); DictionaryValue* copy_nested_dictionary = NULL; ASSERT_TRUE(copy_value->GetAsDictionary(©_nested_dictionary)); @@ -942,17 +922,16 @@ EXPECT_EQ(dv, *copy); std::unique_ptr<ListValue> list(new ListValue); - ListValue* original_list = list.get(); list->Append(MakeUnique<Value>()); list->Append(WrapUnique(new DictionaryValue)); auto list_copy = MakeUnique<Value>(*list); - dv.Set("f", std::move(list)); + ListValue* list_weak = dv.SetList("f", std::move(list)); EXPECT_NE(dv, *copy); copy->Set("f", std::move(list_copy)); EXPECT_EQ(dv, *copy); - original_list->Append(MakeUnique<Value>(true)); + list_weak->Append(MakeUnique<Value>(true)); EXPECT_NE(dv, *copy); // Check if Equals detects differences in only the keys. @@ -1108,72 +1087,53 @@ TEST(ValuesTest, DeepCopyCovariantReturnTypes) { DictionaryValue original_dict; - auto scoped_null = MakeUnique<Value>(); - Value* original_null = scoped_null.get(); - original_dict.Set("null", std::move(scoped_null)); - std::unique_ptr<Value> scoped_bool(new Value(true)); - Value* original_bool = scoped_bool.get(); - original_dict.Set("bool", std::move(scoped_bool)); - std::unique_ptr<Value> scoped_int(new Value(42)); - Value* original_int = scoped_int.get(); - original_dict.Set("int", std::move(scoped_int)); - std::unique_ptr<Value> scoped_double(new Value(3.14)); - Value* original_double = scoped_double.get(); - original_dict.Set("double", std::move(scoped_double)); - std::unique_ptr<Value> scoped_string(new Value("hello")); - Value* original_string = scoped_string.get(); - original_dict.Set("string", std::move(scoped_string)); - std::unique_ptr<Value> scoped_string16(new Value(ASCIIToUTF16("hello16"))); - Value* original_string16 = scoped_string16.get(); - original_dict.Set("string16", std::move(scoped_string16)); + Value* null_weak = original_dict.Set("null", MakeUnique<Value>()); + Value* bool_weak = original_dict.Set("bool", MakeUnique<Value>(true)); + Value* int_weak = original_dict.Set("int", MakeUnique<Value>(42)); + Value* double_weak = original_dict.Set("double", MakeUnique<Value>(3.14)); + Value* string_weak = original_dict.Set("string", MakeUnique<Value>("hello")); + Value* string16_weak = + original_dict.Set("string16", MakeUnique<Value>(ASCIIToUTF16("hello16"))); - Value::BlobStorage original_buffer(42, '!'); - std::unique_ptr<Value> scoped_binary(new Value(std::move(original_buffer))); - Value* original_binary = scoped_binary.get(); - original_dict.Set("binary", std::move(scoped_binary)); + Value* binary_weak = original_dict.Set( + "binary", MakeUnique<Value>(Value::BlobStorage(42, '!'))); - std::unique_ptr<ListValue> scoped_list(new ListValue()); - Value* original_list = scoped_list.get(); - std::unique_ptr<Value> scoped_list_element_0(new Value(0)); - scoped_list->Append(std::move(scoped_list_element_0)); - std::unique_ptr<Value> scoped_list_element_1(new Value(1)); - scoped_list->Append(std::move(scoped_list_element_1)); - original_dict.Set("list", std::move(scoped_list)); + Value* list_weak = original_dict.Set( + "list", MakeUnique<Value>(Value::ListStorage({Value(0), Value(1)}))); auto copy_dict = MakeUnique<Value>(original_dict); - auto copy_null = MakeUnique<Value>(*original_null); - auto copy_bool = MakeUnique<Value>(*original_bool); - auto copy_int = MakeUnique<Value>(*original_int); - auto copy_double = MakeUnique<Value>(*original_double); - auto copy_string = MakeUnique<Value>(*original_string); - auto copy_string16 = MakeUnique<Value>(*original_string16); - auto copy_binary = MakeUnique<Value>(*original_binary); - auto copy_list = MakeUnique<Value>(*original_list); + auto copy_null = MakeUnique<Value>(*null_weak); + auto copy_bool = MakeUnique<Value>(*bool_weak); + auto copy_int = MakeUnique<Value>(*int_weak); + auto copy_double = MakeUnique<Value>(*double_weak); + auto copy_string = MakeUnique<Value>(*string_weak); + auto copy_string16 = MakeUnique<Value>(*string16_weak); + auto copy_binary = MakeUnique<Value>(*binary_weak); + auto copy_list = MakeUnique<Value>(*list_weak); EXPECT_EQ(original_dict, *copy_dict); - EXPECT_EQ(*original_null, *copy_null); - EXPECT_EQ(*original_bool, *copy_bool); - EXPECT_EQ(*original_int, *copy_int); - EXPECT_EQ(*original_double, *copy_double); - EXPECT_EQ(*original_string, *copy_string); - EXPECT_EQ(*original_string16, *copy_string16); - EXPECT_EQ(*original_binary, *copy_binary); - EXPECT_EQ(*original_list, *copy_list); + EXPECT_EQ(*null_weak, *copy_null); + EXPECT_EQ(*bool_weak, *copy_bool); + EXPECT_EQ(*int_weak, *copy_int); + EXPECT_EQ(*double_weak, *copy_double); + EXPECT_EQ(*string_weak, *copy_string); + EXPECT_EQ(*string16_weak, *copy_string16); + EXPECT_EQ(*binary_weak, *copy_binary); + EXPECT_EQ(*list_weak, *copy_list); } TEST(ValuesTest, RemoveEmptyChildren) { - std::unique_ptr<DictionaryValue> root(new DictionaryValue); + auto root = base::MakeUnique<DictionaryValue>(); // Remove empty lists and dictionaries. - root->Set("empty_dict", WrapUnique(new DictionaryValue)); - root->Set("empty_list", WrapUnique(new ListValue)); - root->SetWithoutPathExpansion("a.b.c.d.e", - WrapUnique(new DictionaryValue)); + root->Set("empty_dict", MakeUnique<DictionaryValue>()); + root->Set("empty_list", MakeUnique<ListValue>()); + root->SetWithoutPathExpansion("a.b.c.d.e", MakeUnique<DictionaryValue>()); root = root->DeepCopyWithoutEmptyChildren(); EXPECT_TRUE(root->empty()); // Make sure we don't prune too much. root->SetBoolean("bool", true); - root->Set("empty_dict", WrapUnique(new DictionaryValue)); + root->Set("empty_dict", MakeUnique<DictionaryValue>()); root->SetString("empty_string", std::string()); root = root->DeepCopyWithoutEmptyChildren(); EXPECT_EQ(2U, root->size()); @@ -1185,22 +1145,22 @@ // Nested test cases. These should all reduce back to the bool and string // set above. { - root->Set("a.b.c.d.e", WrapUnique(new DictionaryValue)); + root->Set("a.b.c.d.e", MakeUnique<DictionaryValue>()); root = root->DeepCopyWithoutEmptyChildren(); EXPECT_EQ(2U, root->size()); } { - std::unique_ptr<DictionaryValue> inner(new DictionaryValue); - inner->Set("empty_dict", WrapUnique(new DictionaryValue)); - inner->Set("empty_list", WrapUnique(new ListValue)); + auto inner = base::MakeUnique<DictionaryValue>(); + inner->Set("empty_dict", MakeUnique<DictionaryValue>()); + inner->Set("empty_list", MakeUnique<ListValue>()); root->Set("dict_with_empty_children", std::move(inner)); root = root->DeepCopyWithoutEmptyChildren(); EXPECT_EQ(2U, root->size()); } { - std::unique_ptr<ListValue> inner(new ListValue); - inner->Append(WrapUnique(new DictionaryValue)); - inner->Append(WrapUnique(new ListValue)); + auto inner = base::MakeUnique<ListValue>(); + inner->Append(MakeUnique<DictionaryValue>()); + inner->Append(MakeUnique<ListValue>()); root->Set("list_with_empty_children", std::move(inner)); root = root->DeepCopyWithoutEmptyChildren(); EXPECT_EQ(2U, root->size()); @@ -1208,13 +1168,13 @@ // Nested with siblings. { - std::unique_ptr<ListValue> inner(new ListValue()); - inner->Append(WrapUnique(new DictionaryValue)); - inner->Append(WrapUnique(new ListValue)); + auto inner = base::MakeUnique<ListValue>(); + inner->Append(MakeUnique<DictionaryValue>()); + inner->Append(MakeUnique<ListValue>()); root->Set("list_with_empty_children", std::move(inner)); - std::unique_ptr<DictionaryValue> inner2(new DictionaryValue); - inner2->Set("empty_dict", WrapUnique(new DictionaryValue)); - inner2->Set("empty_list", WrapUnique(new ListValue)); + auto inner2 = base::MakeUnique<DictionaryValue>(); + inner2->Set("empty_dict", MakeUnique<DictionaryValue>()); + inner2->Set("empty_list", MakeUnique<ListValue>()); root->Set("dict_with_empty_children", std::move(inner2)); root = root->DeepCopyWithoutEmptyChildren(); EXPECT_EQ(2U, root->size()); @@ -1222,10 +1182,10 @@ // Make sure nested values don't get pruned. { - std::unique_ptr<ListValue> inner(new ListValue); - std::unique_ptr<ListValue> inner2(new ListValue); + auto inner = base::MakeUnique<ListValue>(); + auto inner2 = base::MakeUnique<ListValue>(); inner2->Append(MakeUnique<Value>("hello")); - inner->Append(WrapUnique(new DictionaryValue)); + inner->Append(MakeUnique<DictionaryValue>()); inner->Append(std::move(inner2)); root->Set("list_with_empty_children", std::move(inner)); root = root->DeepCopyWithoutEmptyChildren();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/OWNERS b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/OWNERS index ef2ec5b..f4a9d9c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/OWNERS +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/OWNERS
@@ -1,3 +1,3 @@ aberent@chromium.org avayvod@chromium.org -dgn@chromium.org \ No newline at end of file +mlamouri@chromium.org
diff --git a/chrome/browser/banners/app_banner_settings_helper.cc b/chrome/browser/banners/app_banner_settings_helper.cc index a795a6c..f9b7dea8 100644 --- a/chrome/browser/banners/app_banner_settings_helper.cc +++ b/chrome/browser/banners/app_banner_settings_helper.cc
@@ -92,9 +92,8 @@ if (!origin_dict->GetDictionaryWithoutPathExpansion(key_name, &app_dict)) { // Don't allow more than kMaxAppsPerSite dictionaries. if (origin_dict->size() < kMaxAppsPerSite) { - app_dict = new base::DictionaryValue(); - origin_dict->SetWithoutPathExpansion(key_name, - base::WrapUnique(app_dict)); + app_dict = origin_dict->SetDictionaryWithoutPathExpansion( + key_name, base::MakeUnique<base::DictionaryValue>()); } }
diff --git a/chrome/browser/browsing_data/history_counter_browsertest.cc b/chrome/browser/browsing_data/history_counter_browsertest.cc index 2df717e5..9dc15988 100644 --- a/chrome/browser/browsing_data/history_counter_browsertest.cc +++ b/chrome/browser/browsing_data/history_counter_browsertest.cc
@@ -170,6 +170,28 @@ EXPECT_EQ(7u, GetLocalResult()); } +// Tests that the counter works without |web_history_service_callback| and +// |sync_service|. +IN_PROC_BROWSER_TEST_F(HistoryCounterTest, WithoutSyncService) { + AddVisit("https://www.google.com"); + AddVisit("https://www.chrome.com"); + + Profile* profile = browser()->profile(); + + browsing_data::HistoryCounter counter( + GetHistoryService(), + browsing_data::HistoryCounter::GetUpdatedWebHistoryServiceCallback(), + nullptr /* sync_service */); + + counter.Init( + profile->GetPrefs(), browsing_data::ClearBrowsingDataTab::ADVANCED, + base::Bind(&HistoryCounterTest::Callback, base::Unretained(this))); + counter.Restart(); + + WaitForCounting(); + EXPECT_EQ(2u, GetLocalResult()); +} + // Tests that the counter starts counting automatically when the deletion // pref changes to true. IN_PROC_BROWSER_TEST_F(HistoryCounterTest, PrefChanged) {
diff --git a/chrome/browser/chromeos/file_manager/fileapi_util.cc b/chrome/browser/chromeos/file_manager/fileapi_util.cc index 5de3560..2de343f8 100644 --- a/chrome/browser/chromeos/file_manager/fileapi_util.cc +++ b/chrome/browser/chromeos/file_manager/fileapi_util.cc
@@ -305,13 +305,12 @@ // file), move to IO thread to obtian metadata for the non-native file. if (need_fill_metadata) { BrowserThread::PostTask( - BrowserThread::IO, - FROM_HERE, - base::Bind(&ConvertSelectedFileInfoListToFileChooserFileInfoListImpl:: - FillMetadataOnIOThread, - base::Unretained(this), - base::Passed(&lifetime), - chooser_info_list_->begin())); + BrowserThread::IO, FROM_HERE, + base::BindOnce( + &ConvertSelectedFileInfoListToFileChooserFileInfoListImpl:: + FillMetadataOnIOThread, + base::Unretained(this), base::Passed(&lifetime), + chooser_info_list_->begin())); return; } @@ -338,12 +337,11 @@ if (it == chooser_info_list_->end()) { BrowserThread::PostTask( - BrowserThread::UI, - FROM_HERE, - base::Bind(&ConvertSelectedFileInfoListToFileChooserFileInfoListImpl:: - NotifyComplete, - base::Unretained(this), - base::Passed(&lifetime))); + BrowserThread::UI, FROM_HERE, + base::BindOnce( + &ConvertSelectedFileInfoListToFileChooserFileInfoListImpl:: + NotifyComplete, + base::Unretained(this), base::Passed(&lifetime))); return; } @@ -371,12 +369,11 @@ if (result != base::File::FILE_OK) { BrowserThread::PostTask( - BrowserThread::UI, - FROM_HERE, - base::Bind(&ConvertSelectedFileInfoListToFileChooserFileInfoListImpl:: - NotifyError, - base::Unretained(this), - base::Passed(&lifetime))); + BrowserThread::UI, FROM_HERE, + base::BindOnce( + &ConvertSelectedFileInfoListToFileChooserFileInfoListImpl:: + NotifyError, + base::Unretained(this), base::Passed(&lifetime))); return; } @@ -553,10 +550,10 @@ BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(base::IgnoreResult( - &storage::FileSystemOperationRunner::DirectoryExists), - file_system_context->operation_runner()->AsWeakPtr(), - internal_url, google_apis::CreateRelayCallback(callback))); + base::BindOnce(base::IgnoreResult( + &storage::FileSystemOperationRunner::DirectoryExists), + file_system_context->operation_runner()->AsWeakPtr(), + internal_url, google_apis::CreateRelayCallback(callback))); } void GetMetadataForPath( @@ -574,7 +571,7 @@ BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind( + base::BindOnce( base::IgnoreResult(&storage::FileSystemOperationRunner::GetMetadata), file_system_context->operation_runner()->AsWeakPtr(), internal_url, fields, google_apis::CreateRelayCallback(callback)));
diff --git a/chrome/browser/chromeos/file_manager/filesystem_api_util.cc b/chrome/browser/chromeos/file_manager/filesystem_api_util.cc index aa6f9be..ccf4a84d 100644 --- a/chrome/browser/chromeos/file_manager/filesystem_api_util.cc +++ b/chrome/browser/chromeos/file_manager/filesystem_api_util.cc
@@ -151,9 +151,8 @@ drive::util::GetFileSystemByProfile(profile); if (!file_system) { content::BrowserThread::PostTask( - content::BrowserThread::UI, - FROM_HERE, - base::Bind(callback, false, std::string())); + content::BrowserThread::UI, FROM_HERE, + base::BindOnce(callback, false, std::string())); return; } @@ -168,9 +167,8 @@ chromeos::file_system_provider::util::LocalPathParser parser(profile, path); if (!parser.Parse()) { content::BrowserThread::PostTask( - content::BrowserThread::UI, - FROM_HERE, - base::Bind(callback, false, std::string())); + content::BrowserThread::UI, FROM_HERE, + base::BindOnce(callback, false, std::string())); return; } @@ -187,9 +185,8 @@ // error with empty MIME type, that leads fallback guessing mime type from // file extensions. content::BrowserThread::PostTask( - content::BrowserThread::UI, - FROM_HERE, - base::Bind(callback, false /* failure */, std::string())); + content::BrowserThread::UI, FROM_HERE, + base::BindOnce(callback, false /* failure */, std::string())); } void IsNonNativeLocalPathDirectory( @@ -216,9 +213,8 @@ profile, path, kFileManagerAppId, &url)) { // Posting to the current thread, so that we always call back asynchronously // independent from whether or not the operation succeeds. - content::BrowserThread::PostTask(content::BrowserThread::UI, - FROM_HERE, - base::Bind(callback, false)); + content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, + base::BindOnce(callback, false)); return; } @@ -233,8 +229,8 @@ content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(&PrepareFileOnIOThread, file_system_context, internal_url, - google_apis::CreateRelayCallback(callback))); + base::BindOnce(&PrepareFileOnIOThread, file_system_context, internal_url, + google_apis::CreateRelayCallback(callback))); } } // namespace util
diff --git a/chrome/browser/chromeos/file_manager/snapshot_manager.cc b/chrome/browser/chromeos/file_manager/snapshot_manager.cc index 56029e5..bfc87d9 100644 --- a/chrome/browser/chromeos/file_manager/snapshot_manager.cc +++ b/chrome/browser/chromeos/file_manager/snapshot_manager.cc
@@ -75,10 +75,9 @@ const GetNecessaryFreeSpaceCallback& callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::BrowserThread::PostTask( - content::BrowserThread::IO, - FROM_HERE, - base::Bind(&GetMetadataOnIOThread, profile->GetPath(), context, url, - google_apis::CreateRelayCallback(callback))); + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&GetMetadataOnIOThread, profile->GetPath(), context, url, + google_apis::CreateRelayCallback(callback))); } // Part of CreateManagedSnapshot. Runs CreateSnapshotFile method of fileapi. @@ -118,9 +117,8 @@ SnapshotManager::~SnapshotManager() { if (!file_refs_.empty()) { bool posted = content::BrowserThread::PostTask( - content::BrowserThread::IO, - FROM_HERE, - base::Bind(&FreeReferenceOnIOThread, file_refs_)); + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&FreeReferenceOnIOThread, file_refs_)); DCHECK(posted); } } @@ -169,9 +167,8 @@ } if (!to_free.empty()) { bool posted = content::BrowserThread::PostTask( - content::BrowserThread::IO, - FROM_HERE, - base::Bind(&FreeReferenceOnIOThread, to_free)); + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&FreeReferenceOnIOThread, to_free)); DCHECK(posted); } @@ -183,15 +180,11 @@ // Start creating the snapshot. content::BrowserThread::PostTask( - content::BrowserThread::IO, - FROM_HERE, - base::Bind(&CreateSnapshotFileOnIOThread, - context, - filesystem_url, - google_apis::CreateRelayCallback( - base::Bind(&SnapshotManager::OnCreateSnapshotFile, - weak_ptr_factory_.GetWeakPtr(), - callback)))); + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&CreateSnapshotFileOnIOThread, context, filesystem_url, + google_apis::CreateRelayCallback(base::Bind( + &SnapshotManager::OnCreateSnapshotFile, + weak_ptr_factory_.GetWeakPtr(), callback)))); } void SnapshotManager::OnCreateSnapshotFile(
diff --git a/chrome/browser/chromeos/file_manager/volume_manager.cc b/chrome/browser/chromeos/file_manager/volume_manager.cc index 4ffc35a..191e334 100644 --- a/chrome/browser/chromeos/file_manager/volume_manager.cc +++ b/chrome/browser/chromeos/file_manager/volume_manager.cc
@@ -855,9 +855,9 @@ content::BrowserThread::PostTask( content::BrowserThread::IO, FROM_HERE, - base::Bind(&MTPDeviceMapService::RegisterMTPFileSystem, - base::Unretained(MTPDeviceMapService::GetInstance()), - info.location(), fsid, read_only)); + base::BindOnce(&MTPDeviceMapService::RegisterMTPFileSystem, + base::Unretained(MTPDeviceMapService::GetInstance()), + info.location(), fsid, read_only)); std::unique_ptr<Volume> volume = Volume::CreateForMTP(path, label, read_only); DoMountEvent(chromeos::MOUNT_ERROR_NONE, std::move(volume)); @@ -875,10 +875,10 @@ const std::string fsid = GetMountPointNameForMediaStorage(info); storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem(fsid); content::BrowserThread::PostTask( - content::BrowserThread::IO, FROM_HERE, base::Bind( - &MTPDeviceMapService::RevokeMTPFileSystem, - base::Unretained(MTPDeviceMapService::GetInstance()), - fsid)); + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&MTPDeviceMapService::RevokeMTPFileSystem, + base::Unretained(MTPDeviceMapService::GetInstance()), + fsid)); return; } }
diff --git a/chrome/browser/chromeos/file_system_provider/registry.cc b/chrome/browser/chromeos/file_system_provider/registry.cc index e9b0ef9..70cced13 100644 --- a/chrome/browser/chromeos/file_system_provider/registry.cc +++ b/chrome/browser/chromeos/file_system_provider/registry.cc
@@ -9,6 +9,7 @@ #include "base/files/file_path.h" #include "base/memory/ptr_util.h" #include "base/stl_util.h" +#include "base/values.h" #include "chrome/browser/chromeos/file_system_provider/mount_path_util.h" #include "chrome/browser/chromeos/file_system_provider/observer.h" #include "chrome/browser/chromeos/file_system_provider/provided_file_system.h" @@ -96,10 +97,10 @@ base::DictionaryValue* file_systems_per_extension_weak = NULL; if (!dict_update->GetDictionaryWithoutPathExpansion( file_system_info.extension_id(), &file_systems_per_extension_weak)) { - auto file_systems_per_extension = base::MakeUnique<base::DictionaryValue>(); - file_systems_per_extension_weak = file_systems_per_extension.get(); - dict_update->SetWithoutPathExpansion(file_system_info.extension_id(), - std::move(file_systems_per_extension)); + file_systems_per_extension_weak = + dict_update->SetDictionaryWithoutPathExpansion( + file_system_info.extension_id(), + base::MakeUnique<base::DictionaryValue>()); } file_systems_per_extension_weak->SetWithoutPathExpansion(
diff --git a/chrome/browser/component_updater/supervised_user_whitelist_installer.cc b/chrome/browser/component_updater/supervised_user_whitelist_installer.cc index dcb569f..a7f7462 100644 --- a/chrome/browser/component_updater/supervised_user_whitelist_installer.cc +++ b/chrome/browser/component_updater/supervised_user_whitelist_installer.cc
@@ -537,10 +537,9 @@ const bool newly_added = !pref_dict->GetDictionaryWithoutPathExpansion( crx_id, &whitelist_dict_weak); if (newly_added) { - auto whitelist_dict = base::MakeUnique<base::DictionaryValue>(); - whitelist_dict_weak = whitelist_dict.get(); - whitelist_dict->SetString(kName, name); - pref_dict->SetWithoutPathExpansion(crx_id, std::move(whitelist_dict)); + whitelist_dict_weak = pref_dict->SetDictionaryWithoutPathExpansion( + crx_id, base::MakeUnique<base::DictionaryValue>()); + whitelist_dict_weak->SetString(kName, name); } if (!client_id.empty()) {
diff --git a/chrome/browser/permissions/permission_decision_auto_blocker.cc b/chrome/browser/permissions/permission_decision_auto_blocker.cc index 8d26e6d..4b994ec 100644 --- a/chrome/browser/permissions/permission_decision_auto_blocker.cc +++ b/chrome/browser/permissions/permission_decision_auto_blocker.cc
@@ -72,9 +72,8 @@ base::DictionaryValue* permission_dict = nullptr; if (!origin_dict->GetDictionaryWithoutPathExpansion(permission, &permission_dict)) { - permission_dict = new base::DictionaryValue(); - origin_dict->SetWithoutPathExpansion(permission, - base::WrapUnique(permission_dict)); + permission_dict = origin_dict->SetDictionaryWithoutPathExpansion( + permission, base::MakeUnique<base::DictionaryValue>()); } return permission_dict;
diff --git a/chrome/browser/profile_resetter/brandcode_config_fetcher.cc b/chrome/browser/profile_resetter/brandcode_config_fetcher.cc index abcffac9..ec825eee 100644 --- a/chrome/browser/profile_resetter/brandcode_config_fetcher.cc +++ b/chrome/browser/profile_resetter/brandcode_config_fetcher.cc
@@ -30,7 +30,6 @@ " appid=\"{8A69D345-D564-463C-AFF1-A69D9E530F96}\"\n" " version=\"0.0.0.0\"\n" " >\n" -" <updatecheck />\n" " <data name=\"install\" " "index=\"__BRANDCODE_PLACEHOLDER__\" />\n" " </app>\n"
diff --git a/chrome/browser/profiles/profile_statistics_aggregator.cc b/chrome/browser/profiles/profile_statistics_aggregator.cc index 77f1b07b0..60513ec 100644 --- a/chrome/browser/profiles/profile_statistics_aggregator.cc +++ b/chrome/browser/profiles/profile_statistics_aggregator.cc
@@ -18,8 +18,9 @@ #include "chrome/browser/profiles/profile_statistics.h" #include "chrome/browser/profiles/profile_statistics_factory.h" #include "components/browsing_data/core/counters/bookmark_counter.h" -#include "components/history/core/browser/history_service.h" -#include "components/password_manager/core/browser/password_store.h" +#include "components/browsing_data/core/counters/history_counter.h" +#include "components/browsing_data/core/counters/passwords_counter.h" +#include "components/browsing_data/core/pref_names.h" #include "components/prefs/pref_service.h" #include "content/public/browser/browser_thread.h" @@ -45,21 +46,12 @@ } // namespace - -void ProfileStatisticsAggregator::PasswordStoreConsumerHelper:: - OnGetPasswordStoreResults( - std::vector<std::unique_ptr<autofill::PasswordForm>> results) { - parent_->StatisticsCallbackSuccess( - profiles::kProfileStatisticsPasswords, results.size()); -} - ProfileStatisticsAggregator::ProfileStatisticsAggregator( Profile* profile, const base::Closure& done_callback) : profile_(profile), profile_path_(profile_->GetPath()), - done_callback_(done_callback), - password_store_consumer_helper_(this) {} + done_callback_(done_callback) {} ProfileStatisticsAggregator::~ProfileStatisticsAggregator() {} @@ -88,10 +80,9 @@ DCHECK(g_browser_process->profile_manager()->IsValidProfile(profile_)); profile_category_stats_.clear(); - // Try to cancel tasks from task trackers. + // Try to cancel tasks. tracker_.TryCancelAll(); counters_.clear(); - password_store_consumer_helper_.cancelable_task_tracker()->TryCancelAll(); // Initiate bookmark counting. bookmarks::BookmarkModel* bookmark_model = @@ -103,27 +94,26 @@ StatisticsCallbackFailure(profiles::kProfileStatisticsBookmarks); } - // Initiate history counting (async). + // Initiate history counting. history::HistoryService* history_service = HistoryServiceFactory::GetForProfileWithoutCreating(profile_); if (history_service) { - history_service->GetHistoryCount( - base::Time(), - base::Time::Max(), - base::Bind(&ProfileStatisticsAggregator::StatisticsCallbackHistory, - this), - &tracker_); + AddCounter(base::MakeUnique<browsing_data::HistoryCounter>( + history_service, + browsing_data::HistoryCounter::GetUpdatedWebHistoryServiceCallback(), + /*sync_service=*/nullptr)); } else { StatisticsCallbackFailure(profiles::kProfileStatisticsBrowsingHistory); } - // Initiate stored password counting (async). + // Initiate stored password counting. scoped_refptr<password_manager::PasswordStore> password_store = PasswordStoreFactory::GetForProfile( profile_, ServiceAccessType::EXPLICIT_ACCESS); if (password_store) { - password_store->GetAutofillableLogins(&password_store_consumer_helper_); + AddCounter(base::MakeUnique<browsing_data::PasswordsCounter>( + password_store, /*sync_service=*/nullptr)); } else { StatisticsCallbackFailure(profiles::kProfileStatisticsPasswords); } @@ -141,12 +131,17 @@ std::unique_ptr<BrowsingDataCounter::Result> result) { if (!result->Finished()) return; - const std::string& pref = result->source()->GetPrefName(); + const char* pref_name = result->source()->GetPrefName(); auto* finished_result = static_cast<BrowsingDataCounter::FinishedResult*>(result.get()); int count = finished_result->Value(); - if (pref == browsing_data::BookmarkCounter::kPrefName) { + if (pref_name == browsing_data::BookmarkCounter::kPrefName) { StatisticsCallbackSuccess(profiles::kProfileStatisticsBookmarks, count); + } else if (pref_name == browsing_data::prefs::kDeleteBrowsingHistory) { + StatisticsCallbackSuccess(profiles::kProfileStatisticsBrowsingHistory, + count); + } else if (pref_name == browsing_data::prefs::kDeletePasswords) { + StatisticsCallbackSuccess(profiles::kProfileStatisticsPasswords, count); } else { // TODO(dullweber): Add more cases when the other statistics are replaced. NOTREACHED(); @@ -191,15 +186,6 @@ StatisticsCallback(category, result); } -void ProfileStatisticsAggregator::StatisticsCallbackHistory( - history::HistoryCountResult result) { - ProfileStatValue result_converted; - result_converted.count = result.count; - result_converted.success = result.success; - StatisticsCallback(profiles::kProfileStatisticsBrowsingHistory, - result_converted); -} - ProfileStatisticsAggregator::ProfileStatValue ProfileStatisticsAggregator::CountPrefs() const { const PrefService* pref_service = profile_->GetPrefs();
diff --git a/chrome/browser/profiles/profile_statistics_aggregator.h b/chrome/browser/profiles/profile_statistics_aggregator.h index 03c0cfe..d7d361b9 100644 --- a/chrome/browser/profiles/profile_statistics_aggregator.h +++ b/chrome/browser/profiles/profile_statistics_aggregator.h
@@ -14,11 +14,10 @@ #include "base/callback_forward.h" #include "base/files/file_path.h" #include "base/memory/ref_counted.h" +#include "base/task/cancelable_task_tracker.h" #include "base/task_runner.h" #include "chrome/browser/profiles/profile_statistics_common.h" #include "components/browsing_data/core/counters/browsing_data_counter.h" -#include "components/history/core/browser/history_types.h" -#include "components/password_manager/core/browser/password_store_consumer.h" class Profile; @@ -65,31 +64,14 @@ void StatisticsCallbackSuccess(const char* category, int count); // Callback for reporting failure. void StatisticsCallbackFailure(const char* category); - // Callback for history. - void StatisticsCallbackHistory(history::HistoryCountResult result); + // Callback for counters. void OnCounterResult( std::unique_ptr<browsing_data::BrowsingDataCounter::Result> result); - // Registers and starts a BrowsingDataCounter. + // Registers, initializes and starts a BrowsingDataCounter. void AddCounter(std::unique_ptr<browsing_data::BrowsingDataCounter> counter); - // Password counting - class PasswordStoreConsumerHelper - : public password_manager::PasswordStoreConsumer { - public: - explicit PasswordStoreConsumerHelper(ProfileStatisticsAggregator* parent) - : parent_(parent) {} - - void OnGetPasswordStoreResults( - std::vector<std::unique_ptr<autofill::PasswordForm>> results) override; - - private: - ProfileStatisticsAggregator* parent_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(PasswordStoreConsumerHelper); - }; - // Preference counting. ProfileStatValue CountPrefs() const; @@ -108,9 +90,6 @@ std::vector<std::unique_ptr<browsing_data::BrowsingDataCounter>> counters_; - // Password counting. - PasswordStoreConsumerHelper password_store_consumer_helper_; - DISALLOW_COPY_AND_ASSIGN(ProfileStatisticsAggregator); };
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc b/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc index b3df0f91..d601c78 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc
@@ -280,8 +280,8 @@ name, master_key, signature_key, encryption_key, avatar_index); DCHECK_EQ(add_user, !dict->HasKey(id)); - base::DictionaryValue* entry = value.get(); - dict->SetWithoutPathExpansion(id, std::move(value)); + base::DictionaryValue* entry = + dict->SetDictionaryWithoutPathExpansion(id, std::move(value)); if (!sync_processor_) return;
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc index cf539f3c..ae3f329 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -133,16 +133,17 @@ // Utility functions ---------------------------------------------------------- enum LaunchMode { - LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut. - LM_AS_WEBAPP, // Launched as a installed web application. - LM_WITH_URLS, // Launched with urls in the cmd line. - LM_SHORTCUT_NONE, // Not launched from a shortcut. - LM_SHORTCUT_NONAME, // Launched from shortcut but no name available. - LM_SHORTCUT_UNKNOWN, // Launched from user-defined shortcut. - LM_SHORTCUT_QUICKLAUNCH, // Launched from the quick launch bar. - LM_SHORTCUT_DESKTOP, // Launched from a desktop shortcut. - LM_SHORTCUT_TASKBAR, // Launched from the taskbar. - LM_LINUX_MAC_BEOS // Other OS buckets start here. + LM_TO_BE_DECIDED = 0, // Possibly direct launch or via a shortcut. + LM_AS_WEBAPP, // Launched as a installed web application. + LM_WITH_URLS, // Launched with urls in the cmd line. + LM_OTHER, // Not launched from a shortcut. + LM_SHORTCUT_NONAME, // Launched from shortcut but no name available. + LM_SHORTCUT_UNKNOWN, // Launched from user-defined shortcut. + LM_SHORTCUT_QUICKLAUNCH, // Launched from the quick launch bar. + LM_SHORTCUT_DESKTOP, // Launched from a desktop shortcut. + LM_SHORTCUT_TASKBAR, // Launched from the taskbar. + LM_USER_EXPERIMENT, // Launched after acceptance of a user experiment. + LM_LINUX_MAC_BEOS // Other OS buckets start here. }; #if defined(OS_WIN) @@ -171,7 +172,7 @@ return LM_SHORTCUT_DESKTOP; return LM_SHORTCUT_UNKNOWN; } - return LM_SHORTCUT_NONE; + return LM_OTHER; } #else // TODO(cpu): Port to other platforms. @@ -340,7 +341,8 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile, const std::vector<GURL>& urls_to_open, bool process_startup) { - UMA_HISTOGRAM_COUNTS_100("Startup.BrowserLaunchURLCount", + UMA_HISTOGRAM_COUNTS_100( + "Startup.BrowserLaunchURLCount", static_cast<base::HistogramBase::Sample>(urls_to_open.size())); RecordRapporOnStartupURLs(urls_to_open); @@ -377,8 +379,13 @@ if (OpenApplicationWindow(profile)) { RecordLaunchModeHistogram(LM_AS_WEBAPP); } else { - RecordLaunchModeHistogram(urls_to_open.empty() ? - LM_TO_BE_DECIDED : LM_WITH_URLS); + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kTryChromeAgain)) { + RecordLaunchModeHistogram(LM_USER_EXPERIMENT); + } else { + RecordLaunchModeHistogram(urls_to_open.empty() ? LM_TO_BE_DECIDED + : LM_WITH_URLS); + } if (StartupBrowserCreator::UseConsolidatedFlow()) ProcessLaunchUrlsUsingConsolidatedFlow(process_startup, urls_to_open);
diff --git a/chrome/browser/ui/webui/settings/certificates_handler.cc b/chrome/browser/ui/webui/settings/certificates_handler.cc index f3d3a22..70a3a82 100644 --- a/chrome/browser/ui/webui/settings/certificates_handler.cc +++ b/chrome/browser/ui/webui/settings/certificates_handler.cc
@@ -1133,8 +1133,7 @@ std::unique_ptr<base::DictionaryValue> error_info(new base::DictionaryValue); error_info->SetString(kErrorTitle, title); error_info->SetString(kErrorDescription, error); - error_info->Set(kCertificateErrors, - base::WrapUnique(cert_error_list.release())); + error_info->Set(kCertificateErrors, std::move(cert_error_list)); RejectCallback(*error_info); }
diff --git a/chrome/browser/ui/webui/settings/search_engines_handler.cc b/chrome/browser/ui/webui/settings/search_engines_handler.cc index 31be170..d41832a 100644 --- a/chrome/browser/ui/webui/settings/search_engines_handler.cc +++ b/chrome/browser/ui/webui/settings/search_engines_handler.cc
@@ -187,10 +187,9 @@ std::unique_ptr<base::DictionaryValue> search_engines_info( new base::DictionaryValue); - search_engines_info->Set("defaults", base::WrapUnique(defaults.release())); - search_engines_info->Set("others", base::WrapUnique(others.release())); - search_engines_info->Set("extensions", - base::WrapUnique(extensions.release())); + search_engines_info->Set("defaults", std::move(defaults)); + search_engines_info->Set("others", std::move(others)); + search_engines_info->Set("extensions", std::move(extensions)); return search_engines_info; }
diff --git a/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc b/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc index f9ca8953..7ee4e0a 100644 --- a/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc +++ b/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc
@@ -43,8 +43,8 @@ std::unique_ptr<base::ListValue> section_contents(new base::ListValue); section->SetString("title", title); // Grab a raw pointer to the result before |Pass()|ing it on. - base::ListValue* result = section_contents.get(); - section->Set("data", std::move(section_contents)); + base::ListValue* result = + section->SetList("data", std::move(section_contents)); parent_list->Append(std::move(section)); return result; }
diff --git a/chromecast/crash/linux/crash_testing_utils.cc b/chromecast/crash/linux/crash_testing_utils.cc index 6ba362f..fa177ec 100644 --- a/chromecast/crash/linux/crash_testing_utils.cc +++ b/chromecast/crash/linux/crash_testing_utils.cc
@@ -114,10 +114,10 @@ std::unique_ptr<base::DictionaryValue> metadata = base::MakeUnique<base::DictionaryValue>(); - base::DictionaryValue* ratelimit_fields = new base::DictionaryValue(); - metadata->Set(kRatelimitKey, base::WrapUnique(ratelimit_fields)); + auto ratelimit_fields = base::MakeUnique<base::DictionaryValue>(); ratelimit_fields->SetDouble(kRatelimitPeriodStartKey, 0.0); ratelimit_fields->SetInteger(kRatelimitPeriodDumpsKey, 0); + metadata->Set(kRatelimitKey, std::move(ratelimit_fields)); std::unique_ptr<base::ListValue> dumps = base::MakeUnique<base::ListValue>();
diff --git a/chromecast/crash/linux/synchronized_minidump_manager.cc b/chromecast/crash/linux/synchronized_minidump_manager.cc index 4602864..27c9a31b 100644 --- a/chromecast/crash/linux/synchronized_minidump_manager.cc +++ b/chromecast/crash/linux/synchronized_minidump_manager.cc
@@ -285,10 +285,10 @@ std::unique_ptr<base::DictionaryValue> metadata = base::MakeUnique<base::DictionaryValue>(); - base::DictionaryValue* ratelimit_fields = new base::DictionaryValue(); - metadata->Set(kLockfileRatelimitKey, base::WrapUnique(ratelimit_fields)); + auto ratelimit_fields = base::MakeUnique<base::DictionaryValue>(); ratelimit_fields->SetDouble(kLockfileRatelimitPeriodStartKey, 0.0); ratelimit_fields->SetInteger(kLockfileRatelimitPeriodDumpsKey, 0); + metadata->Set(kLockfileRatelimitKey, std::move(ratelimit_fields)); std::unique_ptr<base::ListValue> dumps = base::MakeUnique<base::ListValue>();
diff --git a/components/browsing_data/core/counters/history_counter.cc b/components/browsing_data/core/counters/history_counter.cc index fd22f4a7..7bfd7cf 100644 --- a/components/browsing_data/core/counters/history_counter.cc +++ b/components/browsing_data/core/counters/history_counter.cc
@@ -38,7 +38,7 @@ void HistoryCounter::OnInitialized() { if (sync_service_) sync_service_->AddObserver(this); - history_sync_enabled_ = !!web_history_service_callback_.Run(); + history_sync_enabled_ = !!GetWebHistoryService(); } bool HistoryCounter::HasTrackedTasks() { @@ -51,6 +51,12 @@ : browsing_data::prefs::kDeleteBrowsingHistory; } +history::WebHistoryService* HistoryCounter::GetWebHistoryService() { + if (web_history_service_callback_) + return web_history_service_callback_.Run(); + return nullptr; +} + void HistoryCounter::Count() { // Reset the state. cancelable_task_tracker_.TryCancelAll(); @@ -69,8 +75,7 @@ &cancelable_task_tracker_); // If the history sync is enabled, test if there is at least one synced item. - history::WebHistoryService* web_history = - web_history_service_callback_.Run(); + history::WebHistoryService* web_history = GetWebHistoryService(); if (!web_history) { web_counting_finished_ = true; @@ -155,7 +160,7 @@ } void HistoryCounter::OnStateChanged(syncer::SyncService* sync) { - bool history_sync_enabled_new_state = !!web_history_service_callback_.Run(); + bool history_sync_enabled_new_state = !!GetWebHistoryService(); // If the history sync was just enabled or disabled, restart the counter // so that we update the result accordingly.
diff --git a/components/browsing_data/core/counters/history_counter.h b/components/browsing_data/core/counters/history_counter.h index 12e907d9..15cf9060 100644 --- a/components/browsing_data/core/counters/history_counter.h +++ b/components/browsing_data/core/counters/history_counter.h
@@ -58,6 +58,8 @@ void OnWebHistoryTimeout(); void MergeResults(); + history::WebHistoryService* GetWebHistoryService(); + // SyncServiceObserver implementation. void OnStateChanged(syncer::SyncService* sync) override;
diff --git a/components/cryptauth/cryptauth_device_manager_unittest.cc b/components/cryptauth/cryptauth_device_manager_unittest.cc index 7dcd284..fa1f146 100644 --- a/components/cryptauth/cryptauth_device_manager_unittest.cc +++ b/components/cryptauth/cryptauth_device_manager_unittest.cc
@@ -411,8 +411,7 @@ bluetooth_address_b64); device_dictionary->SetBoolean("unlock_key", kStoredUnlockKey); device_dictionary->SetBoolean("unlockable", kStoredUnlockable); - device_dictionary->Set("beacon_seeds", - base::WrapUnique(new base::ListValue())); + device_dictionary->Set("beacon_seeds", base::MakeUnique<base::ListValue>()); device_dictionary->SetBoolean("mobile_hotspot_supported", kStoredMobileHotspotSupported); {
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc index cac479b..9b4e72c 100644 --- a/components/nacl/renderer/ppb_nacl_private_impl.cc +++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -329,9 +329,7 @@ if (document.GetSecurityOrigin().CanRequest(gurl)) { options.allow_credentials = true; } else { - // Allow CORS. - options.cross_origin_request_policy = blink::WebAssociatedURLLoaderOptions:: - kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = blink::WebURLRequest::kFetchRequestModeCORS; } return document.GetFrame()->CreateAssociatedURLLoader(options); }
diff --git a/components/prefs/json_pref_store_unittest.cc b/components/prefs/json_pref_store_unittest.cc index cae79d3..f009200 100644 --- a/components/prefs/json_pref_store_unittest.cc +++ b/components/prefs/json_pref_store_unittest.cc
@@ -334,9 +334,9 @@ pref_file, message_loop_.task_runner(), std::unique_ptr<PrefFilter>()); // Set some keys with empty values. - pref_store->SetValue("list", base::WrapUnique(new base::ListValue), + pref_store->SetValue("list", base::MakeUnique<base::ListValue>(), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); - pref_store->SetValue("dict", base::WrapUnique(new base::DictionaryValue), + pref_store->SetValue("dict", base::MakeUnique<base::DictionaryValue>(), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); // Write to file.
diff --git a/components/prefs/overlay_user_pref_store_unittest.cc b/components/prefs/overlay_user_pref_store_unittest.cc index 0c60f83..d421b11c 100644 --- a/components/prefs/overlay_user_pref_store_unittest.cc +++ b/components/prefs/overlay_user_pref_store_unittest.cc
@@ -128,7 +128,7 @@ // Check that GetMutableValue does not return the dictionary of the underlay. TEST_F(OverlayUserPrefStoreTest, ModifyDictionaries) { - underlay_->SetValue(overlay_key, base::WrapUnique(new DictionaryValue), + underlay_->SetValue(overlay_key, base::MakeUnique<DictionaryValue>(), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); Value* modify = NULL; @@ -158,12 +158,12 @@ const Value* value = NULL; // Check that underlay first value is reported. - underlay_->SetValue(regular_key, base::WrapUnique(new Value(42)), + underlay_->SetValue(regular_key, base::MakeUnique<Value>(42), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); obs.VerifyAndResetChangedKey(regular_key); // Check that underlay overwriting is reported. - underlay_->SetValue(regular_key, base::WrapUnique(new Value(43)), + underlay_->SetValue(regular_key, base::MakeUnique<Value>(43), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); obs.VerifyAndResetChangedKey(regular_key); @@ -172,7 +172,7 @@ EXPECT_TRUE(base::Value(43).Equals(value)); // Check that overwriting change in overlay is reported. - overlay_->SetValue(regular_key, base::WrapUnique(new Value(44)), + overlay_->SetValue(regular_key, base::MakeUnique<Value>(44), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); obs.VerifyAndResetChangedKey(regular_key); @@ -192,16 +192,16 @@ EXPECT_FALSE(underlay_->GetValue(regular_key, &value)); // Check respecting of silence. - overlay_->SetValueSilently(regular_key, base::WrapUnique(new Value(46)), + overlay_->SetValueSilently(regular_key, base::MakeUnique<Value>(46), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); EXPECT_TRUE(obs.changed_keys.empty()); overlay_->RemoveObserver(&obs); // Check successful unsubscription. - underlay_->SetValue(regular_key, base::WrapUnique(new Value(47)), + underlay_->SetValue(regular_key, base::MakeUnique<Value>(47), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); - overlay_->SetValue(regular_key, base::WrapUnique(new Value(48)), + overlay_->SetValue(regular_key, base::MakeUnique<Value>(48), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); EXPECT_TRUE(obs.changed_keys.empty()); } @@ -209,9 +209,9 @@ // Check that mutable values are removed correctly. TEST_F(OverlayUserPrefStoreTest, ClearMutableValues) { // Set in overlay and underlay the same preference. - underlay_->SetValue(overlay_key, base::WrapUnique(new Value(42)), + underlay_->SetValue(overlay_key, base::MakeUnique<Value>(42), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); - overlay_->SetValue(overlay_key, base::WrapUnique(new Value(43)), + overlay_->SetValue(overlay_key, base::MakeUnique<Value>(43), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); const Value* value = nullptr; @@ -228,9 +228,9 @@ // Check that mutable values are removed correctly when using a silent set. TEST_F(OverlayUserPrefStoreTest, ClearMutableValues_Silently) { // Set in overlay and underlay the same preference. - underlay_->SetValueSilently(overlay_key, base::WrapUnique(new Value(42)), + underlay_->SetValueSilently(overlay_key, base::MakeUnique<Value>(42), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); - overlay_->SetValueSilently(overlay_key, base::WrapUnique(new Value(43)), + overlay_->SetValueSilently(overlay_key, base::MakeUnique<Value>(43), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); const Value* value = nullptr; @@ -247,13 +247,13 @@ TEST_F(OverlayUserPrefStoreTest, GetValues) { // To check merge behavior, create underlay and overlay so each has a key the // other doesn't have and they have one key in common. - underlay_->SetValue(regular_key, base::WrapUnique(new Value(42)), + underlay_->SetValue(regular_key, base::MakeUnique<Value>(42), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); - overlay_->SetValue(overlay_key, base::WrapUnique(new Value(43)), + overlay_->SetValue(overlay_key, base::MakeUnique<Value>(43), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); - underlay_->SetValue(shared_key, base::WrapUnique(new Value(42)), + underlay_->SetValue(shared_key, base::MakeUnique<Value>(42), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); - overlay_->SetValue(shared_key, base::WrapUnique(new Value(43)), + overlay_->SetValue(shared_key, base::MakeUnique<Value>(43), WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); auto values = overlay_->GetValues();
diff --git a/components/sync/engine_impl/loopback_server/loopback_server.cc b/components/sync/engine_impl/loopback_server/loopback_server.cc index 55ea0cd..61094cf 100644 --- a/components/sync/engine_impl/loopback_server/loopback_server.cc +++ b/components/sync/engine_impl/loopback_server/loopback_server.cc
@@ -12,6 +12,7 @@ #include "base/files/file_util.h" #include "base/guid.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/rand_util.h" #include "base/stl_util.h" @@ -52,99 +53,83 @@ static const char kSyncedBookmarksFolderName[] = "Synced Bookmarks"; // A filter used during GetUpdates calls to determine what information to -// send back to the client. There is a 1:1 correspondence between any given -// GetUpdates call and an UpdateSieve instance. +// send back to the client; filtering out old entities and tracking versions to +// use in response progress markers. Note that only the GetUpdatesMessage's +// from_progress_marker is used to determine this; legacy fields are ignored. class UpdateSieve { public: + explicit UpdateSieve(const sync_pb::GetUpdatesMessage& message) + : UpdateSieve(MessageToVersionMap(message)) {} ~UpdateSieve() {} - // Factory method for creating an UpdateSieve. - static std::unique_ptr<UpdateSieve> Create( - const sync_pb::GetUpdatesMessage& get_updates_message); - - // Sets the progress markers in |get_updates_response| given the progress - // markers from the original GetUpdatesMessage and |new_version| (the latest - // version in the entries sent back). - void UpdateProgressMarkers( - int64_t new_version, + // Sets the progress markers in |get_updates_response| based on the highest + // version between request progress markers and response entities. + void SetProgressMarkers( sync_pb::GetUpdatesResponse* get_updates_response) const { - ModelTypeToVersionMap::const_iterator it; - for (it = request_from_version_.begin(); it != request_from_version_.end(); - ++it) { + for (const auto& kv : response_version_map_) { sync_pb::DataTypeProgressMarker* new_marker = get_updates_response->add_new_progress_marker(); new_marker->set_data_type_id( - GetSpecificsFieldNumberFromModelType(it->first)); - - int64_t version = std::max(new_version, it->second); - new_marker->set_token(base::Int64ToString(version)); + GetSpecificsFieldNumberFromModelType(kv.first)); + new_marker->set_token(base::Int64ToString(kv.second)); } } // Determines whether the server should send an |entity| to the client as - // part of a GetUpdatesResponse. - bool ClientWantsItem(const LoopbackServerEntity& entity) const { + // part of a GetUpdatesResponse. Update internal tracking of max versions as a + // side effect which will later be used to set response progress markers. + bool ClientWantsItem(const LoopbackServerEntity& entity) { int64_t version = entity.GetVersion(); - if (version <= min_version_) { - return false; - } else if (entity.IsDeleted()) { - return true; - } - - ModelTypeToVersionMap::const_iterator it = - request_from_version_.find(entity.GetModelType()); - - return it == request_from_version_.end() ? false : it->second < version; + ModelType type = entity.GetModelType(); + response_version_map_[type] = + std::max(response_version_map_[type], version); + auto it = request_version_map_.find(type); + return it == request_version_map_.end() ? false : it->second < version; } - // Returns the minimum version seen across all types. - int64_t GetMinVersion() const { return min_version_; } - private: using ModelTypeToVersionMap = std::map<ModelType, int64_t>; - // Creates an UpdateSieve. - UpdateSieve(const ModelTypeToVersionMap request_from_version, - const int64_t min_version) - : request_from_version_(request_from_version), - min_version_(min_version) {} + static UpdateSieve::ModelTypeToVersionMap MessageToVersionMap( + const sync_pb::GetUpdatesMessage& get_updates_message) { + CHECK_GT(get_updates_message.from_progress_marker_size(), 0) + << "A GetUpdates request must have at least one progress marker."; + ModelTypeToVersionMap request_version_map; - // Maps data type IDs to the latest version seen for that type. - const ModelTypeToVersionMap request_from_version_; + for (int i = 0; i < get_updates_message.from_progress_marker_size(); i++) { + sync_pb::DataTypeProgressMarker marker = + get_updates_message.from_progress_marker(i); - // The minimum version seen among all data types. - const int min_version_; -}; + int64_t version = 0; + // Let the version remain zero if there is no token or an empty token (the + // first request for this type). + if (marker.has_token() && !marker.token().empty()) { + bool parsed = base::StringToInt64(marker.token(), &version); + CHECK(parsed) << "Unable to parse progress marker token."; + } -std::unique_ptr<UpdateSieve> UpdateSieve::Create( - const sync_pb::GetUpdatesMessage& get_updates_message) { - CHECK_GT(get_updates_message.from_progress_marker_size(), 0) - << "A GetUpdates request must have at least one progress marker."; - - UpdateSieve::ModelTypeToVersionMap request_from_version; - int64_t min_version = std::numeric_limits<int64_t>::max(); - for (int i = 0; i < get_updates_message.from_progress_marker_size(); i++) { - sync_pb::DataTypeProgressMarker marker = - get_updates_message.from_progress_marker(i); - - int64_t version = 0; - // Let the version remain zero if there is no token or an empty token (the - // first request for this type). - if (marker.has_token() && !marker.token().empty()) { - bool parsed = base::StringToInt64(marker.token(), &version); - CHECK(parsed) << "Unable to parse progress marker token."; + ModelType model_type = + syncer::GetModelTypeFromSpecificsFieldNumber(marker.data_type_id()); + DCHECK(request_version_map.find(model_type) == request_version_map.end()); + request_version_map[model_type] = version; } - ModelType model_type = - syncer::GetModelTypeFromSpecificsFieldNumber(marker.data_type_id()); - request_from_version[model_type] = version; - - if (version < min_version) - min_version = version; + return request_version_map; } - return std::unique_ptr<UpdateSieve>( - new UpdateSieve(request_from_version, min_version)); -} + explicit UpdateSieve(const ModelTypeToVersionMap request_version_map) + : request_version_map_(request_version_map), + response_version_map_(request_version_map) {} + + // The largest versions the client has seen before this request, and is used + // to filter entities to send back to clients. The values in this map are not + // updated after being initially set. The presence of a type in this map is a + // proxy for the desire to receive results about this type. + const ModelTypeToVersionMap request_version_map_; + + // The largest versions seen between client and server, ultimately used to + // send progress markers back to the client. + ModelTypeToVersionMap response_version_map_; +}; } // namespace @@ -290,7 +275,7 @@ // at once. response->set_changes_remaining(0); - std::unique_ptr<UpdateSieve> sieve = UpdateSieve::Create(get_updates); + auto sieve = base::MakeUnique<UpdateSieve>(get_updates); // This folder is called "Synced Bookmarks" by sync and is renamed // "Mobile Bookmarks" by the mobile client UIs. @@ -301,7 +286,6 @@ } bool send_encryption_keys_based_on_nigori = false; - int64_t max_response_version = 0; for (EntityMap::const_iterator it = entities_.begin(); it != entities_.end(); ++it) { const LoopbackServerEntity& entity = *it->second; @@ -309,9 +293,6 @@ sync_pb::SyncEntity* response_entity = response->add_entries(); entity.SerializeAsProto(response_entity); - max_response_version = - std::max(max_response_version, response_entity->version()); - if (entity.GetModelType() == syncer::NIGORI) { send_encryption_keys_based_on_nigori = response_entity->specifics().nigori().passphrase_type() == @@ -328,7 +309,7 @@ } } - sieve->UpdateProgressMarkers(max_response_version, response); + sieve->SetProgressMarkers(response); return true; }
diff --git a/components/translate/core/browser/translate_prefs.cc b/components/translate/core/browser/translate_prefs.cc index 92391c5..0d13a312 100644 --- a/components/translate/core/browser/translate_prefs.cc +++ b/components/translate/core/browser/translate_prefs.cc
@@ -5,11 +5,13 @@ #include "components/translate/core/browser/translate_prefs.h" #include <set> +#include <utility> #include "base/memory/ptr_util.h" #include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" +#include "base/values.h" #include "build/build_config.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" @@ -123,13 +125,13 @@ bool has_list = has_value && denial_value->GetAsList(&time_list_); if (!has_list) { - time_list_ = new base::ListValue(); + auto time_list = base::MakeUnique<base::ListValue>(); double oldest_denial_time = 0; bool has_old_style = has_value && denial_value->GetAsDouble(&oldest_denial_time); if (has_old_style) - time_list_->AppendDouble(oldest_denial_time); - denial_time_dict->Set(language_, base::WrapUnique(time_list_)); + time_list->AppendDouble(oldest_denial_time); + time_list_ = denial_time_dict->SetList(language_, std::move(time_list)); } return time_list_; }
diff --git a/components/url_formatter/idn_spoof_checker.cc b/components/url_formatter/idn_spoof_checker.cc index c3209cc..930d1fc5 100644 --- a/components/url_formatter/idn_spoof_checker.cc +++ b/components/url_formatter/idn_spoof_checker.cc
@@ -368,19 +368,35 @@ // blacklisted by Mozilla. We keep it, even though it can look like a double // quotation mark. Using it in Hebrew should be safe. When used with a // non-Hebrew script, it'd be filtered by other checks in place. - // + + // The following 5 characters are disallowed because they're in NV8 (invalid + // in IDNA 2008). + allowed_set.remove(0x58au); // Armenian Hyphen // U+2010 (Hyphen) is in the inclusion set, but we drop it because it can be // confused with an ASCII U+002D (Hyphen-Minus). allowed_set.remove(0x2010u); + // U+2019 is hard to notice when sitting next to a regular character. + allowed_set.remove(0x2019u); // Right Single Quotation Mark // U+2027 (Hyphenation Point) is in the inclusion set, but is blacklisted by // Mozilla. It is dropped, as it can be confused with U+30FB (Katakana Middle // Dot). allowed_set.remove(0x2027u); + allowed_set.remove(0x30a0u); // Katakana-Hiragana Double Hyphen + + // Block {Single,double}-quotation-mark look-alikes. + allowed_set.remove(0x2bbu); // Modifier Letter Turned Comma + allowed_set.remove(0x2bcu); // Modifier Letter Apostrophe + // No need to block U+144A (Canadian Syllabics West-Cree P) separately + // because it's blocked from mixing with other scripts including Latin. #if defined(OS_MACOSX) // The following characters are reported as present in the default macOS // system UI font, but they render as blank. Remove them from the allowed - // set to prevent spoofing. + // set to prevent spoofing until the font issue is resolved. + + // Arabic letter KASHMIRI YEH. Not used in Arabic and Persian. + allowed_set.remove(0x0620u); + // Tibetan characters used for transliteration of ancient texts: allowed_set.remove(0x0F8Cu); allowed_set.remove(0x0F8Du);
diff --git a/components/url_formatter/url_formatter_unittest.cc b/components/url_formatter/url_formatter_unittest.cc index efd3a397..acb4de7 100644 --- a/components/url_formatter/url_formatter_unittest.cc +++ b/components/url_formatter/url_formatter_unittest.cc
@@ -414,8 +414,11 @@ // Hebrew Gershayim with Arabic is disallowed. {"xn--5eb7h.eg", L"\x0628\x05f4.eg", false}, #if defined(OS_MACOSX) - // Tibetan transliteration characters are disallowed on Mac. + // These characters are blocked due to a font issue on Mac. + // Tibetan transliteration characters. {"xn--com-luma.test.pl", L"\u0f8c.test.pl", false}, + // Arabic letter KASHMIRI YEH + {"xn--fgb.com", L"\u0620.com", false}, #endif // Hyphens (http://unicode.org/cldr/utility/confusables.jsp?a=-) @@ -446,6 +449,30 @@ // Small Em Dash {"xn--abcdef-5g0c.com", L"abc\xfe58" L"def.com", false}, + // Block NV8 (Not valid in IDN 2008) characters. + // U+058A (ÖŠ) + {"xn--ab-vfd.com", L"a\x058a" L"b.com", false}, + {"xn--y9ac3j.com", L"\x0561\x058a\x0562.com", false}, + // U+2019 (’) + {"xn--ab-n2t.com", L"a\x2019" L"b.com", false}, + // U+2027 (‧) + {"xn--ab-u3t.com", L"a\x2027" L"b.com", false}, + // U+30A0 (ã‚ ) + {"xn--ab-bg4a.com", L"a\x30a0" L"b.com", false}, + {"xn--9bk3828aea.com", L"\xac00\x30a0\xac01.com", false}, + {"xn--9bk279fba.com", L"\x4e00\x30a0\x4e00.com", false}, + {"xn--n8jl2x.com", L"\x304a\x30a0\x3044.com", false}, + {"xn--fbke7f.com", L"\x3082\x30a0\x3084.com", false}, + + // Block single/double-quote-like characters. + // U+02BB (Ê») + {"xn--ab-8nb.com", L"a\x02bb" L"b.com", false}, + // U+02BC (ʼ) + {"xn--ab-cob.com", L"a\x02bc" L"b.com", false}, + // U+144A: Not allowed to mix with scripts other than Canadian Syllabics. + {"xn--ab-jom.com", L"a\x144a" L"b.com", false}, + {"xn--xcec9s.com", L"\x1401\x144a\x1402.com", true}, + // Custom dangerous patterns // Two Katakana-Hiragana combining mark in a row {"google.xn--com-oh4ba.evil.jp", L"google.com\x309a\x309a.evil.jp", false},
diff --git a/content/renderer/fetchers/manifest_fetcher.cc b/content/renderer/fetchers/manifest_fetcher.cc index 3410ed6e..0f5fdc9 100644 --- a/content/renderer/fetchers/manifest_fetcher.cc +++ b/content/renderer/fetchers/manifest_fetcher.cc
@@ -30,8 +30,7 @@ blink::WebAssociatedURLLoaderOptions options; options.allow_credentials = use_credentials; - options.cross_origin_request_policy = blink::WebAssociatedURLLoaderOptions:: - kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = blink::WebURLRequest::kFetchRequestModeCORS; fetcher_->SetLoaderOptions(options); fetcher_->Start(
diff --git a/content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc b/content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc index 76ccb55d..4dfccb4 100644 --- a/content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc +++ b/content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc
@@ -36,8 +36,7 @@ WebAssociatedURLLoaderOptions options; options.allow_credentials = true; - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyAllow; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeNoCORS; fetcher_->SetLoaderOptions(options); // To prevent cache tainting, the favicon requests have to by-pass the service
diff --git a/content/renderer/media/android/media_info_loader.cc b/content/renderer/media/android/media_info_loader.cc index 72359d6..73e2ae0 100644 --- a/content/renderer/media/android/media_info_loader.cc +++ b/content/renderer/media/android/media_info_loader.cc
@@ -67,16 +67,14 @@ WebAssociatedURLLoaderOptions options; if (cors_mode_ == blink::WebMediaPlayer::kCORSModeUnspecified) { options.allow_credentials = true; - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyAllow; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeNoCORS; allow_stored_credentials_ = true; } else { options.expose_all_response_headers = true; // The author header set is empty, no preflight should go ahead. options.preflight_policy = WebAssociatedURLLoaderOptions::kPreventPreflight; - options.cross_origin_request_policy = WebAssociatedURLLoaderOptions:: - kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; if (cors_mode_ == blink::WebMediaPlayer::kCORSModeUseCredentials) { options.allow_credentials = true; allow_stored_credentials_ = true;
diff --git a/content/renderer/pepper/pepper_url_loader_host.cc b/content/renderer/pepper/pepper_url_loader_host.cc index 38e9f7d..7418d35 100644 --- a/content/renderer/pepper/pepper_url_loader_host.cc +++ b/content/renderer/pepper/pepper_url_loader_host.cc
@@ -268,8 +268,7 @@ WebAssociatedURLLoaderOptions options; if (has_universal_access_) { options.allow_credentials = true; - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyAllow; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeNoCORS; } else { // All other HTTP requests are untrusted. options.untrusted_http = true; @@ -277,8 +276,7 @@ // Allow cross-origin requests with access control. The request specifies // if credentials are to be sent. options.allow_credentials = filled_in_request_data.allow_credentials; - options.cross_origin_request_policy = WebAssociatedURLLoaderOptions:: - kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; } else { // Same-origin requests can always send credentials. options.allow_credentials = true;
diff --git a/content/renderer/render_thread_impl_browsertest.cc b/content/renderer/render_thread_impl_browsertest.cc index 42d9a76..89af8081 100644 --- a/content/renderer/render_thread_impl_browsertest.cc +++ b/content/renderer/render_thread_impl_browsertest.cc
@@ -269,8 +269,16 @@ // Check that InputHandlerManager outlives compositor thread because it uses // raw pointers to post tasks. // Disabled under LeakSanitizer due to memory leaks. http://crbug.com/348994 +// Disabled on Windows due to flakiness: http://crbug.com/728034. +#if defined(OS_WIN) +#define MAYBE_InputHandlerManagerDestroyedAfterCompositorThread \ + DISABLED_InputHandlerManagerDestroyedAfterCompositorThread +#else +#define MAYBE_InputHandlerManagerDestroyedAfterCompositorThread \ + InputHandlerManagerDestroyedAfterCompositorThread +#endif TEST_F(RenderThreadImplBrowserTest, - WILL_LEAK(InputHandlerManagerDestroyedAfterCompositorThread)) { + WILL_LEAK(MAYBE_InputHandlerManagerDestroyedAfterCompositorThread)) { ASSERT_TRUE(thread_->input_handler_manager()); thread_->compositor_task_runner()->PostTask(
diff --git a/device/usb/usb_device_android.cc b/device/usb/usb_device_android.cc index 72b496f4..35be3b02 100644 --- a/device/usb/usb_device_android.cc +++ b/device/usb/usb_device_android.cc
@@ -35,12 +35,18 @@ device_version = Java_ChromeUsbDevice_getDeviceVersion(env, wrapper); base::string16 manufacturer_string, product_string, serial_number; if (base::android::BuildInfo::GetInstance()->sdk_int() >= 21) { - manufacturer_string = ConvertJavaStringToUTF16( - env, Java_ChromeUsbDevice_getManufacturerName(env, wrapper)); - product_string = ConvertJavaStringToUTF16( - env, Java_ChromeUsbDevice_getProductName(env, wrapper)); - serial_number = ConvertJavaStringToUTF16( - env, Java_ChromeUsbDevice_getSerialNumber(env, wrapper)); + ScopedJavaLocalRef<jstring> manufacturer_jstring = + Java_ChromeUsbDevice_getManufacturerName(env, wrapper); + if (!manufacturer_jstring.is_null()) + manufacturer_string = ConvertJavaStringToUTF16(env, manufacturer_jstring); + ScopedJavaLocalRef<jstring> product_jstring = + Java_ChromeUsbDevice_getProductName(env, wrapper); + if (!product_jstring.is_null()) + product_string = ConvertJavaStringToUTF16(env, product_jstring); + ScopedJavaLocalRef<jstring> serial_jstring = + Java_ChromeUsbDevice_getSerialNumber(env, wrapper); + if (!serial_jstring.is_null()) + serial_number = ConvertJavaStringToUTF16(env, serial_jstring); } return make_scoped_refptr(new UsbDeviceAndroid( env, service,
diff --git a/docs/memory-infra/memory_benchmarks.md b/docs/memory-infra/memory_benchmarks.md index aa50645..a181588 100644 --- a/docs/memory-infra/memory_benchmarks.md +++ b/docs/memory-infra/memory_benchmarks.md
@@ -187,36 +187,35 @@ ### memory.top_10_mobile -The *top-10-mobile* benchmarks are in the process of being deprecated +The [memory.top_10_mobile][memory_py] benchmark is in the process of being deprecated in favor of system health benchmarks. This process, however, hasn't been finalized and currently they are still the reference benchmark used for decision making in the Android release process. Therefore, **it is important -to diagnose and fix regressions caught by these benchmarks**. +to diagnose and fix regressions caught by this benchmark**. -* [memory.top_10_mobile][memory_py] - Cycle between: +The benchmark's work flow is: - - load a page on Chrome, wait for it to load, [force garbage collection - and measure memory][measure]; - - push Chrome to the background, force garbage collection and measure - memory again. +- Cycle between: - Repeat for each of 10 pages *without closing the browser*. + - load a page on Chrome, wait for it to load, [force garbage collection + and measure memory][measure]; + - push Chrome to the background, force garbage collection and measure + memory again. - Close the browser, re-open and repeat the full page set a total of 5 times. +- Repeat for each of 10 pages *without closing the browser*. - Story groups are either `foreground` or `background` depending on the state - of the browser at the time of measurement. +- Close the browser, re-open and repeat the full page set a total of 5 times. -* [memory.top_10_mobile_stress][memory_py] - same as above, but keeps a single - instance of the browser open for the whole duration of the test and - *does not* force any garbage collection. +- Story groups are either `foreground` or `background` depending on the state + of the browser at the time of measurement. -The main difference to watch out between these and system health benchmarks is +The main difference to watch out between this and system health benchmarks is that, since a single browser instance is kept open and shared by many individual stories, they are not independent of each other. In particular, **do not use the `--story-filter` argument when trying to reproduce regressions** on these benchmarks, as doing so will affect the results. +[memory_py]: https://cs.chromium.org/chromium/src/tools/perf/benchmarks/memory.py [measure]: https://github.com/catapult-project/catapult/blob/master/telemetry/telemetry/internal/actions/action_runner.py#L133 ### Dual browser benchmarks @@ -224,16 +223,16 @@ Dual browser benchmarks are intended to assess the memory implications of shared resources between Chrome and WebView. -* [memory.dual_browser_test][memory_py] - cycle between doing Google searches - on a WebView-based browser (a stand-in for the Google Search app) and - loading pages on Chrome. Runs on Android devices only. +* [memory.dual_browser_test][memory_extra_py] - cycle between doing Google + searches on a WebView-based browser (a stand-in for the Google Search app) + and loading pages on Chrome. Runs on Android devices only. Story groups are either `on_chrome` or `on_webview`, indicating the browser in foreground at the moment when the memory measurement was made. -* [memory.long_running_dual_browser_test][memory_py] - same as above, but the - test is run for 60 iterations keeping both browsers alive for the whole - duration of the test and without forcing garbage collection. Intended as a - last-resort net to catch memory leaks not apparent on shorter tests. +* [memory.long_running_dual_browser_test][memory_extra_py] - same as above, + but the test is run for 60 iterations keeping both browsers alive for the + whole duration of the test and without forcing garbage collection. Intended + as a last-resort net to catch memory leaks not apparent on shorter tests. -[memory_py]: https://chromium.googlesource.com/chromium/src/+/master/tools/perf/benchmarks/memory.py +[memory_extra_py]: https://cs.chromium.org/chromium/src/tools/perf/contrib/memory_extras/memory_extras.py
diff --git a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc index 0b507c5..e467d33 100644 --- a/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc +++ b/extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc
@@ -385,22 +385,21 @@ if (dictionary->HasKey(*name)) { base::Value* entry = NULL; std::unique_ptr<base::Value> entry_owned; - base::ListValue* list = NULL; if (!dictionary->GetWithoutPathExpansion(*name, &entry)) return std::unique_ptr<base::DictionaryValue>(); switch (entry->GetType()) { - case base::Value::Type::STRING: + case base::Value::Type::STRING: { // Replace the present string with a list. - list = new base::ListValue; + auto list = base::MakeUnique<base::ListValue>(); // Ignoring return value, we already verified the entry is there. dictionary->RemoveWithoutPathExpansion(*name, &entry_owned); list->Append(std::move(entry_owned)); list->AppendString(*value); - dictionary->SetWithoutPathExpansion(*name, base::WrapUnique(list)); + dictionary->SetWithoutPathExpansion(*name, std::move(list)); break; + } case base::Value::Type::LIST: // Just append to the list. - CHECK(entry->GetAsList(&list)); - list->AppendString(*value); + entry->GetList().emplace_back(*value); break; default: NOTREACHED(); // We never put other Values here.
diff --git a/extensions/browser/api/web_request/upload_data_presenter.cc b/extensions/browser/api/web_request/upload_data_presenter.cc index 259865da..36dcbd3c 100644 --- a/extensions/browser/api/web_request/upload_data_presenter.cc +++ b/extensions/browser/api/web_request/upload_data_presenter.cc
@@ -29,9 +29,9 @@ base::ListValue* GetOrCreateList(base::DictionaryValue* dictionary, const std::string& key) { base::ListValue* list = nullptr; - if (!dictionary->GetList(key, &list)) { - list = new base::ListValue(); - dictionary->SetWithoutPathExpansion(key, base::WrapUnique(list)); + if (!dictionary->GetListWithoutPathExpansion(key, &list)) { + list = dictionary->SetListWithoutPathExpansion( + key, base::MakeUnique<base::ListValue>()); } return list; }
diff --git a/extensions/browser/event_router.cc b/extensions/browser/event_router.cc index 21e0d9a16..37ee669 100644 --- a/extensions/browser/event_router.cc +++ b/extensions/browser/event_router.cc
@@ -739,9 +739,9 @@ ListValue* filter_list = nullptr; if (!filtered_events->GetListWithoutPathExpansion(event_name, &filter_list)) { - filter_list = new ListValue; - filtered_events->SetWithoutPathExpansion(event_name, - base::WrapUnique(filter_list)); + filtered_events->SetWithoutPathExpansion( + event_name, base::MakeUnique<base::ListValue>()); + filtered_events->GetListWithoutPathExpansion(event_name, &filter_list); } filter_list->Append(filter->CreateDeepCopy());
diff --git a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc index d0458ba..c27ded7 100644 --- a/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc +++ b/extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.cc
@@ -22,6 +22,7 @@ #include "gin/interceptor.h" #include "gin/object_template_builder.h" #include "gin/wrappable.h" +#include "third_party/WebKit/public/platform/WebURLRequest.h" #include "third_party/WebKit/public/web/WebAssociatedURLLoader.h" #include "third_party/WebKit/public/web/WebAssociatedURLLoaderOptions.h" #include "third_party/WebKit/public/web/WebDocument.h" @@ -151,8 +152,7 @@ blink::WebAssociatedURLLoaderOptions options; // The embedded plugin is allowed to be cross-origin and we should always // send credentials/cookies with the request. - options.cross_origin_request_policy = - blink::WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyAllow; + options.fetch_request_mode = blink::WebURLRequest::kFetchRequestModeNoCORS; options.allow_credentials = true; DCHECK(!loader_); loader_.reset(frame->CreateAssociatedURLLoader(options));
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn index d0fe5a6..a7acb93 100644 --- a/gpu/BUILD.gn +++ b/gpu/BUILD.gn
@@ -232,6 +232,7 @@ "command_buffer/client/vertex_array_object_manager_unittest.cc", "command_buffer/common/activity_flags_unittest.cc", "command_buffer/common/bitfield_helpers_test.cc", + "command_buffer/common/buffer_unittest.cc", "command_buffer/common/command_buffer_shared_test.cc", "command_buffer/common/debug_marker_manager_unittest.cc", "command_buffer/common/discardable_handle_unittest.cc",
diff --git a/gpu/command_buffer/common/buffer.cc b/gpu/command_buffer/common/buffer.cc index 13b606c..c8d6bbc 100644 --- a/gpu/command_buffer/common/buffer.cc +++ b/gpu/command_buffer/common/buffer.cc
@@ -18,6 +18,10 @@ return false; } +base::SharedMemoryHandle BufferBacking::shared_memory_handle() const { + return base::SharedMemoryHandle(); +} + SharedMemoryBufferBacking::SharedMemoryBufferBacking( std::unique_ptr<base::SharedMemory> shared_memory, size_t size) @@ -29,6 +33,11 @@ return true; } +base::SharedMemoryHandle SharedMemoryBufferBacking::shared_memory_handle() + const { + return shared_memory_->handle(); +} + void* SharedMemoryBufferBacking::GetMemory() const { return shared_memory_->memory(); }
diff --git a/gpu/command_buffer/common/buffer.h b/gpu/command_buffer/common/buffer.h index d4de9175..6a0a0d2 100644 --- a/gpu/command_buffer/common/buffer.h +++ b/gpu/command_buffer/common/buffer.h
@@ -17,8 +17,11 @@ #include "gpu/gpu_export.h" namespace base { - class SharedMemory; -} + +class SharedMemory; +class SharedMemoryHandle; + +} // namespace base namespace gpu { @@ -26,6 +29,7 @@ public: virtual ~BufferBacking() {} virtual bool is_shared() const; + virtual base::SharedMemoryHandle shared_memory_handle() const; virtual void* GetMemory() const = 0; virtual size_t GetSize() const = 0; }; @@ -36,6 +40,7 @@ size_t size); ~SharedMemoryBufferBacking() override; bool is_shared() const override; + base::SharedMemoryHandle shared_memory_handle() const override; void* GetMemory() const override; size_t GetSize() const override; base::SharedMemory* shared_memory() { return shared_memory_.get(); }
diff --git a/gpu/command_buffer/common/buffer_unittest.cc b/gpu/command_buffer/common/buffer_unittest.cc new file mode 100644 index 0000000..89e33c09 --- /dev/null +++ b/gpu/command_buffer/common/buffer_unittest.cc
@@ -0,0 +1,21 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "gpu/command_buffer/common/buffer.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace gpu { + +TEST(Buffer, SharedMemoryHandle) { + const size_t kSize = 1024; + std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory); + shared_memory->CreateAndMapAnonymous(kSize); + auto shared_memory_guid = shared_memory->handle().GetGUID(); + scoped_refptr<Buffer> buffer = + MakeBufferFromSharedMemory(std::move(shared_memory), kSize); + EXPECT_EQ(buffer->backing()->shared_memory_handle().GetGUID(), + shared_memory_guid); +} + +} // namespace gpu
diff --git a/ios/chrome/browser/prefs/BUILD.gn b/ios/chrome/browser/prefs/BUILD.gn index 90817056..99fcfc7 100644 --- a/ios/chrome/browser/prefs/BUILD.gn +++ b/ios/chrome/browser/prefs/BUILD.gn
@@ -24,6 +24,7 @@ } source_set("browser_prefs") { + configs += [ "//build/config/compiler:enable_arc" ] sources = [ "browser_prefs.h", "browser_prefs.mm",
diff --git a/ios/chrome/browser/prefs/browser_prefs.mm b/ios/chrome/browser/prefs/browser_prefs.mm index 5a50138d..3cda610 100644 --- a/ios/chrome/browser/prefs/browser_prefs.mm +++ b/ios/chrome/browser/prefs/browser_prefs.mm
@@ -54,6 +54,10 @@ #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" #include "ui/base/l10n/l10n_util.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { BrowserStateInfoCache::RegisterPrefs(registry); flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry);
diff --git a/media/blink/resource_multibuffer_data_provider.cc b/media/blink/resource_multibuffer_data_provider.cc index 54f0d73..7a7c2f5 100644 --- a/media/blink/resource_multibuffer_data_provider.cc +++ b/media/blink/resource_multibuffer_data_provider.cc
@@ -115,15 +115,13 @@ WebAssociatedURLLoaderOptions options; if (url_data_->cors_mode() == UrlData::CORS_UNSPECIFIED) { options.allow_credentials = true; - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyAllow; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeNoCORS; } else { options.expose_all_response_headers = true; // The author header set is empty, no preflight should go ahead. options.preflight_policy = WebAssociatedURLLoaderOptions::kPreventPreflight; - options.cross_origin_request_policy = WebAssociatedURLLoaderOptions:: - kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; if (url_data_->cors_mode() == UrlData::CORS_USE_CREDENTIALS) options.allow_credentials = true; }
diff --git a/net/sdch/sdch_owner.cc b/net/sdch/sdch_owner.cc index 2e17afa0..fff251f 100644 --- a/net/sdch/sdch_owner.cc +++ b/net/sdch/sdch_owner.cc
@@ -125,8 +125,7 @@ void InitializePrefStore(SdchOwner::PrefStorage* store) { std::unique_ptr<base::DictionaryValue> empty_store(new base::DictionaryValue); empty_store->SetInteger(kVersionKey, kVersion); - empty_store->Set(kDictionariesKey, - base::WrapUnique(new base::DictionaryValue)); + empty_store->Set(kDictionariesKey, base::MakeUnique<base::DictionaryValue>()); store->SetValue(std::move(empty_store)); }
diff --git a/services/preferences/public/cpp/dictionary_value_update.cc b/services/preferences/public/cpp/dictionary_value_update.cc index 513fe61..afd7ae8 100644 --- a/services/preferences/public/cpp/dictionary_value_update.cc +++ b/services/preferences/public/cpp/dictionary_value_update.cc
@@ -79,8 +79,8 @@ base::StringPiece path, std::unique_ptr<base::DictionaryValue> in_value) { RecordPath(path); - base::DictionaryValue* dictionary_value = in_value.get(); - value_->Set(path, std::move(in_value)); + base::DictionaryValue* dictionary_value = + value_->SetDictionary(path, std::move(in_value)); return base::MakeUnique<DictionaryValueUpdate>( report_update_, dictionary_value, ConcatPath(path_, path)); @@ -133,8 +133,8 @@ base::StringPiece path, std::unique_ptr<base::DictionaryValue> in_value) { RecordKey(path); - base::DictionaryValue* dictionary_value = in_value.get(); - value_->SetWithoutPathExpansion(path, std::move(in_value)); + base::DictionaryValue* dictionary_value = + value_->SetDictionaryWithoutPathExpansion(path, std::move(in_value)); std::vector<std::string> full_path = path_; full_path.push_back(path.as_string());
diff --git a/services/preferences/public/cpp/lib/util.cc b/services/preferences/public/cpp/lib/util.cc index dcd9f32..a53e459 100644 --- a/services/preferences/public/cpp/lib/util.cc +++ b/services/preferences/public/cpp/lib/util.cc
@@ -17,11 +17,8 @@ for (size_t i = 0; i < path_components.size() - 1; ++i) { if (!dictionary_value->GetDictionaryWithoutPathExpansion( path_components[i], &dictionary_value)) { - auto new_dict_value_owner = base::MakeUnique<base::DictionaryValue>(); - auto* new_dict_value = new_dict_value_owner.get(); - dictionary_value->SetWithoutPathExpansion( - path_components[i], std::move(new_dict_value_owner)); - dictionary_value = new_dict_value; + dictionary_value = dictionary_value->SetDictionaryWithoutPathExpansion( + path_components[i], base::MakeUnique<base::DictionaryValue>()); } } const auto& key = path_components.back();
diff --git a/testing/buildbot/chromium.perf.fyi.json b/testing/buildbot/chromium.perf.fyi.json index 8e2a553..28fd9cd 100644 --- a/testing/buildbot/chromium.perf.fyi.json +++ b/testing/buildbot/chromium.perf.fyi.json
@@ -1716,65 +1716,6 @@ }, { "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build249-m4--device3", - "os": "Android", - "pool": "Chrome-perf-fyi" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build249-m4--device3", - "os": "Android", - "pool": "Chrome-perf-fyi" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "octane", "-v", "--upload-results",
diff --git a/testing/buildbot/chromium.perf.json b/testing/buildbot/chromium.perf.json index 4eb9029..3e2269b5 100644 --- a/testing/buildbot/chromium.perf.json +++ b/testing/buildbot/chromium.perf.json
@@ -1761,65 +1761,6 @@ }, { "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build48-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build48-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "octane", "-v", "--upload-results", @@ -7085,65 +7026,6 @@ }, { "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build75-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "octane", "-v", "--upload-results", @@ -12429,65 +12311,6 @@ }, { "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build45-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build45-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "octane", "-v", "--upload-results", @@ -17773,65 +17596,6 @@ }, { "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build49-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build49-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "octane", "-v", "--upload-results", @@ -23117,65 +22881,6 @@ }, { "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=android-chromium" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build47-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": false, - "io_timeout": 3600 - } - }, - { - "args": [ - "memory.top_10_mobile_stress", - "-v", - "--upload-results", - "--output-format=chartjson", - "--browser=reference", - "--output-trace-tag=_ref" - ], - "isolate_name": "telemetry_perf_tests", - "name": "memory.top_10_mobile_stress.reference", - "override_compile_targets": [ - "telemetry_perf_tests" - ], - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "android_devices": "1", - "id": "build47-b1--device3", - "os": "Android", - "pool": "Chrome-perf" - } - ], - "expiration": 36000, - "hard_timeout": 10800, - "ignore_task_failure": true, - "io_timeout": 3600 - } - }, - { - "args": [ "octane", "-v", "--upload-results",
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-network-service b/third_party/WebKit/LayoutTests/FlagExpectations/enable-network-service index 5aa171d..0deddd4 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-network-service +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-network-service
@@ -2705,7 +2705,7 @@ Bug(none) http/tests/webaudio/autoplay-crossorigin.html [ Timeout ] Bug(none) http/tests/webfont/crbug-655076.html [ Timeout ] Bug(none) http/tests/webfont/font-display-intervention.html [ Timeout ] -Bug(none) http/tests/webfont/font-display.html [ Timeout ] +Bug(none) external/wpt/css-font-display/font-display.html [ Timeout ] Bug(none) http/tests/webfont/same-origin-credentials.html [ Failure ] Bug(none) http/tests/webfont/slow-loading.html [ Timeout ] Bug(none) http/tests/websocket/bufferedAmount-after-send.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 2d0a933e..9dee835 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -285,6 +285,7 @@ crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-002a.xht [ Failure ] crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-002b.xht [ Failure ] crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-table-valign-001.xht [ Failure ] +crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-016.xht [ Failure ] crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-width-110.xht [ Failure ] crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/width-inherit-001.xht [ Failure ] crbug.com/704961 [ Mac ] virtual/layout_ng/external/wpt/css/CSS2/positioning/abspos-027.xht [ Failure ] @@ -357,11 +358,9 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-008.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-012.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/clear-applies-to-015.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-003.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-applies-to-008.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-applies-to-012.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-002.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-003.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-004.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-008.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-non-replaced-width-009.xht [ Failure ] @@ -371,19 +370,11 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-height-002.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-height-003.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-002.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-003.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-004.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-006.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-007.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-008.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-009.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-011.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floating-replaced-height-008.xht [ Skip ] crbug.com/719615 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-001.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-002.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-005.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-006.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-025.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-026.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-027.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/floats-028.xht [ Failure ] @@ -445,7 +436,6 @@ crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-007.xht [ Failure ] crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-010b.xht [ Skip ] crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-012.xht [ Failure ] -crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-013.xht [ Failure ] crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-023.xht [ Failure ] crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-002.xht [ Failure ] crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/line-height-004.xht [ Failure ] @@ -511,8 +501,6 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-replaced-width-006.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-013.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-017.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-018.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-019.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-025.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/blocks-026.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/height-001.xht [ Failure ] @@ -559,10 +547,6 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-005.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-non-replaced-height-002.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-height-008.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-001.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-002.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-003.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-width-006.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-valign-002.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-non-replaced-height-002.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-non-replaced-height-003.xht [ Failure ] @@ -580,7 +564,6 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-005.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-006.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-013.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-016.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-017.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-020.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-002.xht [ Failure ] @@ -673,18 +656,6 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/width-applies-to-012.xht [ Failure ] ### virtual/layout_ng/external/wpt/css/CSS2/positioning -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-003.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-004.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-005.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-006.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-010.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-011.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-height-012.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-004.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-005.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-006.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-010.xht [ Failure ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-max-height-012.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-015.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-019.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/absolute-non-replaced-width-020.xht [ Failure ] @@ -756,7 +727,6 @@ crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-034.xht [ Skip ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-035.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-036.xht [ Skip ] -crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-037.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-static-001.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/positioning-float-001.xht [ Failure ] crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/positioning-float-002.xht [ Failure ] @@ -1892,9 +1862,8 @@ crbug.com/548765 http/tests/inspector/console-fetch-logging.html [ Failure Pass ] crbug.com/548765 virtual/mojo-loading/http/tests/inspector/console-fetch-logging.html [ Failure Pass ] -crbug.com/564109 [ Win7 ] http/tests/webfont/font-display.html [ Pass Failure ] +crbug.com/564109 [ Win7 ] external/wpt/css-font-display/font-display.html [ Pass Failure ] crbug.com/564109 [ Win7 ] http/tests/webfont/font-display-intervention.html [ Pass Failure ] -crbug.com/564109 [ Win7 ] virtual/mojo-loading/http/tests/webfont/font-display.html [ Pass Failure ] crbug.com/564109 [ Win7 ] virtual/mojo-loading/http/tests/webfont/font-display-intervention.html [ Pass Failure ] crbug.com/399951 http/tests/mime/javascript-mimetype-usecounters.html [ Pass Failure ] @@ -3031,7 +3000,6 @@ # Sheriff failures 2017-05-29 crbug.com/727014 [ Linux ] external/wpt/IndexedDB/large-nested-cloning.html [ Pass Timeout ] crbug.com/727252 [ Win7 ] external/wpt/media-source/mediasource-endofstream.html [ Pass Timeout ] -crbug.com/727257 [ Mac10.11 ] svg/animations/animate-local-url.html [ Pass Failure ] # Sheriff failures 2017-05-30 # Failing on try (with patch) and Linux FYI too frequently.
diff --git a/third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing-expected.txt b/third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing-expected.txt index b3e40cf6..7cac70f 100644 --- a/third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing-expected.txt +++ b/third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing-expected.txt
@@ -112,6 +112,7 @@ PASS syntax:'<integer>', initialValue:'1.0' is invalid PASS syntax:'<integer>', initialValue:'1e0' is invalid PASS syntax:'<number>|foo', initialValue:'foo var(--foo, bla)' is invalid +PASS syntax:'<angle>', initialValue:'0' is invalid PASS syntax:'<angle>', initialValue:'10%' is invalid PASS syntax:'<time>', initialValue:'2px' is invalid PASS syntax:'<resolution>', initialValue:'10' is invalid
diff --git a/third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing.html b/third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing.html index 1a7b681..b739949 100644 --- a/third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing.html +++ b/third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing.html
@@ -146,6 +146,7 @@ assert_invalid("<integer>", "1e0"); assert_invalid("<number>|foo", "foo var(--foo, bla)"); +assert_invalid("<angle>", "0"); assert_invalid("<angle>", "10%"); assert_invalid("<time>", "2px"); assert_invalid("<resolution>", "10");
diff --git a/third_party/WebKit/LayoutTests/custom-properties/usecount-register-property.html b/third_party/WebKit/LayoutTests/custom-properties/usecount-register-property.html new file mode 100644 index 0000000..2f177269 --- /dev/null +++ b/third_party/WebKit/LayoutTests/custom-properties/usecount-register-property.html
@@ -0,0 +1,20 @@ +<!DOCTYPE HTML> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<script> +'use strict'; + +test(() => { + let CSSRegisterProperty = 2018; // From UseCounter.h + + let isCounted = () => internals.isUseCounted(document, CSSRegisterProperty); + + assert_false(isCounted(), + 'should not be counted before registerProperty call'); + + CSS.registerProperty({name: '--name1'}); + + assert_true(isCounted(), + 'registerProperty call should be counted'); +}, "registerProperty is use counted"); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-nonces.html b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-nonces.html new file mode 100644 index 0000000..4bd182e3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-nonces.html
@@ -0,0 +1,59 @@ +<!DOCTYPE html> +<html> +<head> +<title>Embedded Enforcement: Subsumption Algorithm - Nonces.</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="support/testharness-helper.sub.js"></script> +</head> +<body> + <script> + var tests = [ + { "name": "Exact nonce subsumes.", + "required_csp": "script-src 'nonce-abc'", + "returned_csp_1": "script-src 'nonce-abc'", + "expected": IframeLoad.EXPECT_LOAD }, + { "name": "Any nonce subsumes.", + "required_csp": "style-src 'nonce-abc'", + "returned_csp_1": "style-src 'nonce-xyz'", + "expected": IframeLoad.EXPECT_LOAD }, + { "name": "A nonce has to be returned if required by the embedder.", + "required_csp": "script-src 'nonce-abc'", + "returned_csp_1": "script-src http://example1.com/foo", + "expected": IframeLoad.EXPECT_BLOCK }, + { "name": "Multiples nonces returned subsume.", + "required_csp": "style-src 'nonce-abc'", + "returned_csp_1": "style-src 'nonce-xyz' 'nonce-abc'", + "expected": IframeLoad.EXPECT_LOAD }, + // nonce intersection + { "name": "Nonce intersection is still done on exact match - non-matching nonces.", + "required_csp": "script-src 'nonce-abc'", + "returned_csp_1": "script-src 'nonce-def'", + "returned_csp_2": "script-src 'nonce-xyz'", + "expected": IframeLoad.EXPECT_BLOCK }, + { "name": "Nonce intersection is still done on exact match - matching nonces.", + "required_csp": "style-src 'nonce-abc'", + "returned_csp_1": "style-src 'nonce-def'", + "returned_csp_2": "style-src 'nonce-def' 'nonce-xyz'", + "expected": IframeLoad.EXPECT_LOAD }, + // other expressions still have to work + { "name": "Other expressions still have to be subsumed - positive test.", + "required_csp": "style-src http://example1.com/foo/ 'nonce-abc'", + "returned_csp_1": "style-src http://example1.com/foo/ 'nonce-xyz'", + "expected": IframeLoad.EXPECT_LOAD }, + { "name": "Other expressions still have to be subsumed - negative test", + "required_csp": "script-src http://example1.com/foo/ 'nonce-abc'", + "returned_csp_1": "script-src http://not-example1.com/foo/ 'nonce-xyz'", + "expected": IframeLoad.EXPECT_BLOCK }, + ]; + tests.forEach(test => { + async_test(t => { + var url = generateUrlWithPolicies(Host.CROSS_ORIGIN, test.returned_csp_1); + if (test.returned_csp_2) + url.searchParams.append("policy2", test.returned_csp_2); + assert_iframe_with_csp(t, url, test.required_csp, test.expected, test.name, null); + }, test.name); + }); + </script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/webfont/font-display-expected.html b/third_party/WebKit/LayoutTests/external/wpt/css-font-display/font-display-ref.html similarity index 95% rename from third_party/WebKit/LayoutTests/http/tests/webfont/font-display-expected.html rename to third_party/WebKit/LayoutTests/external/wpt/css-font-display/font-display-ref.html index b61799f..1d8410b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/webfont/font-display-expected.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css-font-display/font-display-ref.html
@@ -1,6 +1,5 @@ <!DOCTYPE html> <title>Test for font-display @font-face descriptor</title> -<script src="/js-test-resources/ahem.js"></script> <style> .ahem { font-family: Ahem;
diff --git a/third_party/WebKit/LayoutTests/http/tests/webfont/font-display.html b/third_party/WebKit/LayoutTests/external/wpt/css-font-display/font-display.html similarity index 88% rename from third_party/WebKit/LayoutTests/http/tests/webfont/font-display.html rename to third_party/WebKit/LayoutTests/external/wpt/css-font-display/font-display.html index ec19d7a8..019a88a 100644 --- a/third_party/WebKit/LayoutTests/http/tests/webfont/font-display.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css-font-display/font-display.html
@@ -1,5 +1,7 @@ <!DOCTYPE html> +<html class="reftest-wait"> <title>Test for font-display @font-face descriptor</title> +<link rel="match" href="font-display-ref.html"> <style> .hidden { display: none; } </style> @@ -16,9 +18,6 @@ </tr> </table> <script> -if (window.testRunner) - testRunner.waitUntilDone(); - var fontDisplayValues = ['auto', 'block', 'swap', 'fallback', 'optional']; var configs = [{time: 0, delay: 1000}, {time: 1000, delay: 0}, @@ -29,9 +28,7 @@ {time: 5000, delay: 8000}]; function makeFontFaceDeclaration(family, config, display) { - var url = '/resources/Ahem.ttf'; - if (config.delay > 0) - url = 'slow-ahem-loading.cgi?delay=' + config.delay + '&t=' + config.time; + url = 'resources/slow-ahem-loading.py?ms=' + config.delay; return '@font-face { font-family: ' + family + '; src: url(' + url + '); font-display: ' + display + '; }'; } @@ -63,8 +60,7 @@ if (config.time == 0) { setTimeout((function(tr){ tr.classList.remove('hidden'); - if (window.testRunner) - testRunner.notifyDone(); + document.documentElement.classList.remove("reftest-wait"); }).bind(null, tr), maxTime); } else { setTimeout((function(tr){tr.classList.remove('hidden')}).bind(null, tr), maxTime - config.time); @@ -73,3 +69,4 @@ } </script> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css-font-display/resources/slow-ahem-loading.py b/third_party/WebKit/LayoutTests/external/wpt/css-font-display/resources/slow-ahem-loading.py new file mode 100644 index 0000000..4598950 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css-font-display/resources/slow-ahem-loading.py
@@ -0,0 +1,16 @@ +import os +import time + +def main(request, response): + body = open(os.path.join(os.path.dirname(__file__), "../../css/fonts/ahem/ahem.ttf"), "rb").read() + delay = float(request.GET.first("ms", 500)) + if delay > 0: + time.sleep(delay / 1E3); + + response.add_required_headers = False + response.writer.write_status(200) + response.writer.write_header("content-length", len(body)) + response.writer.write_header("content-type", "application/octet-stream") + response.writer.end_headers() + + response.writer.write(body)
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-custom.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-custom.html deleted file mode 100644 index 4faad68..0000000 --- a/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-custom.html +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script> -'use strict'; - -test(() => { - let UnitlessZeroAngleCustomProperty = 2006; // From UseCounter.h - - let isCounted = () => internals.isUseCounted(document, UnitlessZeroAngleCustomProperty); - var div = document.createElement('div'); - - // These values are invalid. - div.style = 'image-orientation: 0;'; - div.style = 'rotate: 0;'; - div.style = 'offset-path: ray(0 closest-side);'; - // These properties have their own counters. - div.style = 'filter: hue-rotate(0);'; - div.style = 'background-image: linear-gradient(0, red, black);'; - div.style = 'offset-rotate: 0;'; - div.style = 'transform: skewX(0);'; - assert_false(isCounted(), - 'non custom property should not be counted'); - - CSS.registerProperty({ - name: '--degrees', - syntax: '<angle>', - initialValue: '0deg', - }); - assert_false(isCounted(), - '0deg should not be counted'); - - CSS.registerProperty({ - name: '--unitless', - syntax: '<angle>', - initialValue: '0', - }); - assert_true(isCounted(), - '0 should be counted'); -}, 'angle 0 is use counted for custom property registration'); -</script>
diff --git a/third_party/WebKit/LayoutTests/printing/block-width-relayout-shrink-expected.html b/third_party/WebKit/LayoutTests/printing/block-width-relayout-shrink-expected.html new file mode 100644 index 0000000..9e07270e --- /dev/null +++ b/third_party/WebKit/LayoutTests/printing/block-width-relayout-shrink-expected.html
@@ -0,0 +1,12 @@ +<!DOCTYPE html> +<script> +if (window.testRunner) + testRunner.setPrinting(); +if (window.internals) + internals.settings.setShouldPrintBackgrounds(true); +</script> +<style> + @page { margin:0; } + body { margin:0; } +</style> +<div style="width:50vw; height:50vw; background:hotpink;"></div>
diff --git a/third_party/WebKit/LayoutTests/printing/block-width-relayout-shrink.html b/third_party/WebKit/LayoutTests/printing/block-width-relayout-shrink.html new file mode 100644 index 0000000..f845b8a9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/printing/block-width-relayout-shrink.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<script> +if (window.testRunner) + testRunner.setPrinting(); +if (window.internals) + internals.settings.setShouldPrintBackgrounds(true); +</script> +<style> + @page { margin:0; } + body { margin:0; } +</style> +<div style="width:50%; height:550px; background:hotpink;"></div> + +<!-- This test assumes that the initial page width is less than 1100px, and + that we are allowed to actually stretch it to 1100px after initial layout, + when we have discovered the widest element. The following block will + trigger zoom-out: --> +<div style="width:1100px; height:1px;"></div>
diff --git a/third_party/WebKit/PerformanceTests/Editing/move-up-with-hidden-elements.html b/third_party/WebKit/PerformanceTests/DOM/move-up-with-hidden-elements.html similarity index 100% rename from third_party/WebKit/PerformanceTests/Editing/move-up-with-hidden-elements.html rename to third_party/WebKit/PerformanceTests/DOM/move-up-with-hidden-elements.html
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h index f2ca431..94a9589 100644 --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h
@@ -1215,41 +1215,6 @@ } template <> -inline CSSIdentifierValue::CSSIdentifierValue(EUserSelect e) - : CSSValue(kIdentifierClass) { - switch (e) { - case EUserSelect::kNone: - value_id_ = CSSValueNone; - break; - case EUserSelect::kText: - value_id_ = CSSValueText; - break; - case EUserSelect::kAll: - value_id_ = CSSValueAll; - break; - } -} - -template <> -inline EUserSelect CSSIdentifierValue::ConvertTo() const { - switch (value_id_) { - case CSSValueAuto: - return EUserSelect::kText; - case CSSValueNone: - return EUserSelect::kNone; - case CSSValueText: - return EUserSelect::kText; - case CSSValueAll: - return EUserSelect::kAll; - default: - break; - } - - NOTREACHED(); - return EUserSelect::kText; -} - -template <> inline CSSIdentifierValue::CSSIdentifierValue(EVerticalAlign a) : CSSValue(kIdentifierClass) { switch (a) { @@ -1318,10 +1283,10 @@ inline CSSIdentifierValue::CSSIdentifierValue(TextCombine e) : CSSValue(kIdentifierClass) { switch (e) { - case kTextCombineNone: + case TextCombine::kNone: value_id_ = CSSValueNone; break; - case kTextCombineAll: + case TextCombine::kAll: value_id_ = CSSValueAll; break; } @@ -1331,16 +1296,16 @@ inline TextCombine CSSIdentifierValue::ConvertTo() const { switch (value_id_) { case CSSValueNone: - return kTextCombineNone; + return TextCombine::kNone; case CSSValueAll: case CSSValueHorizontal: // -webkit-text-combine - return kTextCombineAll; + return TextCombine::kAll; default: break; } NOTREACHED(); - return kTextCombineNone; + return TextCombine::kNone; } template <>
diff --git a/third_party/WebKit/Source/core/css/CSSProperties.json5 b/third_party/WebKit/Source/core/css/CSSProperties.json5 index dbc65d5..de8f83a 100644 --- a/third_party/WebKit/Source/core/css/CSSProperties.json5 +++ b/third_party/WebKit/Source/core/css/CSSProperties.json5
@@ -2032,7 +2032,7 @@ name_for_methods: "TextCombine", field_template: "storage_only", type_name: "TextCombine", - default_value: "kTextCombineNone", + default_value: "TextCombine::kNone", field_size: 1, field_group: "rare-inherited", }, @@ -2699,10 +2699,9 @@ { name: "user-select", inherited: true, - field_template: "storage_only", - type_name: "EUserSelect", - default_value: "EUserSelect::kText", - field_size: 2, + field_template: "keyword", + keywords: ["none", "text", "all"], + default_value: "text", field_group: "rare-inherited", }, {
diff --git a/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp b/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp index 0df2935a..a7ad425 100644 --- a/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp +++ b/third_party/WebKit/Source/core/css/CSSSyntaxDescriptor.cpp
@@ -164,7 +164,7 @@ return ConsumeInteger(range); case CSSSyntaxType::kAngle: return ConsumeAngle(range, *context, - UseCounter::kUnitlessZeroAngleCustomProperty); + WTF::Optional<UseCounter::Feature>()); case CSSSyntaxType::kTime: return ConsumeTime(range, ValueRange::kValueRangeAll); case CSSSyntaxType::kResolution:
diff --git a/third_party/WebKit/Source/core/css/CSSValueIDMappings.h b/third_party/WebKit/Source/core/css/CSSValueIDMappings.h index 260e779..cca59a6f 100644 --- a/third_party/WebKit/Source/core/css/CSSValueIDMappings.h +++ b/third_party/WebKit/Source/core/css/CSSValueIDMappings.h
@@ -83,6 +83,13 @@ return detail::cssValueIDToPlatformEnumGenerated<EDisplay>(v); } +template <> +inline EUserSelect CssValueIDToPlatformEnum(CSSValueID v) { + if (v == CSSValueAuto) + return EUserSelect::kText; + return detail::cssValueIDToPlatformEnumGenerated<EUserSelect>(v); +} + } // namespace blink #endif
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp index 5b39e1a..3c2274f 100644 --- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp +++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -3304,7 +3304,7 @@ case CSSPropertyWebkitWritingMode: return CSSIdentifierValue::Create(style.GetWritingMode()); case CSSPropertyWebkitTextCombine: - if (style.GetTextCombine() == kTextCombineAll) + if (style.GetTextCombine() == TextCombine::kAll) return CSSIdentifierValue::Create(CSSValueHorizontal); case CSSPropertyTextCombineUpright: return CSSIdentifierValue::Create(style.GetTextCombine());
diff --git a/third_party/WebKit/Source/core/css/PropertyRegistration.idl b/third_party/WebKit/Source/core/css/PropertyRegistration.idl index 3ce62e7..1e55b14 100644 --- a/third_party/WebKit/Source/core/css/PropertyRegistration.idl +++ b/third_party/WebKit/Source/core/css/PropertyRegistration.idl
@@ -4,6 +4,6 @@ // https://drafts.css-houdini.org/css-properties-values-api/#registering-custom-properties partial interface CSS { - [RuntimeEnabled=CSSVariables2, CallWith=ExecutionContext, RaisesException] + [RuntimeEnabled=CSSVariables2, MeasureAs=CSSRegisterProperty, CallWith=ExecutionContext, RaisesException] static void registerProperty(PropertyDescriptor descriptor); };
diff --git a/third_party/WebKit/Source/core/editing/InputMethodController.cpp b/third_party/WebKit/Source/core/editing/InputMethodController.cpp index fb9871d..6cc9533 100644 --- a/third_party/WebKit/Source/core/editing/InputMethodController.cpp +++ b/third_party/WebKit/Source/core/editing/InputMethodController.cpp
@@ -928,7 +928,7 @@ int selection_start = static_cast<int>(selection_offsets.Start()); int selection_end = static_cast<int>(selection_offsets.end()); - // Select the text to be deleted before selectionStart. + // Select the text to be deleted before SelectionState::kStart. if (before > 0 && selection_start > 0) { // In case of exceeding the left boundary. const int start = std::max(selection_start - before, 0); @@ -952,7 +952,7 @@ selection_start = adjusted_start; } - // Select the text to be deleted after selectionEnd. + // Select the text to be deleted after SelectionState::kEnd. if (after > 0) { // Adjust the deleted range in case of exceeding the right boundary. const PlainTextRange range(0, selection_end + after);
diff --git a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp index 01db0ad0..0ad66bbc 100644 --- a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp +++ b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
@@ -181,7 +181,7 @@ if (!runner->CanBeSelectionLeaf() && runner != range.StartLayoutObject() && runner != range.EndLayoutObject()) continue; - if (runner->GetSelectionState() == SelectionNone) + if (runner->GetSelectionState() == SelectionState::kNone) continue; // Blocks are responsible for painting line gaps and margin gaps. They @@ -207,10 +207,12 @@ return; if (range.StartLayoutObject() == range.EndLayoutObject()) { - range.StartLayoutObject()->SetSelectionStateIfNeeded(SelectionBoth); + range.StartLayoutObject()->SetSelectionStateIfNeeded( + SelectionState::kStartAndEnd); } else { - range.StartLayoutObject()->SetSelectionStateIfNeeded(SelectionStart); - range.EndLayoutObject()->SetSelectionStateIfNeeded(SelectionEnd); + range.StartLayoutObject()->SetSelectionStateIfNeeded( + SelectionState::kStart); + range.EndLayoutObject()->SetSelectionStateIfNeeded(SelectionState::kEnd); } LayoutObject* const stop = @@ -219,7 +221,7 @@ runner && runner != stop; runner = runner->NextInPreOrder()) { if (runner != range.StartLayoutObject() && runner != range.EndLayoutObject() && runner->CanBeSelectionLeaf()) - runner->SetSelectionStateIfNeeded(SelectionInside); + runner->SetSelectionStateIfNeeded(SelectionState::kInside); } } @@ -232,7 +234,7 @@ // Now clear the selection. for (auto layout_object : old_selected_map.object_map.Keys()) - layout_object->SetSelectionStateIfNeeded(SelectionNone); + layout_object->SetSelectionStateIfNeeded(SelectionState::kNone); SetSelectionState(new_range); @@ -303,7 +305,7 @@ // Clear SelectionState and invalidation. for (auto layout_object : old_selected_map.object_map.Keys()) { const SelectionState old_state = layout_object->GetSelectionState(); - layout_object->SetSelectionStateIfNeeded(SelectionNone); + layout_object->SetSelectionStateIfNeeded(SelectionState::kNone); if (layout_object->GetSelectionState() == old_state) continue; layout_object->SetShouldInvalidateSelection(); @@ -407,7 +409,7 @@ while (os && os != stop) { if ((os->CanBeSelectionLeaf() || os == paint_range_.StartLayoutObject() || os == paint_range_.EndLayoutObject()) && - os->GetSelectionState() != SelectionNone) { + os->GetSelectionState() != SelectionState::kNone) { // Blocks are responsible for painting line gaps and margin gaps. They // must be examined as well. sel_rect.Unite(SelectionRectForLayoutObject(os)); @@ -439,7 +441,7 @@ if (!o->CanBeSelectionLeaf() && o != paint_range_.StartLayoutObject() && o != paint_range_.EndLayoutObject()) continue; - if (o->GetSelectionState() == SelectionNone) + if (o->GetSelectionState() == SelectionState::kNone) continue; o->SetShouldInvalidateSelection();
diff --git a/third_party/WebKit/Source/core/editing/SelectionModifier.cpp b/third_party/WebKit/Source/core/editing/SelectionModifier.cpp index f6502bb..2791202 100644 --- a/third_party/WebKit/Source/core/editing/SelectionModifier.cpp +++ b/third_party/WebKit/Source/core/editing/SelectionModifier.cpp
@@ -37,6 +37,24 @@ namespace blink { +namespace { + +VisiblePosition LeftBoundaryOfLine(const VisiblePosition& c, + TextDirection direction) { + DCHECK(c.IsValid()) << c; + return direction == TextDirection::kLtr ? LogicalStartOfLine(c) + : LogicalEndOfLine(c); +} + +VisiblePosition RightBoundaryOfLine(const VisiblePosition& c, + TextDirection direction) { + DCHECK(c.IsValid()) << c; + return direction == TextDirection::kLtr ? LogicalEndOfLine(c) + : LogicalStartOfLine(c); +} + +} // namespace + LayoutUnit NoXPosForVerticalArrowNavigation() { return LayoutUnit::Min(); }
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp index 1344585..3e2484f8 100644 --- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp +++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -1940,20 +1940,6 @@ return IsTextControlElement(next_position.DeepEquivalent().AnchorNode()); } -VisiblePosition LeftBoundaryOfLine(const VisiblePosition& c, - TextDirection direction) { - DCHECK(c.IsValid()) << c; - return direction == TextDirection::kLtr ? LogicalStartOfLine(c) - : LogicalEndOfLine(c); -} - -VisiblePosition RightBoundaryOfLine(const VisiblePosition& c, - TextDirection direction) { - DCHECK(c.IsValid()) << c; - return direction == TextDirection::kLtr ? LogicalEndOfLine(c) - : LogicalStartOfLine(c); -} - static bool IsNonTextLeafChild(LayoutObject* object) { if (object->SlowFirstChild()) return false;
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.h b/third_party/WebKit/Source/core/editing/VisibleUnits.h index 60f1bb35..101c9b8 100644 --- a/third_party/WebKit/Source/core/editing/VisibleUnits.h +++ b/third_party/WebKit/Source/core/editing/VisibleUnits.h
@@ -248,8 +248,6 @@ LogicalEndOfLine(const VisiblePositionInFlatTree&); CORE_EXPORT bool IsLogicalEndOfLine(const VisiblePosition&); CORE_EXPORT bool IsLogicalEndOfLine(const VisiblePositionInFlatTree&); -VisiblePosition LeftBoundaryOfLine(const VisiblePosition&, TextDirection); -VisiblePosition RightBoundaryOfLine(const VisiblePosition&, TextDirection); // paragraphs (perhaps a misnomer, can be divided by line break elements) // TODO(yosin) Since return value of |startOfParagraph()| with |VisiblePosition|
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp index 50c0792..76b11ff 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -2855,6 +2855,7 @@ bool Editor::ExecuteCommand(const String& command_name) { // Specially handling commands that Editor::execCommand does not directly // support. + DCHECK(GetFrame().GetDocument()->IsActive()); if (command_name == "DeleteToEndOfParagraph") { if (!DeleteWithDirection(DeleteDirection::kForward, kParagraphBoundary, true, false)) @@ -2891,6 +2892,7 @@ bool Editor::ExecuteCommand(const String& command_name, const String& value) { // moveToBeginningOfDocument and moveToEndfDocument are only handled by WebKit // for editable nodes. + DCHECK(GetFrame().GetDocument()->IsActive()); if (!CanEdit() && command_name == "moveToBeginningOfDocument") return GetFrame().GetEventHandler().BubblingScroll( kScrollUpIgnoringWritingMode, kScrollByDocument);
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp index 51ca7fe..f26eed1 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -28,7 +28,6 @@ #include "core/editing/iterators/TextIterator.h" #include <unicode/utf16.h> -//#include "bindings/core/v8/ExceptionState.h" #include "core/HTMLNames.h" #include "core/InputTypeNames.h" #include "core/dom/Document.h" @@ -147,6 +146,14 @@ template <typename Strategy> TextIteratorAlgorithm<Strategy>::TextIteratorAlgorithm( + const EphemeralRangeTemplate<Strategy>& range, + const TextIteratorBehavior& behavior) + : TextIteratorAlgorithm(range.StartPosition(), + range.EndPosition(), + behavior) {} + +template <typename Strategy> +TextIteratorAlgorithm<Strategy>::TextIteratorAlgorithm( const PositionTemplate<Strategy>& start, const PositionTemplate<Strategy>& end, const TextIteratorBehavior& behavior) @@ -173,25 +180,11 @@ // To avoid renderer hang, we use |CHECK_LE()| to catch the bad callers // in release build. CHECK_LE(start, end); - Initialize(start.ComputeContainerNode(), start.ComputeOffsetInContainerNode(), - end.ComputeContainerNode(), end.ComputeOffsetInContainerNode()); -} -template <typename Strategy> -TextIteratorAlgorithm<Strategy>::TextIteratorAlgorithm( - const EphemeralRangeTemplate<Strategy>& range, - const TextIteratorBehavior& behavior) - : TextIteratorAlgorithm(range.StartPosition(), - range.EndPosition(), - behavior) {} - -template <typename Strategy> -void TextIteratorAlgorithm<Strategy>::Initialize(Node* start_container, - int start_offset, - Node* end_container, - int end_offset) { - DCHECK(start_container); - DCHECK(end_container); + Node* const start_container = start.ComputeContainerNode(); + const int start_offset = start.ComputeOffsetInContainerNode(); + Node* const end_container = end.ComputeContainerNode(); + const int end_offset = end.ComputeOffsetInContainerNode(); text_node_handler_.Initialize(start_container, start_offset, end_container, end_offset);
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h index 9e72c11c..f631d59 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.h +++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.h
@@ -127,11 +127,6 @@ kHandledChildren }; - void Initialize(Node* start_container, - int start_offset, - Node* end_container, - int end_offset); - void ExitNode(); bool ShouldRepresentNodeOffsetZero(); bool ShouldEmitSpaceBeforeAndAfterNode(Node*);
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp index 83cfe300..73a528d 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -138,31 +138,19 @@ const String& description) { DCHECK(type == DocumentMarker::kSpelling || type == DocumentMarker::kGrammar) << type; - // Use a TextIterator to visit the potentially multiple nodes the range - // covers. - for (TextIterator marked_text(range.StartPosition(), range.EndPosition()); - !marked_text.AtEnd(); marked_text.Advance()) { - AddMarker(marked_text.CurrentContainer(), - new DocumentMarker( - type, marked_text.StartOffsetInCurrentContainer(), - marked_text.EndOffsetInCurrentContainer(), description)); - } + AddMarkerInternal( + range, [type, &description](int start_offset, int end_offset) { + return new DocumentMarker(type, start_offset, end_offset, description); + }); } void DocumentMarkerController::AddTextMatchMarker( const EphemeralRange& range, DocumentMarker::MatchStatus match_status) { DCHECK(!document_->NeedsLayoutTreeUpdate()); - - // Use a TextIterator to visit the potentially multiple nodes the range - // covers. - for (TextIterator marked_text(range.StartPosition(), range.EndPosition()); - !marked_text.AtEnd(); marked_text.Advance()) { - AddMarker(marked_text.CurrentContainer(), - new TextMatchMarker(marked_text.StartOffsetInCurrentContainer(), - marked_text.EndOffsetInCurrentContainer(), - match_status)); - } + AddMarkerInternal(range, [match_status](int start_offset, int end_offset) { + return new TextMatchMarker(start_offset, end_offset, match_status); + }); // Don't invalidate tickmarks here. TextFinder invalidates tickmarks using a // throttling algorithm. crbug.com/6819. } @@ -172,14 +160,11 @@ bool thick, Color background_color) { DCHECK(!document_->NeedsLayoutTreeUpdate()); - - for (TextIterator marked_text(range.StartPosition(), range.EndPosition()); - !marked_text.AtEnd(); marked_text.Advance()) { - AddMarker(marked_text.CurrentContainer(), - new DocumentMarker(marked_text.StartOffsetInCurrentContainer(), - marked_text.EndOffsetInCurrentContainer(), - underline_color, thick, background_color)); - } + AddMarkerInternal(range, [underline_color, thick, background_color]( + int start_offset, int end_offset) { + return new DocumentMarker(start_offset, end_offset, underline_color, thick, + background_color); + }); } void DocumentMarkerController::PrepareForDestruction() { @@ -210,15 +195,41 @@ DocumentMarkerController::RemoveMarkers(marked_text, marker_types); } +void DocumentMarkerController::AddMarkerInternal( + const EphemeralRange& range, + std::function<DocumentMarker*(int, int)> create_marker_from_offsets) { + for (TextIterator marked_text(range.StartPosition(), range.EndPosition()); + !marked_text.AtEnd(); marked_text.Advance()) { + const int start_offset_in_current_container = + marked_text.StartOffsetInCurrentContainer(); + const int end_offset_in_current_container = + marked_text.EndOffsetInCurrentContainer(); + + DCHECK_GE(end_offset_in_current_container, + start_offset_in_current_container); + + // TODO(editing-dev): TextIterator sometimes emits ranges where the start + // and end offsets are the same. Investigate if TextIterator should be + // changed to not do this. See crbug.com/727929 + if (end_offset_in_current_container == start_offset_in_current_container) + continue; + + // Ignore text emitted by TextIterator for non-text nodes (e.g. implicit + // newlines) + Node* const node = marked_text.CurrentContainer(); + if (!node->IsTextNode()) + continue; + + DocumentMarker* const new_marker = create_marker_from_offsets( + start_offset_in_current_container, end_offset_in_current_container); + AddMarkerToNode(node, new_marker); + } +} + // Markers are stored in order sorted by their start offset. // Markers of the same type do not overlap each other. - -void DocumentMarkerController::AddMarker(Node* node, - DocumentMarker* new_marker) { - DCHECK_GE(new_marker->EndOffset(), new_marker->StartOffset()); - if (new_marker->EndOffset() == new_marker->StartOffset()) - return; - +void DocumentMarkerController::AddMarkerToNode(Node* node, + DocumentMarker* new_marker) { possibly_existing_marker_types_.Add(new_marker->GetType()); Member<MarkerLists>& markers =
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h index 513af1c..a287b5a8 100644 --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h
@@ -109,7 +109,10 @@ unsigned new_length) final; private: - void AddMarker(Node*, DocumentMarker*); + void AddMarkerInternal( + const EphemeralRange&, + std::function<DocumentMarker*(int, int)> create_marker_from_offsets); + void AddMarkerToNode(Node*, DocumentMarker*); void AddSpellCheckMarker(const EphemeralRange&, DocumentMarker::MarkerType, const String& description = g_empty_string);
diff --git a/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImpl.cpp b/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImpl.cpp index 9bdc09d4..8d84e1a 100644 --- a/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImpl.cpp
@@ -207,9 +207,9 @@ return; if (options_.expose_all_response_headers || - options_.cross_origin_request_policy != - WebAssociatedURLLoaderOptions:: - kCrossOriginRequestPolicyUseAccessControl) { + (options_.fetch_request_mode != WebURLRequest::kFetchRequestModeCORS && + options_.fetch_request_mode != + WebURLRequest::kFetchRequestModeCORSWithForcedPreflight)) { // Use the original ResourceResponse. client_->DidReceiveResponse(WrappedResourceResponse(response)); return; @@ -351,19 +351,8 @@ static_assert(static_cast<int>(a) == static_cast<int>(b), \ "mismatching enum: " #a) -STATIC_ASSERT_ENUM(WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyDeny, - kDenyCrossOriginRequests); -STATIC_ASSERT_ENUM( - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyUseAccessControl, - kUseAccessControl); -STATIC_ASSERT_ENUM( - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyAllow, - kAllowCrossOriginRequests); - STATIC_ASSERT_ENUM(WebAssociatedURLLoaderOptions::kConsiderPreflight, kConsiderPreflight); -STATIC_ASSERT_ENUM(WebAssociatedURLLoaderOptions::kForcePreflight, - kForcePreflight); STATIC_ASSERT_ENUM(WebAssociatedURLLoaderOptions::kPreventPreflight, kPreventPreflight); @@ -401,8 +390,7 @@ ThreadableLoaderOptions options; options.preflight_policy = static_cast<PreflightPolicy>(options_.preflight_policy); - options.cross_origin_request_policy = static_cast<CrossOriginRequestPolicy>( - options_.cross_origin_request_policy); + options.fetch_request_mode = options_.fetch_request_mode; ResourceLoaderOptions resource_loader_options; resource_loader_options.allow_credentials =
diff --git a/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp b/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp index a8ee6a3..646b749 100644 --- a/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp +++ b/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp
@@ -96,8 +96,7 @@ AtomicString(String::Format("bytes=%d-%d", range_start_, range_end_))); ThreadableLoaderOptions options; - options.preflight_policy = kConsiderPreflight; - options.cross_origin_request_policy = kDenyCrossOriginRequests; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeSameOrigin; // FIXME: Is there a directive to which this load should be subject? options.content_security_policy_enforcement = kDoNotEnforceContentSecurityPolicy;
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index ef0ece5..8969728 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -1608,7 +1608,6 @@ kThreeValuedPositionGradient = 2003, kThreeValuedPositionObjectPosition = 2004, kThreeValuedPositionPerspectiveOrigin = 2005, - kUnitlessZeroAngleCustomProperty = 2006, kUnitlessZeroAngleFilter = 2007, kUnitlessZeroAngleGradient = 2008, kUnitlessZeroAngleOffsetRotate = 2009, @@ -1622,6 +1621,7 @@ // The above items are available in M60 branch. kClientHintsDeviceRAM = 2017, + kCSSRegisterProperty = 2018, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots. // Also, run update_use_counter_feature_enum.py in
diff --git a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp index 348a4d77..993c6b0 100644 --- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp +++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp
@@ -721,10 +721,9 @@ bool SourceListDirective::SubsumesNoncesAndHashes( const HashSet<String>& nonces, const HashSet<CSPHashValue> hashes) const { - for (const auto& nonce : nonces) { - if (!nonces_.Contains(nonce)) - return false; - } + if (!nonces.IsEmpty() && nonces_.IsEmpty()) + return false; + for (const auto& hash : hashes) { if (!hashes_.Contains(hash)) return false;
diff --git a/third_party/WebKit/Source/core/frame/csp/SourceListDirectiveTest.cpp b/third_party/WebKit/Source/core/frame/csp/SourceListDirectiveTest.cpp index a13d42d..f2508dd 100644 --- a/third_party/WebKit/Source/core/frame/csp/SourceListDirectiveTest.cpp +++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirectiveTest.cpp
@@ -949,6 +949,14 @@ "'strict-dynamic'", {"'nonce-yay' https://example1.com/foo/"}, true}, + {true, + "http://example1.com/foo/ 'nonce-abc'", + {"http://example1.com/foo/ 'nonce-xyz'"}, + true}, + {false, + "http://example1.com/foo/ 'nonce-abc'", + {"http://example1.com/foo/ 'nonce-xyz'"}, + true}, // Check hashes. {true, "http://example1.com/foo/ 'self' 'unsafe-inline' 'sha512-321cba'", @@ -1004,13 +1012,30 @@ "'nonce-abc'", {"'unsafe-inline' 'sha512-321abc' 'self' 'nonce-xyz'", "unsafe-inline' 'sha512-321abc' https://example.test/ 'nonce-xyz'"}, - false}, + true}, {true, "http://example1.com/foo/ 'self' 'unsafe-inline' 'sha512-321abc' " "'nonce-abc'", {"'unsafe-inline' 'sha512-321abc' 'self' 'sha512-xyz'", "unsafe-inline' 'sha512-321abc' https://example.test/ 'sha512-xyz'"}, false}, + {true, + "http://example1.com/foo/ 'nonce-abc' 'sha512-321abc'", + {"http://example1.com/foo/ 'nonce-xyz' 'sha512-321abc'"}, + true}, + {false, + "http://example1.com/foo/ 'nonce-abc' 'sha512-321abc'", + {"http://example1.com/foo/ 'nonce-xyz' 'sha512-321abc'"}, + true}, + {true, + "http://example1.com/foo/ 'nonce-abc' 'sha512-321abc'", + {"http://example1.com/foo/ 'nonce-xyz' 'sha512-xyz'"}, + false}, + {false, + "http://example1.com/foo/ 'nonce-abc' 'sha512-321abc'", + {"http://example1.com/foo/ 'nonce-xyz' 'sha512-xyz'", + "http://example1.com/foo/ 'nonce-zyx' 'nonce-xyz' 'sha512-xyz'"}, + false}, };
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp index e1f1693..23c4158 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -918,8 +918,10 @@ void LayoutBlock::SetSelectionState(SelectionState state) { LayoutBox::SetSelectionState(state); - if (InlineBoxWrapper() && CanUpdateSelectionOnRootLineBoxes()) - InlineBoxWrapper()->Root().SetHasSelectedChildren(state != SelectionNone); + if (InlineBoxWrapper() && CanUpdateSelectionOnRootLineBoxes()) { + InlineBoxWrapper()->Root().SetHasSelectedChildren(state != + SelectionState::kNone); + } } TrackedLayoutBoxListHashSet* LayoutBlock::PositionedObjectsInternal() const {
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp index ec1fb845..c44d4fd4 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -303,7 +303,7 @@ continue; if (!root_has_selected_children && - box->GetLineLayoutItem().GetSelectionState() != SelectionNone) + box->GetLineLayoutItem().GetSelectionState() != SelectionState::kNone) root_has_selected_children = true; // If we have no parent box yet, or if the run is not simply a sibling,
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp index a082d693..7beb92e 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -2403,7 +2403,8 @@ } bool LayoutBox::PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const { - if (HasNonCompositedScrollbars() || GetSelectionState() != SelectionNone || + if (HasNonCompositedScrollbars() || + GetSelectionState() != SelectionState::kNone || HasBoxDecorationBackground() || StyleRef().HasBoxDecorations() || StyleRef().HasVisualOverflowingEffect()) return false;
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp index 51a1cea1..e4cf1d4 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -117,12 +117,15 @@ static ContinuationMap* g_continuation_map = nullptr; void LayoutBoxModelObject::SetSelectionState(SelectionState state) { - if (state == SelectionInside && GetSelectionState() != SelectionNone) + if (state == SelectionState::kInside && + GetSelectionState() != SelectionState::kNone) return; - if ((state == SelectionStart && GetSelectionState() == SelectionEnd) || - (state == SelectionEnd && GetSelectionState() == SelectionStart)) - LayoutObject::SetSelectionState(SelectionBoth); + if ((state == SelectionState::kStart && + GetSelectionState() == SelectionState::kEnd) || + (state == SelectionState::kEnd && + GetSelectionState() == SelectionState::kStart)) + LayoutObject::SetSelectionState(SelectionState::kStartAndEnd); else LayoutObject::SetSelectionState(state);
diff --git a/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp b/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp index d3bdb80b..05bee86 100644 --- a/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
@@ -484,8 +484,10 @@ // base class call. LayoutBox::SetSelectionState(state); - if (InlineBoxWrapper() && CanUpdateSelectionOnRootLineBoxes()) - InlineBoxWrapper()->Root().SetHasSelectedChildren(state != SelectionNone); + if (InlineBoxWrapper() && CanUpdateSelectionOnRootLineBoxes()) { + InlineBoxWrapper()->Root().SetHasSelectedChildren(state != + SelectionState::kNone); + } } void LayoutListMarker::ListItemStyleDidChange() {
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp index 1f6b5b50..adc7d6f 100644 --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -2592,7 +2592,8 @@ bool LayoutObject::IsSelectionBorder() const { SelectionState st = GetSelectionState(); - return st == SelectionStart || st == SelectionEnd || st == SelectionBoth; + return st == SelectionState::kStart || st == SelectionState::kEnd || + st == SelectionState::kStartAndEnd; } inline void LayoutObject::ClearLayoutRootIfNeeded() const { @@ -3609,7 +3610,7 @@ child = child->NextSibling()) { if (!child->CanBeSelectionLeaf()) continue; - if (child->GetSelectionState() == SelectionNone) + if (child->GetSelectionState() == SelectionState::kNone) continue; child->SetShouldInvalidateSelection(); }
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h index 34ccc620..c881d97 100644 --- a/third_party/WebKit/Source/core/layout/LayoutObject.h +++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -1485,7 +1485,7 @@ virtual bool CanBeSelectionLeaf() const { return false; } bool HasSelectedChildren() const { - return GetSelectionState() != SelectionNone; + return GetSelectionState() != SelectionState::kNone; } bool IsSelectable() const; @@ -2303,7 +2303,7 @@ outline_may_be_affected_by_descendants_(false), previous_outline_may_be_affected_by_descendants_(false), positioned_state_(kIsStaticallyPositioned), - selection_state_(SelectionNone), + selection_state_(static_cast<unsigned>(SelectionState::kNone)), background_obscuration_state_(kBackgroundObscurationStatusInvalid), full_paint_invalidation_reason_( static_cast<unsigned>(PaintInvalidationReason::kNone)) {} @@ -2567,7 +2567,7 @@ return static_cast<SelectionState>(selection_state_); } ALWAYS_INLINE void SetSelectionState(SelectionState selection_state) { - selection_state_ = selection_state; + selection_state_ = static_cast<unsigned>(selection_state); } ALWAYS_INLINE BackgroundObscurationState
diff --git a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp index 9d8c9060..7be024f 100644 --- a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
@@ -916,7 +916,7 @@ } LayoutRect LayoutReplaced::LocalSelectionRect() const { - if (GetSelectionState() == SelectionNone) + if (GetSelectionState() == SelectionState::kNone) return LayoutRect(); if (!InlineBoxWrapper()) { @@ -944,8 +944,10 @@ if (!InlineBoxWrapper()) return; - if (CanUpdateSelectionOnRootLineBoxes()) - InlineBoxWrapper()->Root().SetHasSelectedChildren(state != SelectionNone); + if (CanUpdateSelectionOnRootLineBoxes()) { + InlineBoxWrapper()->Root().SetHasSelectedChildren(state != + SelectionState::kNone); + } } void LayoutReplaced::IntrinsicSizingInfo::Transpose() {
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp index ced8ba292..961c32a 100644 --- a/third_party/WebKit/Source/core/layout/LayoutText.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
@@ -1444,17 +1444,17 @@ LayoutObject::SetSelectionState(state); if (CanUpdateSelectionOnRootLineBoxes()) { - if (state == SelectionStart || state == SelectionEnd || - state == SelectionBoth) { + if (state == SelectionState::kStart || state == SelectionState::kEnd || + state == SelectionState::kStartAndEnd) { int start_pos, end_pos; std::tie(start_pos, end_pos) = SelectionStartEnd(); - if (GetSelectionState() == SelectionStart) { + if (GetSelectionState() == SelectionState::kStart) { end_pos = TextLength(); // to handle selection from end of text to end of line if (start_pos && start_pos == end_pos) start_pos = end_pos - 1; - } else if (GetSelectionState() == SelectionEnd) { + } else if (GetSelectionState() == SelectionState::kEnd) { start_pos = 0; } @@ -1465,7 +1465,7 @@ } } else { for (InlineTextBox* box = FirstTextBox(); box; box = box->NextTextBox()) { - box->Root().SetHasSelectedChildren(state == SelectionInside); + box->Root().SetHasSelectedChildren(state == SelectionState::kInside); } } } @@ -1899,7 +1899,7 @@ LayoutRect LayoutText::LocalSelectionRect() const { DCHECK(!NeedsLayout()); - if (GetSelectionState() == SelectionNone) + if (GetSelectionState() == SelectionState::kNone) return LayoutRect(); LayoutBlock* cb = ContainingBlock(); if (!cb) @@ -1908,15 +1908,15 @@ // Now calculate startPos and endPos for painting selection. // We include a selection while endPos > 0 int start_pos, end_pos; - if (GetSelectionState() == SelectionInside) { + if (GetSelectionState() == SelectionState::kInside) { // We are fully selected. start_pos = 0; end_pos = TextLength(); } else { std::tie(start_pos, end_pos) = SelectionStartEnd(); - if (GetSelectionState() == SelectionStart) + if (GetSelectionState() == SelectionState::kStart) end_pos = TextLength(); - else if (GetSelectionState() == SelectionEnd) + else if (GetSelectionState() == SelectionState::kEnd) start_pos = 0; }
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp index d868a0d..2d1b3c2d 100644 --- a/third_party/WebKit/Source/core/layout/LayoutView.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -903,6 +903,13 @@ return rect; } +bool LayoutView::UpdateLogicalWidthAndColumnWidth() { + bool relayout_children = LayoutBlockFlow::UpdateLogicalWidthAndColumnWidth(); + // When we're printing, the size of LayoutView is changed outside of layout, + // so we'll fail to detect any changes here. Just return true. + return relayout_children || ShouldUsePrintingLayout(); +} + bool LayoutView::PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const { // Frame scroll corner is painted using LayoutView as the display item client. if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() &&
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.h b/third_party/WebKit/Source/core/layout/LayoutView.h index f30e1a43..8154f0a 100644 --- a/third_party/WebKit/Source/core/layout/LayoutView.h +++ b/third_party/WebKit/Source/core/layout/LayoutView.h
@@ -276,6 +276,8 @@ int ViewLogicalWidthForBoxSizing() const; int ViewLogicalHeightForBoxSizing() const; + bool UpdateLogicalWidthAndColumnWidth() override; + bool PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const override; UntracedMember<LocalFrameView> frame_view_;
diff --git a/third_party/WebKit/Source/core/layout/api/SelectionState.cpp b/third_party/WebKit/Source/core/layout/api/SelectionState.cpp index 8ab9db82..c492d72 100644 --- a/third_party/WebKit/Source/core/layout/api/SelectionState.cpp +++ b/third_party/WebKit/Source/core/layout/api/SelectionState.cpp
@@ -9,16 +9,20 @@ namespace blink { std::ostream& operator<<(std::ostream& out, const SelectionState state) { - static const char* const kText[] = { -#define V(state) #state, - FOR_EACH_SELECTION_STATE(V) -#undef V - }; - - const auto& it = std::begin(kText) + static_cast<size_t>(state); - DCHECK_GE(it, std::begin(kText)) << "Unknown state value"; - DCHECK_LT(it, std::end(kText)) << "Unknown state value"; - return out << *it; + switch (state) { + case SelectionState::kNone: + return out << "None"; + case SelectionState::kStart: + return out << "Start"; + case SelectionState::kInside: + return out << "Inside"; + case SelectionState::kEnd: + return out << "End"; + case SelectionState::kStartAndEnd: + return out << "Both"; + } + NOTREACHED(); + return out; } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/api/SelectionState.h b/third_party/WebKit/Source/core/layout/api/SelectionState.h index 30b6d37..2beacf8 100644 --- a/third_party/WebKit/Source/core/layout/api/SelectionState.h +++ b/third_party/WebKit/Source/core/layout/api/SelectionState.h
@@ -10,25 +10,20 @@ namespace blink { -#define FOR_EACH_SELECTION_STATE(V) \ - /* The object is not selected. */ \ - V(None) \ - /* The object either contains the start of a selection run or is the */ \ - /* start of a run. */ \ - V(Start) \ - /* The object is fully encompassed by a selection run. */ \ - V(Inside) \ - /* The object either contains the end of a selection run or is the */ \ - /* end of a run. */ \ - V(End) \ - /* The object contains an entire run or is the sole selected object */ \ - /* in that run. */ \ - V(Both) - -enum SelectionState { -#define V(state) Selection##state, - FOR_EACH_SELECTION_STATE(V) -#undef V +enum class SelectionState { + /* The object is not selected. */ + kNone, + /* The object either contains the start of a selection run or is the */ + /* start of a run. */ + kStart, + /* The object is fully encompassed by a selection run. */ + kInside, + /* The object either contains the end of a selection run or is the */ + /* end of a run. */ + kEnd, + /* The object contains an entire run or is the sole selected object */ + /* in that run. */ + kStartAndEnd }; CORE_EXPORT std::ostream& operator<<(std::ostream&, const SelectionState);
diff --git a/third_party/WebKit/Source/core/layout/api/SelectionStateTest.cpp b/third_party/WebKit/Source/core/layout/api/SelectionStateTest.cpp index c5059c85..5ba05fe4 100644 --- a/third_party/WebKit/Source/core/layout/api/SelectionStateTest.cpp +++ b/third_party/WebKit/Source/core/layout/api/SelectionStateTest.cpp
@@ -13,12 +13,12 @@ // Just explicitly sanity check a couple of values. { std::stringstream string_stream; - string_stream << SelectionNone; + string_stream << SelectionState::kNone; EXPECT_EQ("None", string_stream.str()); } { std::stringstream string_stream; - string_stream << SelectionBoth; + string_stream << SelectionState::kStartAndEnd; EXPECT_EQ("Both", string_stream.str()); } }
diff --git a/third_party/WebKit/Source/core/layout/line/EllipsisBox.h b/third_party/WebKit/Source/core/layout/line/EllipsisBox.h index b2a785223..da8ac67 100644 --- a/third_party/WebKit/Source/core/layout/line/EllipsisBox.h +++ b/third_party/WebKit/Source/core/layout/line/EllipsisBox.h
@@ -50,7 +50,7 @@ parent), height_(height), str_(ellipsis_str), - selection_state_(SelectionNone) { + selection_state_(SelectionState::kNone) { SetHasVirtualLogicalHeight(); }
diff --git a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp index 9552c035..a06265e 100644 --- a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp +++ b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
@@ -1437,7 +1437,7 @@ } SelectionState InlineFlowBox::GetSelectionState() const { - return SelectionNone; + return SelectionState::kNone; } bool InlineFlowBox::CanAccommodateEllipsis(bool ltr,
diff --git a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp index 1bc92336..d450595 100644 --- a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp +++ b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
@@ -173,8 +173,8 @@ SelectionState InlineTextBox::GetSelectionState() const { SelectionState state = GetLineLayoutItem().GetSelectionState(); - if (state == SelectionStart || state == SelectionEnd || - state == SelectionBoth) { + if (state == SelectionState::kStart || state == SelectionState::kEnd || + state == SelectionState::kStartAndEnd) { int start_pos, end_pos; std::tie(start_pos, end_pos) = GetLineLayoutItem().SelectionStartEnd(); // The position after a hard line break is considered to be past its end. @@ -187,38 +187,38 @@ LineBreak::kAfterWhiteSpace ? -1 : 0; - bool start = (state != SelectionEnd && start_pos >= start_ && + bool start = (state != SelectionState::kEnd && start_pos >= start_ && start_pos <= start_ + len_ + end_of_line_adjustment_for_css_line_break); - bool end = (state != SelectionStart && end_pos > start_ && + bool end = (state != SelectionState::kStart && end_pos > start_ && end_pos <= last_selectable); if (start && end) - state = SelectionBoth; + state = SelectionState::kStartAndEnd; else if (start) - state = SelectionStart; + state = SelectionState::kStart; else if (end) - state = SelectionEnd; - else if ((state == SelectionEnd || start_pos < start_) && - (state == SelectionStart || end_pos > last_selectable)) - state = SelectionInside; - else if (state == SelectionBoth) - state = SelectionNone; + state = SelectionState::kEnd; + else if ((state == SelectionState::kEnd || start_pos < start_) && + (state == SelectionState::kStart || end_pos > last_selectable)) + state = SelectionState::kInside; + else if (state == SelectionState::kStartAndEnd) + state = SelectionState::kNone; } // If there are ellipsis following, make sure their selection is updated. if (truncation_ != kCNoTruncation && Root().GetEllipsisBox()) { EllipsisBox* ellipsis = Root().GetEllipsisBox(); - if (state != SelectionNone) { + if (state != SelectionState::kNone) { int start, end; SelectionStartEnd(start, end); // The ellipsis should be considered to be selected if the end of the // selection is past the beginning of the truncation and the beginning of // the selection is before or at the beginning of the truncation. ellipsis->SetSelectionState(end >= truncation_ && start <= truncation_ - ? SelectionInside - : SelectionNone); + ? SelectionState::kInside + : SelectionState::kNone); } else { - ellipsis->SetSelectionState(SelectionNone); + ellipsis->SetSelectionState(SelectionState::kNone); } } @@ -229,7 +229,7 @@ DCHECK(!GetLineLayoutItem().NeedsLayout()); SelectionState state = GetSelectionState(); - if (state != SelectionStart && state != SelectionInside) + if (state != SelectionState::kStart && state != SelectionState::kInside) return false; // Checking last leaf child can be slow, so we make sure to do this @@ -251,8 +251,9 @@ if (NextTextBox()) return true; auto root_block = Root().Block(); - if (root_block.IsInline() && root_block.GetSelectionState() != SelectionEnd && - root_block.GetSelectionState() != SelectionBoth && + if (root_block.IsInline() && + root_block.GetSelectionState() != SelectionState::kEnd && + root_block.GetSelectionState() != SelectionState::kStartAndEnd && root_block.InlineBoxWrapper() && ((is_ltr && root_block.InlineBoxWrapper()->NextOnLine()) || (!is_ltr && root_block.InlineBoxWrapper()->PrevOnLine()))) { @@ -524,14 +525,14 @@ void InlineTextBox::SelectionStartEnd(int& s_pos, int& e_pos) const { int start_pos, end_pos; - if (GetLineLayoutItem().GetSelectionState() == SelectionInside) { + if (GetLineLayoutItem().GetSelectionState() == SelectionState::kInside) { start_pos = 0; end_pos = GetLineLayoutItem().TextLength(); } else { std::tie(start_pos, end_pos) = GetLineLayoutItem().SelectionStartEnd(); - if (GetLineLayoutItem().GetSelectionState() == SelectionStart) + if (GetLineLayoutItem().GetSelectionState() == SelectionState::kStart) end_pos = GetLineLayoutItem().TextLength(); - else if (GetLineLayoutItem().GetSelectionState() == SelectionEnd) + else if (GetLineLayoutItem().GetSelectionState() == SelectionState::kEnd) start_pos = 0; }
diff --git a/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp b/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp index 1fc5957e..82295b7 100644 --- a/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp +++ b/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp
@@ -343,21 +343,26 @@ SelectionState RootInlineBox::GetSelectionState() const { // Walk over all of the selected boxes. - SelectionState state = SelectionNone; + SelectionState state = SelectionState::kNone; for (InlineBox* box = FirstLeafChild(); box; box = box->NextLeafChild()) { SelectionState box_state = box->GetSelectionState(); - if ((box_state == SelectionStart && state == SelectionEnd) || - (box_state == SelectionEnd && state == SelectionStart)) { - state = SelectionBoth; - } else if (state == SelectionNone || - ((box_state == SelectionStart || box_state == SelectionEnd) && - (state == SelectionNone || state == SelectionInside))) { + if ((box_state == SelectionState::kStart && + state == SelectionState::kEnd) || + (box_state == SelectionState::kEnd && + state == SelectionState::kStart)) { + state = SelectionState::kStartAndEnd; + } else if (state == SelectionState::kNone || + ((box_state == SelectionState::kStart || + box_state == SelectionState::kEnd) && + (state == SelectionState::kNone || + state == SelectionState::kInside))) { state = box_state; - } else if (box_state == SelectionNone && state == SelectionStart) { + } else if (box_state == SelectionState::kNone && + state == SelectionState::kStart) { // We are past the end of the selection. - state = SelectionBoth; + state = SelectionState::kStartAndEnd; } - if (state == SelectionBoth) + if (state == SelectionState::kStartAndEnd) break; } @@ -366,7 +371,7 @@ InlineBox* RootInlineBox::FirstSelectedBox() const { for (InlineBox* box = FirstLeafChild(); box; box = box->NextLeafChild()) { - if (box->GetSelectionState() != SelectionNone) + if (box->GetSelectionState() != SelectionState::kNone) return box; } @@ -375,7 +380,7 @@ InlineBox* RootInlineBox::LastSelectedBox() const { for (InlineBox* box = LastLeafChild(); box; box = box->PrevLeafChild()) { - if (box->GetSelectionState() != SelectionNone) + if (box->GetSelectionState() != SelectionState::kNone) return box; }
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp index 8ebd5d0..037b7efb 100644 --- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
@@ -176,13 +176,22 @@ this, &DocumentThreadableLoader::DidTimeout), request_started_seconds_(0.0), - cors_redirect_limit_(options_.cross_origin_request_policy == - kUseAccessControl - ? kMaxCORSRedirects - : 0), + cors_redirect_limit_( + (options_.fetch_request_mode == + WebURLRequest::kFetchRequestModeCORS || + options_.fetch_request_mode == + WebURLRequest::kFetchRequestModeCORSWithForcedPreflight) + ? kMaxCORSRedirects + : 0), redirect_mode_(WebURLRequest::kFetchRedirectModeFollow), override_referrer_(false) { DCHECK(client); + + // kPreventPreflight can be used only when the CORS is enabled. + DCHECK(options_.preflight_policy == kConsiderPreflight || + options_.fetch_request_mode == WebURLRequest::kFetchRequestModeCORS || + options_.fetch_request_mode == + WebURLRequest::kFetchRequestModeCORSWithForcedPreflight); } void DocumentThreadableLoader::Start(const ResourceRequest& request) { @@ -194,8 +203,8 @@ request_context_ = request.GetRequestContext(); redirect_mode_ = request.GetFetchRedirectMode(); - if (!same_origin_request_ && - options_.cross_origin_request_policy == kDenyCrossOriginRequests) { + if (!same_origin_request_ && options_.fetch_request_mode == + WebURLRequest::kFetchRequestModeSameOrigin) { probe::documentThreadableLoaderFailedToStartLoadingForClient(GetDocument(), client_); ThreadableLoaderClient* client = client_; @@ -233,30 +242,25 @@ ResourceRequest new_request(request); if (request_context_ != WebURLRequest::kRequestContextFetch) { - // When the request context is not "fetch", |crossOriginRequestPolicy| - // represents the fetch request mode, and |credentialsRequested| represents + // When the request context is not "fetch", |fetch_request_mode| + // represents the fetch request mode, and |allow_credentials| represents // the fetch credentials mode. So we set those flags here so that we can see // the correct request mode and credentials mode in the service worker's // fetch event handler. - switch (options_.cross_origin_request_policy) { - case kDenyCrossOriginRequests: - new_request.SetFetchRequestMode( - WebURLRequest::kFetchRequestModeSameOrigin); + switch (options_.fetch_request_mode) { + case WebURLRequest::kFetchRequestModeSameOrigin: + case WebURLRequest::kFetchRequestModeCORS: + case WebURLRequest::kFetchRequestModeCORSWithForcedPreflight: break; - case kUseAccessControl: - if (options_.preflight_policy == kForcePreflight) { - new_request.SetFetchRequestMode( - WebURLRequest::kFetchRequestModeCORSWithForcedPreflight); - } else { - new_request.SetFetchRequestMode(WebURLRequest::kFetchRequestModeCORS); - } - break; - case kAllowCrossOriginRequests: + case WebURLRequest::kFetchRequestModeNoCORS: SECURITY_CHECK(IsNoCORSAllowedContext(request_context_, request.GetServiceWorkerMode())); - new_request.SetFetchRequestMode(WebURLRequest::kFetchRequestModeNoCORS); + break; + case WebURLRequest::kFetchRequestModeNavigate: + NOTREACHED(); break; } + new_request.SetFetchRequestMode(options_.fetch_request_mode); if (resource_loader_options_.allow_credentials == kAllowStoredCredentials) { new_request.SetFetchCredentialsMode( WebURLRequest::kFetchCredentialsModeInclude); @@ -300,12 +304,14 @@ const ResourceRequest& request) { if (!request.IsExternalRequest() && (same_origin_request_ || - options_.cross_origin_request_policy == kAllowCrossOriginRequests)) { + options_.fetch_request_mode == WebURLRequest::kFetchRequestModeNoCORS)) { LoadRequest(request, resource_loader_options_); return; } - DCHECK(options_.cross_origin_request_policy == kUseAccessControl || + DCHECK(options_.fetch_request_mode == WebURLRequest::kFetchRequestModeCORS || + options_.fetch_request_mode == + WebURLRequest::kFetchRequestModeCORSWithForcedPreflight || request.IsExternalRequest()); MakeCrossOriginAccessRequest(request); @@ -321,7 +327,9 @@ void DocumentThreadableLoader::MakeCrossOriginAccessRequest( const ResourceRequest& request) { - DCHECK(options_.cross_origin_request_policy == kUseAccessControl || + DCHECK(options_.fetch_request_mode == WebURLRequest::kFetchRequestModeCORS || + options_.fetch_request_mode == + WebURLRequest::kFetchRequestModeCORSWithForcedPreflight || request.IsExternalRequest()); DCHECK(client_); DCHECK(!GetResource()); @@ -373,6 +381,8 @@ // example, referrer. We need to accept them. For security, we must reject // forbidden headers/methods at the point we accept user's input. Not here. if (!request.IsExternalRequest() && + options_.fetch_request_mode != + WebURLRequest::kFetchRequestModeCORSWithForcedPreflight && ((options_.preflight_policy == kConsiderPreflight && FetchUtils::IsSimpleOrForbiddenRequest(request.HttpMethod(), request.HttpHeaderFields())) || @@ -840,7 +850,9 @@ fallback_request_for_service_worker_ = ResourceRequest(); if (!same_origin_request_ && - options_.cross_origin_request_policy == kUseAccessControl) { + (options_.fetch_request_mode == WebURLRequest::kFetchRequestModeCORS || + options_.fetch_request_mode == + WebURLRequest::kFetchRequestModeCORSWithForcedPreflight)) { CrossOriginAccessControl::AccessStatus cors_status = CrossOriginAccessControl::CheckAccess( response, EffectiveAllowCredentials(), GetSecurityOrigin()); @@ -919,7 +931,10 @@ if (!actual_request_.IsNull()) { DCHECK(!same_origin_request_); - DCHECK_EQ(options_.cross_origin_request_policy, kUseAccessControl); + DCHECK(options_.fetch_request_mode == + WebURLRequest::kFetchRequestModeCORS || + options_.fetch_request_mode == + WebURLRequest::kFetchRequestModeCORSWithForcedPreflight); LoadActualRequest(); return; } @@ -1012,7 +1027,7 @@ FetchParameters new_params(request, options_.initiator, resource_loader_options); - if (options_.cross_origin_request_policy == kAllowCrossOriginRequests) + if (options_.fetch_request_mode == WebURLRequest::kFetchRequestModeNoCORS) new_params.SetOriginRestriction(FetchParameters::kNoOriginRestriction); DCHECK(!GetResource()); @@ -1057,7 +1072,7 @@ ResourceLoaderOptions resource_loader_options) { FetchParameters fetch_params(request, options_.initiator, resource_loader_options); - if (options_.cross_origin_request_policy == kAllowCrossOriginRequests) + if (options_.fetch_request_mode == WebURLRequest::kFetchRequestModeNoCORS) fetch_params.SetOriginRestriction(FetchParameters::kNoOriginRestriction); Resource* resource = RawResource::FetchSynchronously( fetch_params, loading_context_->GetResourceFetcher()); @@ -1142,7 +1157,7 @@ } bool DocumentThreadableLoader::IsAllowedRedirect(const KURL& url) const { - if (options_.cross_origin_request_policy == kAllowCrossOriginRequests) + if (options_.fetch_request_mode == WebURLRequest::kFetchRequestModeNoCORS) return true; return same_origin_request_ && GetSecurityOrigin()->CanRequest(url);
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoader.h b/third_party/WebKit/Source/core/loader/ThreadableLoader.h index 5ce595a9..131ddb2 100644 --- a/third_party/WebKit/Source/core/loader/ThreadableLoader.h +++ b/third_party/WebKit/Source/core/loader/ThreadableLoader.h
@@ -38,6 +38,7 @@ #include "platform/loader/fetch/ResourceLoaderOptions.h" #include "platform/wtf/Allocator.h" #include "platform/wtf/Noncopyable.h" +#include "public/platform/WebURLRequest.h" namespace blink { @@ -45,13 +46,7 @@ class ExecutionContext; class ThreadableLoaderClient; -enum CrossOriginRequestPolicy { - kDenyCrossOriginRequests, - kUseAccessControl, - kAllowCrossOriginRequests -}; - -enum PreflightPolicy { kConsiderPreflight, kForcePreflight, kPreventPreflight }; +enum PreflightPolicy { kConsiderPreflight, kPreventPreflight }; enum ContentSecurityPolicyEnforcement { kEnforceContentSecurityPolicy, @@ -62,7 +57,7 @@ DISALLOW_NEW(); ThreadableLoaderOptions() : preflight_policy(kConsiderPreflight), - cross_origin_request_policy(kDenyCrossOriginRequests), + fetch_request_mode(WebURLRequest::kFetchRequestModeSameOrigin), content_security_policy_enforcement(kEnforceContentSecurityPolicy), timeout_milliseconds(0) {} @@ -72,7 +67,7 @@ // If AccessControl is used, how to determine if a preflight is needed. PreflightPolicy preflight_policy; - CrossOriginRequestPolicy cross_origin_request_policy; + WebURLRequest::FetchRequestMode fetch_request_mode; AtomicString initiator; ContentSecurityPolicyEnforcement content_security_policy_enforcement; unsigned long timeout_milliseconds; @@ -84,7 +79,7 @@ explicit CrossThreadThreadableLoaderOptionsData( const ThreadableLoaderOptions& options) : preflight_policy(options.preflight_policy), - cross_origin_request_policy(options.cross_origin_request_policy), + fetch_request_mode(options.fetch_request_mode), initiator(options.initiator.GetString().IsolatedCopy()), content_security_policy_enforcement( options.content_security_policy_enforcement), @@ -93,7 +88,7 @@ operator ThreadableLoaderOptions() const { ThreadableLoaderOptions options; options.preflight_policy = preflight_policy; - options.cross_origin_request_policy = cross_origin_request_policy; + options.fetch_request_mode = fetch_request_mode; options.initiator = AtomicString(initiator); options.content_security_policy_enforcement = content_security_policy_enforcement; @@ -102,7 +97,7 @@ } PreflightPolicy preflight_policy; - CrossOriginRequestPolicy cross_origin_request_policy; + WebURLRequest::FetchRequestMode fetch_request_mode; String initiator; ContentSecurityPolicyEnforcement content_security_policy_enforcement; unsigned long timeout_milliseconds;
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp index fd4e51c..aac07e5 100644 --- a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp +++ b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
@@ -32,6 +32,7 @@ #include "public/platform/Platform.h" #include "public/platform/WebURLLoadTiming.h" #include "public/platform/WebURLLoaderMockFactory.h" +#include "public/platform/WebURLRequest.h" #include "public/platform/WebURLResponse.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -109,7 +110,7 @@ virtual ~ThreadableLoaderTestHelper() {} virtual void CreateLoader(ThreadableLoaderClient*, - CrossOriginRequestPolicy) = 0; + WebURLRequest::FetchRequestMode) = 0; virtual void StartLoader(const ResourceRequest&) = 0; virtual void CancelLoader() = 0; virtual void CancelAndClearLoader() = 0; @@ -128,9 +129,9 @@ void CreateLoader( ThreadableLoaderClient* client, - CrossOriginRequestPolicy cross_origin_request_policy) override { + WebURLRequest::FetchRequestMode fetch_request_mode) override { ThreadableLoaderOptions options; - options.cross_origin_request_policy = cross_origin_request_policy; + options.fetch_request_mode = fetch_request_mode; ResourceLoaderOptions resource_loader_options; loader_ = DocumentThreadableLoader::Create( *ThreadableLoadingContext::Create(GetDocument()), client, options, @@ -176,16 +177,15 @@ void CreateLoader( ThreadableLoaderClient* client, - CrossOriginRequestPolicy cross_origin_request_policy) override { + WebURLRequest::FetchRequestMode fetch_request_mode) override { std::unique_ptr<WaitableEvent> completion_event = WTF::MakeUnique<WaitableEvent>(); worker_loading_task_runner_->PostTask( BLINK_FROM_HERE, - CrossThreadBind(&WorkerThreadableLoaderTestHelper::WorkerCreateLoader, - CrossThreadUnretained(this), - CrossThreadUnretained(client), - CrossThreadUnretained(completion_event.get()), - cross_origin_request_policy)); + CrossThreadBind( + &WorkerThreadableLoaderTestHelper::WorkerCreateLoader, + CrossThreadUnretained(this), CrossThreadUnretained(client), + CrossThreadUnretained(completion_event.get()), fetch_request_mode)); completion_event->Wait(); } @@ -275,15 +275,14 @@ private: Document& GetDocument() { return dummy_page_holder_->GetDocument(); } - void WorkerCreateLoader( - ThreadableLoaderClient* client, - WaitableEvent* event, - CrossOriginRequestPolicy cross_origin_request_policy) { + void WorkerCreateLoader(ThreadableLoaderClient* client, + WaitableEvent* event, + WebURLRequest::FetchRequestMode fetch_request_mode) { DCHECK(worker_thread_); DCHECK(worker_thread_->IsCurrentThread()); ThreadableLoaderOptions options; - options.cross_origin_request_policy = cross_origin_request_policy; + options.fetch_request_mode = fetch_request_mode; ResourceLoaderOptions resource_loader_options; // Ensure that WorkerThreadableLoader is created. @@ -360,9 +359,9 @@ Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests(); } - void CreateLoader(CrossOriginRequestPolicy cross_origin_request_policy = - kAllowCrossOriginRequests) { - helper_->CreateLoader(Client(), cross_origin_request_policy); + void CreateLoader(WebURLRequest::FetchRequestMode fetch_request_mode = + WebURLRequest::kFetchRequestModeNoCORS) { + helper_->CreateLoader(Client(), fetch_request_mode); } MockThreadableLoaderClient* Client() const { return client_.get(); } @@ -652,7 +651,7 @@ TEST_P(ThreadableLoaderTest, DidFailInStart) { InSequence s; EXPECT_CALL(GetCheckpoint(), Call(1)); - CreateLoader(kDenyCrossOriginRequests); + CreateLoader(WebURLRequest::kFetchRequestModeSameOrigin); CallCheckpoint(1); EXPECT_CALL(*Client(), @@ -669,7 +668,7 @@ TEST_P(ThreadableLoaderTest, CancelInDidFailInStart) { InSequence s; EXPECT_CALL(GetCheckpoint(), Call(1)); - CreateLoader(kDenyCrossOriginRequests); + CreateLoader(WebURLRequest::kFetchRequestModeSameOrigin); CallCheckpoint(1); EXPECT_CALL(*Client(), DidFail(_)) @@ -684,7 +683,7 @@ TEST_P(ThreadableLoaderTest, ClearInDidFailInStart) { InSequence s; EXPECT_CALL(GetCheckpoint(), Call(1)); - CreateLoader(kDenyCrossOriginRequests); + CreateLoader(WebURLRequest::kFetchRequestModeSameOrigin); CallCheckpoint(1); EXPECT_CALL(*Client(), DidFail(_)) @@ -699,7 +698,7 @@ TEST_P(ThreadableLoaderTest, DidFailAccessControlCheck) { InSequence s; EXPECT_CALL(GetCheckpoint(), Call(1)); - CreateLoader(kUseAccessControl); + CreateLoader(WebURLRequest::kFetchRequestModeCORS); CallCheckpoint(1); EXPECT_CALL(GetCheckpoint(), Call(2)); @@ -718,7 +717,7 @@ TEST_P(ThreadableLoaderTest, CancelInDidFailAccessControlCheck) { InSequence s; EXPECT_CALL(GetCheckpoint(), Call(1)); - CreateLoader(kUseAccessControl); + CreateLoader(WebURLRequest::kFetchRequestModeCORS); CallCheckpoint(1); EXPECT_CALL(GetCheckpoint(), Call(2)); @@ -733,7 +732,7 @@ TEST_P(ThreadableLoaderTest, ClearInDidFailAccessControlCheck) { InSequence s; EXPECT_CALL(GetCheckpoint(), Call(1)); - CreateLoader(kUseAccessControl); + CreateLoader(WebURLRequest::kFetchRequestModeCORS); CallCheckpoint(1); EXPECT_CALL(GetCheckpoint(), Call(2)); @@ -801,7 +800,7 @@ TEST_P(ThreadableLoaderTest, DidFailRedirectCheck) { InSequence s; EXPECT_CALL(GetCheckpoint(), Call(1)); - CreateLoader(kUseAccessControl); + CreateLoader(WebURLRequest::kFetchRequestModeCORS); CallCheckpoint(1); EXPECT_CALL(GetCheckpoint(), Call(2)); @@ -815,7 +814,7 @@ TEST_P(ThreadableLoaderTest, CancelInDidFailRedirectCheck) { InSequence s; EXPECT_CALL(GetCheckpoint(), Call(1)); - CreateLoader(kUseAccessControl); + CreateLoader(WebURLRequest::kFetchRequestModeCORS); CallCheckpoint(1); EXPECT_CALL(GetCheckpoint(), Call(2)); @@ -830,7 +829,7 @@ TEST_P(ThreadableLoaderTest, ClearInDidFailRedirectCheck) { InSequence s; EXPECT_CALL(GetCheckpoint(), Call(1)); - CreateLoader(kUseAccessControl); + CreateLoader(WebURLRequest::kFetchRequestModeCORS); CallCheckpoint(1); EXPECT_CALL(GetCheckpoint(), Call(2)); @@ -847,7 +846,7 @@ TEST_P(ThreadableLoaderTest, GetResponseSynchronously) { InSequence s; EXPECT_CALL(GetCheckpoint(), Call(1)); - CreateLoader(kUseAccessControl); + CreateLoader(WebURLRequest::kFetchRequestModeCORS); CallCheckpoint(1); EXPECT_CALL(*Client(), DidFailAccessControlCheck(_));
diff --git a/third_party/WebKit/Source/core/page/BUILD.gn b/third_party/WebKit/Source/core/page/BUILD.gn index 984b1e84..8adf61e 100644 --- a/third_party/WebKit/Source/core/page/BUILD.gn +++ b/third_party/WebKit/Source/core/page/BUILD.gn
@@ -49,6 +49,8 @@ "PageVisibilityObserver.h", "PageVisibilityState.cpp", "PageVisibilityState.h", + "PageWidgetDelegate.cpp", + "PageWidgetDelegate.h", "PointerLockController.cpp", "PointerLockController.h", "PopupOpeningObserver.h",
diff --git a/third_party/WebKit/Source/web/PageWidgetDelegate.cpp b/third_party/WebKit/Source/core/page/PageWidgetDelegate.cpp similarity index 99% rename from third_party/WebKit/Source/web/PageWidgetDelegate.cpp rename to third_party/WebKit/Source/core/page/PageWidgetDelegate.cpp index 1996fb9..c042afa1 100644 --- a/third_party/WebKit/Source/web/PageWidgetDelegate.cpp +++ b/third_party/WebKit/Source/core/page/PageWidgetDelegate.cpp
@@ -28,7 +28,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "web/PageWidgetDelegate.h" +#include "core/page/PageWidgetDelegate.h" #include "core/events/WebInputEventConversion.h" #include "core/frame/LocalFrame.h" @@ -135,9 +135,10 @@ Document* document = result.InnerNodeFrame()->GetDocument(); if (document) { AXObjectCache* cache = document->ExistingAXObjectCache(); - if (cache) + if (cache) { cache->OnTouchAccessibilityHover( result.RoundedPointInInnerNodeFrame()); + } } } }
diff --git a/third_party/WebKit/Source/web/PageWidgetDelegate.h b/third_party/WebKit/Source/core/page/PageWidgetDelegate.h similarity index 96% rename from third_party/WebKit/Source/web/PageWidgetDelegate.h rename to third_party/WebKit/Source/core/page/PageWidgetDelegate.h index 8712e32..dcb31747 100644 --- a/third_party/WebKit/Source/web/PageWidgetDelegate.h +++ b/third_party/WebKit/Source/core/page/PageWidgetDelegate.h
@@ -31,10 +31,10 @@ #ifndef PageWidgetDelegate_h #define PageWidgetDelegate_h +#include "core/CoreExport.h" #include "public/platform/WebCanvas.h" #include "public/platform/WebCoalescedInputEvent.h" #include "public/web/WebWidget.h" -#include "web/WebExport.h" namespace blink { @@ -47,7 +47,7 @@ class WebMouseWheelEvent; class WebTouchEvent; -class WEB_EXPORT PageWidgetEventHandler { +class CORE_EXPORT PageWidgetEventHandler { public: virtual void HandleMouseMove(LocalFrame& main_frame, const WebMouseEvent&, @@ -68,7 +68,7 @@ }; // Common implementation of WebViewImpl and WebPagePopupImpl. -class PageWidgetDelegate { +class CORE_EXPORT PageWidgetDelegate { public: static void Animate(Page&, double monotonic_frame_begin_time);
diff --git a/third_party/WebKit/Source/core/page/TouchAdjustment.cpp b/third_party/WebKit/Source/core/page/TouchAdjustment.cpp index d501319d..d3656cc 100644 --- a/third_party/WebKit/Source/core/page/TouchAdjustment.cpp +++ b/third_party/WebKit/Source/core/page/TouchAdjustment.cpp
@@ -140,7 +140,7 @@ return true; // Only the selected part of the layoutObject is a valid target, but this // will be corrected in appendContextSubtargetsForNode. - if (node->GetLayoutObject()->GetSelectionState() != SelectionNone) + if (node->GetLayoutObject()->GetSelectionState() != SelectionState::kNone) return true; } return false; @@ -202,24 +202,24 @@ last_offset = offset; } } else { - if (text_layout_object->GetSelectionState() == SelectionNone) + if (text_layout_object->GetSelectionState() == SelectionState::kNone) return AppendBasicSubtargetsForNode(node, subtargets); // If selected, make subtargets out of only the selected part of the text. int start_pos, end_pos; switch (text_layout_object->GetSelectionState()) { - case SelectionInside: + case SelectionState::kInside: start_pos = 0; end_pos = text_layout_object->TextLength(); break; - case SelectionStart: + case SelectionState::kStart: std::tie(start_pos, end_pos) = text_layout_object->SelectionStartEnd(); end_pos = text_layout_object->TextLength(); break; - case SelectionEnd: + case SelectionState::kEnd: std::tie(start_pos, end_pos) = text_layout_object->SelectionStartEnd(); start_pos = 0; break; - case SelectionBoth: + case SelectionState::kStartAndEnd: std::tie(start_pos, end_pos) = text_layout_object->SelectionStartEnd(); break; default:
diff --git a/third_party/WebKit/Source/core/paint/BoxClipper.cpp b/third_party/WebKit/Source/core/paint/BoxClipper.cpp index dd368f7..eff3427d 100644 --- a/third_party/WebKit/Source/core/paint/BoxClipper.cpp +++ b/third_party/WebKit/Source/core/paint/BoxClipper.cpp
@@ -70,7 +70,7 @@ // Selection may extend beyond visual overflow, so this optimization is // invalid if selection is present. if (contents_clip_behavior == kSkipContentsClipIfPossible && - box.GetSelectionState() == SelectionNone) { + box.GetSelectionState() == SelectionState::kNone) { LayoutRect contents_visual_overflow = box_.ContentsVisualOverflowRect(); if (contents_visual_overflow.IsEmpty()) return;
diff --git a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp index 8ad7c16..2e4a3b602 100644 --- a/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp +++ b/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
@@ -287,9 +287,9 @@ bool is_printing = paint_info.IsPrinting(); // Determine whether or not we're selected. - bool have_selection = !is_printing && - paint_info.phase != kPaintPhaseTextClip && - inline_text_box_.GetSelectionState() != SelectionNone; + bool have_selection = + !is_printing && paint_info.phase != kPaintPhaseTextClip && + inline_text_box_.GetSelectionState() != SelectionState::kNone; if (!have_selection && paint_info.phase == kPaintPhaseSelection) { // When only painting the selection, don't bother to paint if there is none. return;
diff --git a/third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp b/third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp index 03a58e1..9b8b9f70 100644 --- a/third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp +++ b/third_party/WebKit/Source/core/paint/ListMarkerPainter.cpp
@@ -76,7 +76,7 @@ ->GetImage(layout_list_marker_, marker.Size()) .Get(), marker); - if (layout_list_marker_.GetSelectionState() != SelectionNone) { + if (layout_list_marker_.GetSelectionState() != SelectionState::kNone) { LayoutRect sel_rect = layout_list_marker_.LocalSelectionRect(); sel_rect.MoveBy(box_origin); context.FillRect(
diff --git a/third_party/WebKit/Source/core/paint/PartPainter.cpp b/third_party/WebKit/Source/core/paint/PartPainter.cpp index 1b5b232..9f056a8 100644 --- a/third_party/WebKit/Source/core/paint/PartPainter.cpp +++ b/third_party/WebKit/Source/core/paint/PartPainter.cpp
@@ -21,22 +21,22 @@ bool PartPainter::IsSelected() const { SelectionState s = layout_part_.GetSelectionState(); - if (s == SelectionNone) + if (s == SelectionState::kNone) return false; - if (s == SelectionInside) + if (s == SelectionState::kInside) return true; int selection_start, selection_end; std::tie(selection_start, selection_end) = layout_part_.SelectionStartEnd(); - if (s == SelectionStart) + if (s == SelectionState::kStart) return selection_start == 0; int end = layout_part_.GetNode()->hasChildren() ? layout_part_.GetNode()->CountChildren() : 1; - if (s == SelectionEnd) + if (s == SelectionState::kEnd) return selection_end == end; - if (s == SelectionBoth) + if (s == SelectionState::kStartAndEnd) return selection_start == 0 && selection_end == end; DCHECK(0);
diff --git a/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp b/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp index fae2aa8..dcd5dae 100644 --- a/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp +++ b/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp
@@ -75,7 +75,7 @@ return; if (paint_info.phase == kPaintPhaseSelection) - if (layout_replaced_.GetSelectionState() == SelectionNone) + if (layout_replaced_.GetSelectionState() == SelectionState::kNone) return; { @@ -119,7 +119,7 @@ // want it to run right up to the edges of surrounding content. bool draw_selection_tint = paint_info.phase == kPaintPhaseForeground && - layout_replaced_.GetSelectionState() != SelectionNone && + layout_replaced_.GetSelectionState() != SelectionState::kNone && !paint_info.IsPrinting(); if (draw_selection_tint && !LayoutObjectDrawingRecorder::UseCachedDrawingIfPossible(
diff --git a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp index b2c018db..3d1c30e 100644 --- a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp +++ b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
@@ -45,7 +45,7 @@ // pattern or feImage (element reference.) if (paint_info.IsRenderingResourceSubtree()) return false; - return svg_inline_text_box_.GetSelectionState() != SelectionNone; + return svg_inline_text_box_.GetSelectionState() != SelectionState::kNone; } static bool HasShadow(const PaintInfo& paint_info, const ComputedStyle& style) {
diff --git a/third_party/WebKit/Source/core/paint/SVGRootInlineBoxPainter.cpp b/third_party/WebKit/Source/core/paint/SVGRootInlineBoxPainter.cpp index 3128bfb..0c9442d 100644 --- a/third_party/WebKit/Source/core/paint/SVGRootInlineBoxPainter.cpp +++ b/third_party/WebKit/Source/core/paint/SVGRootInlineBoxPainter.cpp
@@ -24,7 +24,7 @@ bool has_selection = !paint_info.IsPrinting() && - svg_root_inline_box_.GetSelectionState() != SelectionNone; + svg_root_inline_box_.GetSelectionState() != SelectionState::kNone; PaintInfo paint_info_before_filtering(paint_info); if (has_selection && !LayoutObjectDrawingRecorder::UseCachedDrawingIfPossible(
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h index b93502c..c8810947 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.h +++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -1670,12 +1670,12 @@ bool QuotesDataEquivalent(const ComputedStyle&) const; // text-combine-upright (aka -webkit-text-combine, -epub-text-combine) - static TextCombine InitialTextCombine() { return kTextCombineNone; } + static TextCombine InitialTextCombine() { return TextCombine::kNone; } TextCombine GetTextCombine() const { return static_cast<TextCombine>(rare_inherited_data_->text_combine_); } void SetTextCombine(TextCombine v) { - SET_VAR(rare_inherited_data_, text_combine_, v); + SET_VAR(rare_inherited_data_, text_combine_, static_cast<unsigned>(v)); } // text-justify @@ -1765,15 +1765,6 @@ SET_VAR(rare_inherited_data_, user_modify_, static_cast<unsigned>(u)); } - // -webkit-user-select - static EUserSelect InitialUserSelect() { return EUserSelect::kText; } - EUserSelect UserSelect() const { - return static_cast<EUserSelect>(rare_inherited_data_->user_select_); - } - void SetUserSelect(EUserSelect s) { - SET_VAR(rare_inherited_data_, user_select_, static_cast<unsigned>(s)); - } - // caret-color void SetCaretColor(const StyleAutoColor& color) { SET_VAR(rare_inherited_data_, caret_color_, color.Resolve(Color())); @@ -2201,7 +2192,7 @@ } // Text-combine utility functions. - bool HasTextCombine() const { return GetTextCombine() != kTextCombineNone; } + bool HasTextCombine() const { return GetTextCombine() != TextCombine::kNone; } // Grid utility functions. const Vector<GridTrackSize>& GridAutoRepeatColumns() const {
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h index 45238ad..0b70801 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h +++ b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
@@ -118,7 +118,7 @@ kLength }; -enum TextCombine { kTextCombineNone, kTextCombineAll }; +enum class TextCombine { kNone, kAll }; enum EFillAttachment { kScrollBackgroundAttachment, @@ -181,10 +181,6 @@ enum EUserDrag { DRAG_AUTO, DRAG_NONE, DRAG_ELEMENT }; -// CSS3 User Select Values - -enum class EUserSelect { kNone, kText, kAll }; - // CSS3 Image Values enum ObjectFit { kObjectFitFill,
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp index d4d3884c..e7ac0cab 100644 --- a/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp +++ b/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp
@@ -50,13 +50,13 @@ if (script_url.IsEmpty()) return false; - CrossOriginRequestPolicy cross_origin_request_policy = - script_url.ProtocolIsData() ? kAllowCrossOriginRequests - : kDenyCrossOriginRequests; + WebURLRequest::FetchRequestMode fetch_request_mode = + script_url.ProtocolIsData() ? WebURLRequest::kFetchRequestModeNoCORS + : WebURLRequest::kFetchRequestModeSameOrigin; script_loader_ = WorkerScriptLoader::Create(); script_loader_->LoadAsynchronously( - *context, script_url, cross_origin_request_policy, + *context, script_url, fetch_request_mode, context->GetSecurityContext().AddressSpace(), WTF::Bind(&InProcessWorkerBase::OnResponse, WrapPersistent(this)), WTF::Bind(&InProcessWorkerBase::OnFinished, WrapPersistent(this)));
diff --git a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp index 45fb5a5..e4e5fc8 100644 --- a/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
@@ -197,7 +197,7 @@ RefPtr<WorkerScriptLoader> script_loader(WorkerScriptLoader::Create()); script_loader->SetRequestContext(WebURLRequest::kRequestContextScript); script_loader->LoadSynchronously( - execution_context, complete_url, kAllowCrossOriginRequests, + execution_context, complete_url, WebURLRequest::kFetchRequestModeNoCORS, execution_context.GetSecurityContext().AddressSpace()); // If the fetching attempt failed, throw a NetworkError exception and
diff --git a/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp b/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp index 798060b2b..5f8886b 100644 --- a/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp
@@ -43,7 +43,6 @@ #include "platform/wtf/PtrUtil.h" #include "platform/wtf/RefPtr.h" #include "public/platform/WebAddressSpace.h" -#include "public/platform/WebURLRequest.h" namespace blink { @@ -65,7 +64,7 @@ void WorkerScriptLoader::LoadSynchronously( ExecutionContext& execution_context, const KURL& url, - CrossOriginRequestPolicy cross_origin_request_policy, + WebURLRequest::FetchRequestMode fetch_request_mode, WebAddressSpace creation_address_space) { url_ = url; execution_context_ = &execution_context; @@ -74,7 +73,7 @@ SECURITY_DCHECK(execution_context.IsWorkerGlobalScope()); ThreadableLoaderOptions options; - options.cross_origin_request_policy = cross_origin_request_policy; + options.fetch_request_mode = fetch_request_mode; // FIXME: Should we add EnforceScriptSrcDirective here? options.content_security_policy_enforcement = kDoNotEnforceContentSecurityPolicy; @@ -90,7 +89,7 @@ void WorkerScriptLoader::LoadAsynchronously( ExecutionContext& execution_context, const KURL& url, - CrossOriginRequestPolicy cross_origin_request_policy, + WebURLRequest::FetchRequestMode fetch_request_mode, WebAddressSpace creation_address_space, std::unique_ptr<WTF::Closure> response_callback, std::unique_ptr<WTF::Closure> finished_callback) { @@ -102,7 +101,7 @@ ResourceRequest request(CreateResourceRequest(creation_address_space)); ThreadableLoaderOptions options; - options.cross_origin_request_policy = cross_origin_request_policy; + options.fetch_request_mode = fetch_request_mode; ResourceLoaderOptions resource_loader_options; resource_loader_options.allow_credentials = kAllowStoredCredentials;
diff --git a/third_party/WebKit/Source/core/workers/WorkerScriptLoader.h b/third_party/WebKit/Source/core/workers/WorkerScriptLoader.h index 735d3cd..fb8f4a4 100644 --- a/third_party/WebKit/Source/core/workers/WorkerScriptLoader.h +++ b/third_party/WebKit/Source/core/workers/WorkerScriptLoader.h
@@ -62,13 +62,13 @@ void LoadSynchronously(ExecutionContext&, const KURL&, - CrossOriginRequestPolicy, + WebURLRequest::FetchRequestMode, WebAddressSpace); // Note that callbacks could be invoked before loadAsynchronously() returns. void LoadAsynchronously(ExecutionContext&, const KURL&, - CrossOriginRequestPolicy, + WebURLRequest::FetchRequestMode, WebAddressSpace, std::unique_ptr<WTF::Closure> response_callback, std::unique_ptr<WTF::Closure> finished_callback);
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp index 3cd236d..00cceac 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -1015,9 +1015,9 @@ request.AddHTTPHeaderFields(request_headers_); ThreadableLoaderOptions options; - options.preflight_policy = - upload_events ? kForcePreflight : kConsiderPreflight; - options.cross_origin_request_policy = kUseAccessControl; + options.fetch_request_mode = + upload_events ? WebURLRequest::kFetchRequestModeCORSWithForcedPreflight + : WebURLRequest::kFetchRequestModeCORS; options.initiator = FetchInitiatorTypeNames::xmlhttprequest; options.content_security_policy_enforcement = ContentSecurityPolicy::ShouldBypassMainWorld(&execution_context)
diff --git a/third_party/WebKit/Source/modules/eventsource/EventSource.cpp b/third_party/WebKit/Source/modules/eventsource/EventSource.cpp index f601b60..b339f75 100644 --- a/third_party/WebKit/Source/modules/eventsource/EventSource.cpp +++ b/third_party/WebKit/Source/modules/eventsource/EventSource.cpp
@@ -150,7 +150,7 @@ ThreadableLoaderOptions options; options.preflight_policy = kPreventPreflight; - options.cross_origin_request_policy = kUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; options.content_security_policy_enforcement = ContentSecurityPolicy::ShouldBypassMainWorld(&execution_context) ? kDoNotEnforceContentSecurityPolicy
diff --git a/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp b/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp index c909c440..dc41e63 100644 --- a/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp +++ b/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp
@@ -279,8 +279,7 @@ ThreadableLoader* BlobBytesConsumer::CreateLoader() { ThreadableLoaderOptions options; - options.preflight_policy = kConsiderPreflight; - options.cross_origin_request_policy = kDenyCrossOriginRequests; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeSameOrigin; options.content_security_policy_enforcement = kDoNotEnforceContentSecurityPolicy; options.initiator = FetchInitiatorTypeNames::internal;
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp index 3fbe6f0..cd2c746 100644 --- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp +++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -803,26 +803,29 @@ ContentSecurityPolicy::ShouldBypassMainWorld(execution_context_) ? kDoNotEnforceContentSecurityPolicy : kEnforceContentSecurityPolicy; - if (cors_preflight_flag) - threadable_loader_options.preflight_policy = kForcePreflight; switch (request_->Mode()) { case WebURLRequest::kFetchRequestModeSameOrigin: - threadable_loader_options.cross_origin_request_policy = - kDenyCrossOriginRequests; - break; case WebURLRequest::kFetchRequestModeNoCORS: - threadable_loader_options.cross_origin_request_policy = - kAllowCrossOriginRequests; + threadable_loader_options.fetch_request_mode = request_->Mode(); break; case WebURLRequest::kFetchRequestModeCORS: case WebURLRequest::kFetchRequestModeCORSWithForcedPreflight: - threadable_loader_options.cross_origin_request_policy = kUseAccessControl; + // TODO(tyoshino): Use only the flag or the mode enum inside the + // FetchManager. Currently both are used due to ongoing refactoring. + // See http://crbug.com/727596. + if (cors_preflight_flag) { + threadable_loader_options.fetch_request_mode = + WebURLRequest::kFetchRequestModeCORSWithForcedPreflight; + } else { + threadable_loader_options.fetch_request_mode = + WebURLRequest::kFetchRequestModeCORS; + } break; case WebURLRequest::kFetchRequestModeNavigate: - // Using DenyCrossOriginRequests here to reduce the security risk. + // Using kFetchRequestModeSameOrigin here to reduce the security risk. // "navigate" request is only available in ServiceWorker. - threadable_loader_options.cross_origin_request_policy = - kDenyCrossOriginRequests; + threadable_loader_options.fetch_request_mode = + WebURLRequest::kFetchRequestModeSameOrigin; break; } probe::willStartFetch(execution_context_, this); @@ -856,8 +859,8 @@ ContentSecurityPolicy::ShouldBypassMainWorld(execution_context_) ? kDoNotEnforceContentSecurityPolicy : kEnforceContentSecurityPolicy; - threadable_loader_options.cross_origin_request_policy = - kAllowCrossOriginRequests; + threadable_loader_options.fetch_request_mode = + WebURLRequest::kFetchRequestModeNoCORS; probe::willStartFetch(execution_context_, this); loader_ = ThreadableLoader::Create(*execution_context_, this,
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp index e9e5094..3b29da7 100644 --- a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp +++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
@@ -105,9 +105,8 @@ image_callback_ = std::move(image_callback); ThreadableLoaderOptions threadable_loader_options; - threadable_loader_options.preflight_policy = kPreventPreflight; - threadable_loader_options.cross_origin_request_policy = - kAllowCrossOriginRequests; + threadable_loader_options.fetch_request_mode = + WebURLRequest::kFetchRequestModeNoCORS; threadable_loader_options.timeout_milliseconds = kImageFetchTimeoutInMs; // TODO(mvanouwerkerk): Add an entry for notifications to
diff --git a/third_party/WebKit/Source/web/BUILD.gn b/third_party/WebKit/Source/web/BUILD.gn index 1d5f8ab..0449433 100644 --- a/third_party/WebKit/Source/web/BUILD.gn +++ b/third_party/WebKit/Source/web/BUILD.gn
@@ -83,8 +83,6 @@ "OpenedFrameTracker.h", "PageOverlay.cpp", "PageOverlay.h", - "PageWidgetDelegate.cpp", - "PageWidgetDelegate.h", "PopupMenuImpl.cpp", "PopupMenuImpl.h", "PrerendererClientImpl.cpp",
diff --git a/third_party/WebKit/Source/web/WebAssociatedURLLoaderImplTest.cpp b/third_party/WebKit/Source/web/WebAssociatedURLLoaderImplTest.cpp index 55334aff..342a424 100644 --- a/third_party/WebKit/Source/web/WebAssociatedURLLoaderImplTest.cpp +++ b/third_party/WebKit/Source/web/WebAssociatedURLLoaderImplTest.cpp
@@ -225,8 +225,7 @@ url, expected_response_, frame_file_path_); WebAssociatedURLLoaderOptions options; - options.cross_origin_request_policy = WebAssociatedURLLoaderOptions:: - kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; expected_loader_ = CreateAssociatedURLLoader(options); EXPECT_TRUE(expected_loader_); expected_loader_->LoadAsynchronously(request, this); @@ -303,8 +302,7 @@ url, expected_response_, frame_file_path_); WebAssociatedURLLoaderOptions options; - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyAllow; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeNoCORS; expected_loader_ = CreateAssociatedURLLoader(options); EXPECT_TRUE(expected_loader_); expected_loader_->LoadAsynchronously(request, this); @@ -329,8 +327,7 @@ url, expected_response_, frame_file_path_); WebAssociatedURLLoaderOptions options; - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; expected_loader_ = CreateAssociatedURLLoader(options); EXPECT_TRUE(expected_loader_); expected_loader_->LoadAsynchronously(request, this); @@ -359,8 +356,7 @@ // credentials can't be sent to a server which returns the header // "access-control-allow-origin" with "*" as its value. options.allow_credentials = true; - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; expected_loader_ = CreateAssociatedURLLoader(options); EXPECT_TRUE(expected_loader_); expected_loader_->LoadAsynchronously(request, this); @@ -389,8 +385,7 @@ url, expected_response_, frame_file_path_); WebAssociatedURLLoaderOptions options; - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; expected_loader_ = CreateAssociatedURLLoader(options); EXPECT_TRUE(expected_loader_); expected_loader_->LoadAsynchronously(request, this); @@ -499,8 +494,7 @@ redirect_url, expected_response_, frame_file_path_); WebAssociatedURLLoaderOptions options; - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; expected_loader_ = CreateAssociatedURLLoader(options); EXPECT_TRUE(expected_loader_); expected_loader_->LoadAsynchronously(request, this); @@ -550,8 +544,7 @@ redirect_url, expected_response_, frame_file_path_); WebAssociatedURLLoaderOptions options; - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; expected_loader_ = CreateAssociatedURLLoader(options); EXPECT_TRUE(expected_loader_); expected_loader_->LoadAsynchronously(request, this); @@ -664,8 +657,7 @@ WebAssociatedURLLoaderOptions options; options.expose_all_response_headers = true; // This turns off response whitelisting. - options.cross_origin_request_policy = - WebAssociatedURLLoaderOptions::kCrossOriginRequestPolicyUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; expected_loader_ = CreateAssociatedURLLoader(options); EXPECT_TRUE(expected_loader_); expected_loader_->LoadAsynchronously(request, this);
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp index 0c59c3d..b257364 100644 --- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp +++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -331,7 +331,8 @@ WebURLRequest::kRequestContextServiceWorker); main_script_loader_->LoadAsynchronously( *main_frame_->GetFrame()->GetDocument(), worker_start_data_.script_url, - kDenyCrossOriginRequests, worker_start_data_.address_space, nullptr, + WebURLRequest::kFetchRequestModeSameOrigin, + worker_start_data_.address_space, nullptr, Bind(&WebEmbeddedWorkerImpl::OnScriptLoaderFinished, WTF::Unretained(this))); // Do nothing here since onScriptLoaderFinished() might have been already
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.h b/third_party/WebKit/Source/web/WebFrameWidgetImpl.h index 326e918..66fb6b68 100644 --- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.h +++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.h
@@ -34,6 +34,7 @@ #include "core/animation/CompositorMutatorImpl.h" #include "core/frame/WebFrameWidgetBase.h" #include "core/frame/WebLocalFrameBase.h" +#include "core/page/PageWidgetDelegate.h" #include "platform/graphics/GraphicsLayer.h" #include "platform/heap/SelfKeepAlive.h" #include "platform/scroll/ScrollTypes.h" @@ -43,7 +44,6 @@ #include "public/platform/WebPoint.h" #include "public/platform/WebSize.h" #include "public/web/WebInputMethodController.h" -#include "web/PageWidgetDelegate.h" namespace blink {
diff --git a/third_party/WebKit/Source/web/WebPagePopupImpl.h b/third_party/WebKit/Source/web/WebPagePopupImpl.h index 305cc55..db26808 100644 --- a/third_party/WebKit/Source/web/WebPagePopupImpl.h +++ b/third_party/WebKit/Source/web/WebPagePopupImpl.h
@@ -32,9 +32,9 @@ #define WebPagePopupImpl_h #include "core/page/PagePopup.h" +#include "core/page/PageWidgetDelegate.h" #include "platform/wtf/RefCounted.h" #include "public/web/WebPagePopup.h" -#include "web/PageWidgetDelegate.h" // To avoid conflicts with the CreateWindow macro from the Windows SDK... #undef PostMessage
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp index e23768f..43ceafd 100644 --- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp +++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -189,12 +189,13 @@ WebURLRequest::kRequestContextSharedWorker); loading_document_ = main_frame_->GetFrame()->GetDocument(); - CrossOriginRequestPolicy cross_origin_request_policy = - (static_cast<KURL>(url_)).ProtocolIsData() ? kAllowCrossOriginRequests - : kDenyCrossOriginRequests; + WebURLRequest::FetchRequestMode fetch_request_mode = + (static_cast<KURL>(url_)).ProtocolIsData() + ? WebURLRequest::kFetchRequestModeNoCORS + : WebURLRequest::kFetchRequestModeSameOrigin; main_script_loader_->LoadAsynchronously( - *loading_document_.Get(), url_, cross_origin_request_policy, + *loading_document_.Get(), url_, fetch_request_mode, creation_address_space_, Bind(&WebSharedWorkerImpl::DidReceiveScriptLoaderResponse, WTF::Unretained(this)),
diff --git a/third_party/WebKit/Source/web/WebViewImpl.h b/third_party/WebKit/Source/web/WebViewImpl.h index 157d72a..25b9b84 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.h +++ b/third_party/WebKit/Source/web/WebViewImpl.h
@@ -37,6 +37,7 @@ #include "core/page/ChromeClient.h" #include "core/page/ContextMenuProvider.h" #include "core/page/EventWithHitTestResults.h" +#include "core/page/PageWidgetDelegate.h" #include "platform/animation/CompositorAnimationTimeline.h" #include "platform/geometry/IntPoint.h" #include "platform/geometry/IntRect.h" @@ -64,7 +65,6 @@ #include "web/ContextMenuClientImpl.h" #include "web/EditorClientImpl.h" #include "web/MediaKeysClientImpl.h" -#include "web/PageWidgetDelegate.h" #include "web/SpellCheckerClientImpl.h" #include "web/StorageClientImpl.h" #include "web/WebExport.h"
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp index ef3de09..f3be8a7 100644 --- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp +++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -9780,7 +9780,7 @@ ThreadableLoaderOptions options; // First try to load the request with regular access. Should fail. - options.cross_origin_request_policy = kUseAccessControl; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS; ResourceLoaderOptions resource_loader_options; DocumentThreadableLoader::LoadResourceSynchronously( *frame->GetDocument(), request, client, options, resource_loader_options); @@ -9788,7 +9788,7 @@ client.Reset(); // Try to load the request with cross origin access. Should succeed. - options.cross_origin_request_policy = kAllowCrossOriginRequests; + options.fetch_request_mode = WebURLRequest::kFetchRequestModeNoCORS; DocumentThreadableLoader::LoadResourceSynchronously( *frame->GetDocument(), request, client, options, resource_loader_options); EXPECT_FALSE(client.Failed());
diff --git a/third_party/WebKit/public/web/WebAssociatedURLLoaderOptions.h b/third_party/WebKit/public/web/WebAssociatedURLLoaderOptions.h index 4e9d2d9..bccff23 100644 --- a/third_party/WebKit/public/web/WebAssociatedURLLoaderOptions.h +++ b/third_party/WebKit/public/web/WebAssociatedURLLoaderOptions.h
@@ -31,18 +31,13 @@ #ifndef WebAssociatedURLLoaderOptions_h #define WebAssociatedURLLoaderOptions_h +#include "public/platform/WebURLRequest.h" + namespace blink { struct WebAssociatedURLLoaderOptions { - enum CrossOriginRequestPolicy { - kCrossOriginRequestPolicyDeny, - kCrossOriginRequestPolicyUseAccessControl, - kCrossOriginRequestPolicyAllow - }; - enum PreflightPolicy { kConsiderPreflight, - kForcePreflight, kPreventPreflight }; @@ -51,7 +46,7 @@ allow_credentials(false), expose_all_response_headers(false), preflight_policy(kConsiderPreflight), - cross_origin_request_policy(kCrossOriginRequestPolicyDeny) {} + fetch_request_mode(WebURLRequest::kFetchRequestModeSameOrigin) {} // Whether to validate the method and headers as if this was an // XMLHttpRequest. @@ -62,7 +57,7 @@ // response headers to the client. bool expose_all_response_headers; PreflightPolicy preflight_policy; - CrossOriginRequestPolicy cross_origin_request_policy; + WebURLRequest::FetchRequestMode fetch_request_mode; }; } // namespace blink
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index b107d9bd..56c58bb4 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -15093,6 +15093,7 @@ <int value="2015" label="TableRowDirectionDifferentFromTable"/> <int value="2016" label="TableSectionDirectionDifferentFromTable"/> <int value="2017" label="ClientHintsDeviceRAM"/> + <int value="2018" label="CSSRegisterProperty"/> </enum> <enum name="FeedbackSource" type="int"> @@ -21094,6 +21095,34 @@ <int value="268959744" label="NEW_TASK | NEW_DOCUMENT"/> </enum> +<enum name="LaunchMode" type="int"> + <int value="1" label="LM_AS_WEBAPP"> + Launched as an installed web application + </int> + <int value="2" label="LM_WITH_URLS">Launched with urls in the cmd line</int> + <int value="3" label="LM_OTHER"> + Fallback value when no other LM_ condition is satisfied + </int> + <int value="4" label="LM_SHORTCUT_NONAME"> + Launched from shortcut but the path to the shortcut cannot be determined + </int> + <int value="5" label="LM_SHORTCUT_UNKNOWN"> + Launched from user-defined shortcut + </int> + <int value="6" label="LM_SHORTCUT_QUICKLAUNCH"> + Launched from the quick launch bar (pre-Win7) + </int> + <int value="7" label="LM_SHORTCUT_DESKTOP"> + Launched from a desktop shortcut + </int> + <int value="8" label="LM_SHORTCUT_TASKBAR"> + Launched from the taskbar (Win7 and higher) + </int> + <int value="9" label="LM_USER_EXPERIMENT"> + Launched from the installer as part of a retention experiment + </int> +</enum> + <enum name="LazyCSSParseUsage" type="int"> <int value="0" label=">= 0%"/> <int value="1" label="> 10%"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 56a5e0f..e0d8cd6 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -26243,6 +26243,11 @@ </summary> </histogram> +<histogram name="Launch.Modes" enum="LaunchMode"> + <owner>calamity@chromium.org</owner> + <summary>The different ways Chrome is launched.</summary> +</histogram> + <histogram name="Layout.MicroSecondsPerComplexText" units="microseconds"> <owner>benjhayden@chromium.org</owner> <summary>
diff --git a/tools/perf/benchmark.csv b/tools/perf/benchmark.csv index 3b5c2fe..3cb4162 100644 --- a/tools/perf/benchmark.csv +++ b/tools/perf/benchmark.csv
@@ -41,7 +41,6 @@ memory.long_running_idle_gmail_background_tbmv2,ulan@chromium.org, memory.long_running_idle_gmail_tbmv2,ulan@chromium.org, memory.top_10_mobile,perezju@chromium.org, -memory.top_10_mobile_stress,perezju@chromium.org, octane,"bmeurer@chromium.org, mvstanton@chromium.org", oortonline,ulan@chromium.org, oortonline_tbmv2,ulan@chromium.org,
diff --git a/tools/perf/benchmarks/memory.py b/tools/perf/benchmarks/memory.py index 61fd959..abcb69d 100644 --- a/tools/perf/benchmarks/memory.py +++ b/tools/perf/benchmarks/memory.py
@@ -111,25 +111,6 @@ @benchmark.Enabled('android') # catapult:#3176 -@benchmark.Owner(emails=['perezju@chromium.org']) -class MemoryBenchmarkTop10MobileStress(MemoryBenchmarkTop10Mobile): - """Run top 10 mobile page set without closing/restarting the browser. - - This benchmark is intended to stress-test the browser, catching memory leaks - or possible crashes after interacting with the browser for a period of time. - """ - page_set = page_sets.MemoryTop10MobileRealistic - - @classmethod - def Name(cls): - return 'memory.top_10_mobile_stress' - - @classmethod - def ShouldTearDownStateAfterEachStorySetRun(cls): - return False - - -@benchmark.Enabled('android') # catapult:#3176 @benchmark.Owner(emails=['bashi@chromium.org']) class RendererMemoryBlinkMemoryMobile(_MemoryInfra): """Timeline based benchmark for measuring memory consumption on mobile
diff --git a/ui/arc/BUILD.gn b/ui/arc/BUILD.gn index d34d2f2..1f9a43f 100644 --- a/ui/arc/BUILD.gn +++ b/ui/arc/BUILD.gn
@@ -7,8 +7,8 @@ static_library("arc") { sources = [ - "notification/arc_custom_notification_view.cc", - "notification/arc_custom_notification_view.h", + "notification/arc_notification_content_view.cc", + "notification/arc_notification_content_view.h", "notification/arc_notification_delegate.cc", "notification/arc_notification_delegate.h", "notification/arc_notification_item.h",
diff --git a/ui/arc/notification/arc_custom_notification_view.cc b/ui/arc/notification/arc_notification_content_view.cc similarity index 86% rename from ui/arc/notification/arc_custom_notification_view.cc rename to ui/arc/notification/arc_notification_content_view.cc index d5ec3161..312dcb9 100644 --- a/ui/arc/notification/arc_custom_notification_view.cc +++ b/ui/arc/notification/arc_notification_content_view.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/arc/notification/arc_custom_notification_view.h" +#include "ui/arc/notification/arc_notification_content_view.h" #include "ash/wm/window_util.h" #include "base/auto_reset.h" @@ -49,9 +49,9 @@ } // namespace -class ArcCustomNotificationView::EventForwarder : public ui::EventHandler { +class ArcNotificationContentView::EventForwarder : public ui::EventHandler { public: - explicit EventForwarder(ArcCustomNotificationView* owner) : owner_(owner) {} + explicit EventForwarder(ArcNotificationContentView* owner) : owner_(owner) {} ~EventForwarder() override = default; private: @@ -97,15 +97,15 @@ } } - ArcCustomNotificationView* const owner_; + ArcNotificationContentView* const owner_; DISALLOW_COPY_AND_ASSIGN(EventForwarder); }; -class ArcCustomNotificationView::SlideHelper +class ArcNotificationContentView::SlideHelper : public ui::LayerAnimationObserver { public: - explicit SlideHelper(ArcCustomNotificationView* owner) : owner_(owner) { + explicit SlideHelper(ArcNotificationContentView* owner) : owner_(owner) { GetSlideOutLayer()->GetAnimator()->AddObserver(this); // Reset opacity to 1 to handle to case when the surface is sliding before @@ -169,17 +169,17 @@ } void OnLayerAnimationScheduled(ui::LayerAnimationSequence* seq) override {} - ArcCustomNotificationView* const owner_; + ArcNotificationContentView* const owner_; bool sliding_ = false; std::unique_ptr<ui::LayerTreeOwner> surface_copy_; DISALLOW_COPY_AND_ASSIGN(SlideHelper); }; -class ArcCustomNotificationView::ContentViewDelegate +class ArcNotificationContentView::ContentViewDelegate : public ArcNotificationContentViewDelegate { public: - explicit ContentViewDelegate(ArcCustomNotificationView* owner) + explicit ContentViewDelegate(ArcNotificationContentView* owner) : owner_(owner) {} bool IsCloseButtonFocused() const override { @@ -204,13 +204,13 @@ } private: - ArcCustomNotificationView* const owner_; + ArcNotificationContentView* const owner_; DISALLOW_COPY_AND_ASSIGN(ContentViewDelegate); }; -ArcCustomNotificationView::ControlButton::ControlButton( - ArcCustomNotificationView* owner) +ArcNotificationContentView::ControlButton::ControlButton( + ArcNotificationContentView* owner) : message_center::PaddedButton(owner), owner_(owner) { if (owner_->item_) { set_background(views::Background::CreateSolidBackground( @@ -221,17 +221,18 @@ } } -void ArcCustomNotificationView::ControlButton::OnFocus() { +void ArcNotificationContentView::ControlButton::OnFocus() { message_center::PaddedButton::OnFocus(); owner_->UpdateControlButtonsVisibility(); } -void ArcCustomNotificationView::ControlButton::OnBlur() { +void ArcNotificationContentView::ControlButton::OnBlur() { message_center::PaddedButton::OnBlur(); owner_->UpdateControlButtonsVisibility(); } -ArcCustomNotificationView::ArcCustomNotificationView(ArcNotificationItem* item) +ArcNotificationContentView::ArcNotificationContentView( + ArcNotificationItem* item) : item_(item), notification_key_(item->GetNotificationKey()), event_forwarder_(new EventForwarder(this)) { @@ -255,7 +256,7 @@ UpdateAccessibleName(); } -ArcCustomNotificationView::~ArcCustomNotificationView() { +ArcNotificationContentView::~ArcNotificationContentView() { SetSurface(nullptr); auto* surface_manager = ArcNotificationSurfaceManager::Get(); @@ -268,11 +269,12 @@ } std::unique_ptr<ArcNotificationContentViewDelegate> -ArcCustomNotificationView::CreateContentViewDelegate() { - return base::MakeUnique<ArcCustomNotificationView::ContentViewDelegate>(this); +ArcNotificationContentView::CreateContentViewDelegate() { + return base::MakeUnique<ArcNotificationContentView::ContentViewDelegate>( + this); } -void ArcCustomNotificationView::CreateCloseButton() { +void ArcNotificationContentView::CreateCloseButton() { DCHECK(control_buttons_view_); DCHECK(item_); @@ -287,7 +289,7 @@ control_buttons_view_->AddChildView(close_button_.get()); } -void ArcCustomNotificationView::CreateSettingsButton() { +void ArcNotificationContentView::CreateSettingsButton() { DCHECK(control_buttons_view_); DCHECK(item_); @@ -301,7 +303,7 @@ control_buttons_view_->AddChildView(settings_button_); } -void ArcCustomNotificationView::MaybeCreateFloatingControlButtons() { +void ArcNotificationContentView::MaybeCreateFloatingControlButtons() { // Floating close button is a transient child of |surface_| and also part // of the hosting widget's focus chain. It could only be created when both // are present. Further, if we are being destroyed (|item_| is null), don't @@ -337,7 +339,7 @@ Layout(); } -void ArcCustomNotificationView::SetSurface(exo::NotificationSurface* surface) { +void ArcNotificationContentView::SetSurface(exo::NotificationSurface* surface) { if (surface_ == surface) return; @@ -365,7 +367,7 @@ } } -void ArcCustomNotificationView::UpdatePreferredSize() { +void ArcNotificationContentView::UpdatePreferredSize() { gfx::Size preferred_size; if (surface_) preferred_size = surface_->GetSize(); @@ -385,7 +387,7 @@ SetPreferredSize(preferred_size); } -void ArcCustomNotificationView::UpdateControlButtonsVisibility() { +void ArcNotificationContentView::UpdateControlButtonsVisibility() { if (!surface_) return; @@ -414,7 +416,7 @@ floating_control_buttons_widget_->Hide(); } -void ArcCustomNotificationView::UpdatePinnedState() { +void ArcNotificationContentView::UpdatePinnedState() { if (!item_) return; @@ -428,7 +430,7 @@ } } -void ArcCustomNotificationView::UpdateSnapshot() { +void ArcNotificationContentView::UpdateSnapshot() { // Bail if we have a |surface_| because it controls the sizes and paints UI. if (surface_) return; @@ -437,7 +439,7 @@ SchedulePaint(); } -void ArcCustomNotificationView::AttachSurface() { +void ArcNotificationContentView::AttachSurface() { if (!GetWidget()) return; @@ -461,7 +463,7 @@ UpdatePinnedState(); } -void ArcCustomNotificationView::StartControlButtonsColorAnimation() { +void ArcNotificationContentView::StartControlButtonsColorAnimation() { if (control_button_color_animation_) control_button_color_animation_->End(); control_button_color_animation_.reset(new gfx::LinearAnimation(this)); @@ -469,7 +471,7 @@ control_button_color_animation_->Start(); } -bool ArcCustomNotificationView::ShouldUpdateControlButtonsColor() const { +bool ArcNotificationContentView::ShouldUpdateControlButtonsColor() const { // Don't update the control button color when we are about to be destroyed. if (!item_) return false; @@ -485,7 +487,7 @@ return false; } -void ArcCustomNotificationView::UpdateAccessibleName() { +void ArcNotificationContentView::UpdateAccessibleName() { // Don't update the accessible name when we are about to be destroyed. if (!item_) return; @@ -493,7 +495,7 @@ accessible_name_ = item_->GetAccessibleName(); } -void ArcCustomNotificationView::ViewHierarchyChanged( +void ArcNotificationContentView::ViewHierarchyChanged( const views::View::ViewHierarchyChangedDetails& details) { views::Widget* widget = GetWidget(); @@ -503,9 +505,9 @@ // Bail if this view is no longer attached to a widget or native_view() has // attached to a different widget. - if (!widget || (native_view() && - views::Widget::GetTopLevelWidgetForNativeView( - native_view()) != widget)) { + if (!widget || + (native_view() && views::Widget::GetTopLevelWidgetForNativeView( + native_view()) != widget)) { return; } } @@ -518,7 +520,7 @@ AttachSurface(); } -void ArcCustomNotificationView::Layout() { +void ArcNotificationContentView::Layout() { base::AutoReset<bool> auto_reset_in_layout(&in_layout_, true); views::NativeViewHost::Layout(); @@ -569,7 +571,7 @@ ash::wm::SnapWindowToPixelBoundary(surface_->window()); } -void ArcCustomNotificationView::OnPaint(gfx::Canvas* canvas) { +void ArcNotificationContentView::OnPaint(gfx::Canvas* canvas) { views::NativeViewHost::OnPaint(canvas); // Bail if there is a |surface_| or no item or no snapshot image. @@ -582,22 +584,22 @@ contents_bounds.height(), false); } -void ArcCustomNotificationView::OnMouseEntered(const ui::MouseEvent&) { +void ArcNotificationContentView::OnMouseEntered(const ui::MouseEvent&) { UpdateControlButtonsVisibility(); } -void ArcCustomNotificationView::OnMouseExited(const ui::MouseEvent&) { +void ArcNotificationContentView::OnMouseExited(const ui::MouseEvent&) { UpdateControlButtonsVisibility(); } -void ArcCustomNotificationView::OnFocus() { +void ArcNotificationContentView::OnFocus() { CHECK_EQ(ArcNotificationView::kViewClassName, parent()->GetClassName()); NativeViewHost::OnFocus(); static_cast<ArcNotificationView*>(parent())->OnContentFocused(); } -void ArcCustomNotificationView::OnBlur() { +void ArcNotificationContentView::OnBlur() { if (!parent()) { // OnBlur may be called when this view is being removed. return; @@ -609,7 +611,7 @@ static_cast<ArcNotificationView*>(parent())->OnContentBlured(); } -void ArcCustomNotificationView::ActivateToast() { +void ArcNotificationContentView::ActivateToast() { if (message_center::ToastContentsView::kViewClassName == parent()->parent()->GetClassName()) { static_cast<message_center::ToastContentsView*>(parent()->parent()) @@ -617,14 +619,14 @@ } } -views::FocusTraversable* ArcCustomNotificationView::GetFocusTraversable() { +views::FocusTraversable* ArcNotificationContentView::GetFocusTraversable() { if (floating_control_buttons_widget_) return static_cast<views::internal::RootView*>( floating_control_buttons_widget_->GetRootView()); return nullptr; } -bool ArcCustomNotificationView::HandleAccessibleAction( +bool ArcNotificationContentView::HandleAccessibleAction( const ui::AXActionData& action_data) { if (item_ && action_data.action == ui::AX_ACTION_DO_DEFAULT) { item_->ToggleExpansion(); @@ -633,14 +635,14 @@ return false; } -void ArcCustomNotificationView::GetAccessibleNodeData( +void ArcNotificationContentView::GetAccessibleNodeData( ui::AXNodeData* node_data) { node_data->role = ui::AX_ROLE_BUTTON; node_data->SetName(accessible_name_); } -void ArcCustomNotificationView::ButtonPressed(views::Button* sender, - const ui::Event& event) { +void ArcNotificationContentView::ButtonPressed(views::Button* sender, + const ui::Event& event) { if (item_ && !item_->GetPinned() && sender == close_button_.get()) { CHECK_EQ(ArcNotificationView::kViewClassName, parent()->GetClassName()); static_cast<ArcNotificationView*>(parent())->OnCloseButtonPressed(); @@ -650,7 +652,7 @@ } } -void ArcCustomNotificationView::OnWindowBoundsChanged( +void ArcNotificationContentView::OnWindowBoundsChanged( aura::Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) { @@ -661,11 +663,11 @@ Layout(); } -void ArcCustomNotificationView::OnWindowDestroying(aura::Window* window) { +void ArcNotificationContentView::OnWindowDestroying(aura::Window* window) { SetSurface(nullptr); } -void ArcCustomNotificationView::OnItemDestroying() { +void ArcNotificationContentView::OnItemDestroying() { item_->RemoveObserver(this); item_ = nullptr; @@ -674,7 +676,7 @@ SetSurface(nullptr); } -void ArcCustomNotificationView::OnItemUpdated() { +void ArcNotificationContentView::OnItemUpdated() { UpdateAccessibleName(); UpdatePinnedState(); UpdateSnapshot(); @@ -682,7 +684,7 @@ StartControlButtonsColorAnimation(); } -void ArcCustomNotificationView::OnNotificationSurfaceAdded( +void ArcNotificationContentView::OnNotificationSurfaceAdded( exo::NotificationSurface* surface) { if (surface->notification_id() != notification_key_) return; @@ -690,7 +692,7 @@ SetSurface(surface); } -void ArcCustomNotificationView::OnNotificationSurfaceRemoved( +void ArcNotificationContentView::OnNotificationSurfaceRemoved( exo::NotificationSurface* surface) { if (surface->notification_id() != notification_key_) return; @@ -698,13 +700,13 @@ SetSurface(nullptr); } -void ArcCustomNotificationView::AnimationEnded( +void ArcNotificationContentView::AnimationEnded( const gfx::Animation* animation) { DCHECK_EQ(animation, control_button_color_animation_.get()); control_button_color_animation_.reset(); } -void ArcCustomNotificationView::AnimationProgressed( +void ArcNotificationContentView::AnimationProgressed( const gfx::Animation* animation) { DCHECK_EQ(animation, control_button_color_animation_.get());
diff --git a/ui/arc/notification/arc_custom_notification_view.h b/ui/arc/notification/arc_notification_content_view.h similarity index 88% rename from ui/arc/notification/arc_custom_notification_view.h rename to ui/arc/notification/arc_notification_content_view.h index 0257b3d..d51adddf 100644 --- a/ui/arc/notification/arc_custom_notification_view.h +++ b/ui/arc/notification/arc_notification_content_view.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ -#define UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ +#ifndef UI_ARC_NOTIFICATION_ARC_NOTIFICATION_CONTENT_VIEW_H_ +#define UI_ARC_NOTIFICATION_ARC_NOTIFICATION_CONTENT_VIEW_H_ #include <memory> #include <string> @@ -37,10 +37,9 @@ namespace arc { -// ArcCustomNotificationView is a view to host NotificationSurface and show the +// ArcNotificationContentView is a view to host NotificationSurface and show the // content in itself. This is implemented as a child of ArcNotificationView. -// TODO(yoshiki): Rename this class to ArcNotificationContentsView. -class ArcCustomNotificationView +class ArcNotificationContentView : public views::NativeViewHost, public views::ButtonListener, public aura::WindowObserver, @@ -48,8 +47,8 @@ public ArcNotificationSurfaceManager::Observer, public gfx::AnimationDelegate { public: - explicit ArcCustomNotificationView(ArcNotificationItem* item); - ~ArcCustomNotificationView() override; + explicit ArcNotificationContentView(ArcNotificationItem* item); + ~ArcNotificationContentView() override; std::unique_ptr<ArcNotificationContentViewDelegate> CreateContentViewDelegate(); @@ -65,12 +64,12 @@ // requires size of this class. class ControlButton : public message_center::PaddedButton { public: - explicit ControlButton(ArcCustomNotificationView* owner); + explicit ControlButton(ArcNotificationContentView* owner); void OnFocus() override; void OnBlur() override; private: - ArcCustomNotificationView* const owner_; + ArcNotificationContentView* const owner_; DISALLOW_COPY_AND_ASSIGN(ControlButton); }; @@ -158,9 +157,9 @@ base::string16 accessible_name_; - DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationView); + DISALLOW_COPY_AND_ASSIGN(ArcNotificationContentView); }; } // namespace arc -#endif // UI_ARC_NOTIFICATION_ARC_CUSTOM_NOTIFICATION_VIEW_H_ +#endif // UI_ARC_NOTIFICATION_ARC_NOTIFICATION_CONTENT_VIEW_H_
diff --git a/ui/arc/notification/arc_notification_delegate.cc b/ui/arc/notification/arc_notification_delegate.cc index 488eb99..8035e61 100644 --- a/ui/arc/notification/arc_notification_delegate.cc +++ b/ui/arc/notification/arc_notification_delegate.cc
@@ -4,7 +4,7 @@ #include "ui/arc/notification/arc_notification_delegate.h" -#include "ui/arc/notification/arc_custom_notification_view.h" +#include "ui/arc/notification/arc_notification_content_view.h" #include "ui/arc/notification/arc_notification_item.h" #include "ui/arc/notification/arc_notification_view.h" #include "ui/message_center/notification.h" @@ -28,7 +28,7 @@ DCHECK(item_); DCHECK_EQ(item_->GetNotificationId(), notification.id()); - auto view = base::MakeUnique<ArcCustomNotificationView>(item_.get()); + auto view = base::MakeUnique<ArcNotificationContentView>(item_.get()); auto content_view_delegate = view->CreateContentViewDelegate(); return base::MakeUnique<ArcNotificationView>(std::move(view), std::move(content_view_delegate),
diff --git a/ui/arc/notification/arc_notification_item.h b/ui/arc/notification/arc_notification_item.h index 397b324..4024b3d 100644 --- a/ui/arc/notification/arc_notification_item.h +++ b/ui/arc/notification/arc_notification_item.h
@@ -42,14 +42,14 @@ virtual void Click() = 0; // Called when the user wants to open an intrinsic setting of notification. - // This is called from ArcCustomNotificationView. + // This is called from ArcNotificationContentView. virtual void OpenSettings() = 0; // Called when the user wants to toggle expansio of notification. This is - // called from ArcCustomNotificationView. + // called from ArcNotificationContentView. virtual void ToggleExpansion() = 0; // Returns true if this notification has an intrinsic setting which shown // inside the notification content area. This is called from - // ArcCustomNotificationView. + // ArcNotificationContentView. virtual bool IsOpeningSettingsSupported() const = 0; // Adds an observer.
diff --git a/ui/arc/notification/arc_notification_item_impl.cc b/ui/arc/notification/arc_notification_item_impl.cc index 18ac549..b0edb550 100644 --- a/ui/arc/notification/arc_notification_item_impl.cc +++ b/ui/arc/notification/arc_notification_item_impl.cc
@@ -8,8 +8,8 @@ #include <vector> #include "base/memory/ptr_util.h" +#include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "ui/arc/notification/arc_custom_notification_view.h" #include "ui/arc/notification/arc_notification_delegate.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/image/image.h"
diff --git a/ui/arc/notification/arc_notification_view.cc b/ui/arc/notification/arc_notification_view.cc index 7904a6e..c5f0115 100644 --- a/ui/arc/notification/arc_notification_view.cc +++ b/ui/arc/notification/arc_notification_view.cc
@@ -6,7 +6,7 @@ #include <algorithm> -#include "ui/arc/notification/arc_custom_notification_view.h" +#include "ui/arc/notification/arc_notification_content_view_delegate.h" #include "ui/arc/notification/arc_notification_item.h" #include "ui/base/ime/input_method.h" #include "ui/base/ime/text_input_client.h"
diff --git a/ui/arc/notification/arc_notification_view.h b/ui/arc/notification/arc_notification_view.h index f82651e..8384327 100644 --- a/ui/arc/notification/arc_notification_view.h +++ b/ui/arc/notification/arc_notification_view.h
@@ -17,7 +17,7 @@ class ArcNotificationContentViewDelegate; // View for custom notification with NOTIFICATION_TYPE_CUSTOM which hosts the -// ArcCustomNotificationView which shows content of the notification. +// ArcNotificationContentView which shows content of the notification. class ArcNotificationView : public message_center::MessageView { public: static const char kViewClassName[];