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

Unified Diff: tools/gn/loader_unittest.cc

Issue 1480423003: tools/gn: replace usage of linked_ptr by using scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rm comment Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/loader_unittest.cc
diff --git a/tools/gn/loader_unittest.cc b/tools/gn/loader_unittest.cc
index 199b1209b2e8c6f2dea0d8699868535b9058b880..914e47535a0faf7db66b0ee47ea4a56db57c3e37 100644
--- a/tools/gn/loader_unittest.cc
+++ b/tools/gn/loader_unittest.cc
@@ -7,7 +7,6 @@
#include <vector>
#include "base/bind.h"
-#include "base/memory/linked_ptr.h"
#include "base/message_loop/message_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "tools/gn/build_settings.h"
@@ -55,8 +54,7 @@ class MockInputFileManager {
return true;
}
- // Owning pointers.
- typedef std::map<SourceFile, linked_ptr<CannedResult> > CannedResponseMap;
+ typedef std::map<SourceFile, scoped_ptr<CannedResult> > CannedResponseMap;
CannedResponseMap canned_responses_;
std::vector< std::pair<SourceFile, Callback> > pending_;
@@ -70,7 +68,7 @@ LoaderImpl::AsyncLoadFileCallback MockInputFileManager::GetCallback() {
// Sets a given response for a given source file.
void MockInputFileManager::AddCannedResponse(const SourceFile& source_file,
const std::string& source) {
- CannedResult* canned = new CannedResult;
+ scoped_ptr<CannedResult> canned(new CannedResult);
canned->input_file.reset(new InputFile(source_file));
canned->input_file->SetContents(source);
@@ -83,7 +81,7 @@ void MockInputFileManager::AddCannedResponse(const SourceFile& source_file,
canned->root = Parser::Parse(canned->tokens, &err).Pass();
EXPECT_FALSE(err.has_error());
- canned_responses_[source_file] = linked_ptr<CannedResult>(canned);
+ canned_responses_[source_file] = std::move(canned);
}
bool MockInputFileManager::HasOnePending(const SourceFile& f) const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698