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

Side by Side Diff: chrome/browser/android/history_report/get_all_urls_from_history_task.cc

Issue 1141283003: Upstream oodles of Chrome for Android code into Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final patch? Created 5 years, 7 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/android/history_report/get_all_urls_from_history_task.h "
6
7 #include "base/bind.h"
8 #include "components/history/core/browser/history_backend.h"
9 #include "components/history/core/browser/history_database.h"
10 #include "components/history/core/browser/history_types.h"
11 #include "components/history/core/browser/url_database.h"
12 #include "components/history/core/browser/url_row.h"
13 #include "content/public/browser/browser_thread.h"
14
15 namespace history_report {
16
17 GetAllUrlsFromHistoryTask::GetAllUrlsFromHistoryTask(
18 base::WaitableEvent* wait_event,
19 std::vector<std::string>* urls)
20 : urls_(urls),
21 wait_event_(wait_event) {
22 }
23
24 bool GetAllUrlsFromHistoryTask::RunOnDBThread(
25 history::HistoryBackend* backend,
26 history::HistoryDatabase* db) {
27
28 history::URLDatabase::URLEnumerator it;
29 db->InitURLEnumeratorForEverything(&it);
30
31 history::URLRow row;
32 while (it.GetNextURL(&row)) {
33 if (row.url().is_valid()) {
34 urls_->push_back(row.url().spec());
35 }
36 }
37
38 wait_event_->Signal();
39 return true;
40 }
41
42 } // namespace history_report
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698