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

Side by Side Diff: components/bookmarks/browser/bookmark_storage.cc

Issue 2379863002: Fix object ownership in ui/base/models. (Closed)
Patch Set: fix 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/bookmarks/browser/bookmark_storage.h" 5 #include "components/bookmarks/browser/bookmark_storage.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 break; 94 break;
95 } 95 }
96 } 96 }
97 97
98 if (load_index) { 98 if (load_index) {
99 TimeTicks start_time = TimeTicks::Now(); 99 TimeTicks start_time = TimeTicks::Now();
100 AddBookmarksToIndex(details.get(), details->bb_node()); 100 AddBookmarksToIndex(details.get(), details->bb_node());
101 AddBookmarksToIndex(details.get(), details->other_folder_node()); 101 AddBookmarksToIndex(details.get(), details->other_folder_node());
102 AddBookmarksToIndex(details.get(), details->mobile_folder_node()); 102 AddBookmarksToIndex(details.get(), details->mobile_folder_node());
103 for (size_t i = 0; i < extra_nodes.size(); ++i) 103 for (size_t i = 0; i < extra_nodes.size(); ++i)
104 AddBookmarksToIndex(details.get(), extra_nodes[i]); 104 AddBookmarksToIndex(details.get(), extra_nodes[i].get());
105 UMA_HISTOGRAM_TIMES("Bookmarks.CreateBookmarkIndexTime", 105 UMA_HISTOGRAM_TIMES("Bookmarks.CreateBookmarkIndexTime",
106 TimeTicks::Now() - start_time); 106 TimeTicks::Now() - start_time);
107 } 107 }
108 108
109 task_runner->PostTask(FROM_HERE, 109 task_runner->PostTask(FROM_HERE,
110 base::Bind(&BookmarkStorage::OnLoadFinished, storage, 110 base::Bind(&BookmarkStorage::OnLoadFinished, storage,
111 base::Passed(&details))); 111 base::Passed(&details)));
112 } 112 }
113 113
114 } // namespace 114 } // namespace
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 225 }
226 226
227 std::unique_ptr<std::string> data(new std::string); 227 std::unique_ptr<std::string> data(new std::string);
228 if (!SerializeData(data.get())) 228 if (!SerializeData(data.get()))
229 return false; 229 return false;
230 writer_.WriteNow(std::move(data)); 230 writer_.WriteNow(std::move(data));
231 return true; 231 return true;
232 } 232 }
233 233
234 } // namespace bookmarks 234 } // namespace bookmarks
OLDNEW
« no previous file with comments | « components/bookmarks/browser/bookmark_storage.h ('k') | components/bookmarks/browser/bookmark_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698