Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: extensions/browser/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc

Issue 2370633002: replace deprecated version of SetWithoutPathExpansion (Closed)
Patch Set: use MakeUnique Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | extensions/browser/api/web_request/upload_data_presenter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/web_request/upload_data_presenter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698