OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/api/declarative_webrequest/webrequest_condition_att
ribute.h" | 5 #include "extensions/browser/api/declarative_webrequest/webrequest_condition_att
ribute.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 if (!dictionary->GetWithoutPathExpansion(*name, &entry)) | 385 if (!dictionary->GetWithoutPathExpansion(*name, &entry)) |
386 return std::unique_ptr<base::DictionaryValue>(); | 386 return std::unique_ptr<base::DictionaryValue>(); |
387 switch (entry->GetType()) { | 387 switch (entry->GetType()) { |
388 case base::Value::TYPE_STRING: | 388 case base::Value::TYPE_STRING: |
389 // Replace the present string with a list. | 389 // Replace the present string with a list. |
390 list = new base::ListValue; | 390 list = new base::ListValue; |
391 // Ignoring return value, we already verified the entry is there. | 391 // Ignoring return value, we already verified the entry is there. |
392 dictionary->RemoveWithoutPathExpansion(*name, &entry_owned); | 392 dictionary->RemoveWithoutPathExpansion(*name, &entry_owned); |
393 list->Append(std::move(entry_owned)); | 393 list->Append(std::move(entry_owned)); |
394 list->AppendString(*value); | 394 list->AppendString(*value); |
395 dictionary->SetWithoutPathExpansion(*name, list); | 395 dictionary->SetWithoutPathExpansion(*name, base::WrapUnique(list)); |
396 break; | 396 break; |
397 case base::Value::TYPE_LIST: // Just append to the list. | 397 case base::Value::TYPE_LIST: // Just append to the list. |
398 CHECK(entry->GetAsList(&list)); | 398 CHECK(entry->GetAsList(&list)); |
399 list->AppendString(*value); | 399 list->AppendString(*value); |
400 break; | 400 break; |
401 default: | 401 default: |
402 NOTREACHED(); // We never put other Values here. | 402 NOTREACHED(); // We never put other Values here. |
403 return std::unique_ptr<base::DictionaryValue>(); | 403 return std::unique_ptr<base::DictionaryValue>(); |
404 } | 404 } |
405 } else { | 405 } else { |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 }; | 714 }; |
715 const size_t kExistingSize[] = { arraysize(kExisting) }; | 715 const size_t kExistingSize[] = { arraysize(kExisting) }; |
716 GetArrayAsVector(kExisting, kExistingSize, 1u, &tests); | 716 GetArrayAsVector(kExisting, kExistingSize, 1u, &tests); |
717 MatchAndCheck(tests, keys::kExcludeResponseHeadersKey, stage, | 717 MatchAndCheck(tests, keys::kExcludeResponseHeadersKey, stage, |
718 url_request.get(), &result); | 718 url_request.get(), &result); |
719 EXPECT_FALSE(result); | 719 EXPECT_FALSE(result); |
720 } | 720 } |
721 | 721 |
722 } // namespace | 722 } // namespace |
723 } // namespace extensions | 723 } // namespace extensions |
OLD | NEW |