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

Side by Side Diff: chrome/tools/pbl_tool/pbl_tool.cc

Issue 337025: Design changes in browser/privacy_blacklist needed to integrate (Closed)
Patch Set: fixes Created 11 years, 1 month 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 | « chrome/tools/pbl_tool/DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 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 // This tool manages privacy blacklists. Primarily for loading a text
6 // blacklist into the binary aggregate blacklist.
7 #include <iostream>
8
9 #include "base/process_util.h"
10 #include "base/string_util.h"
11 #include "chrome/browser/privacy_blacklist/blacklist.h"
12 #include "chrome/browser/privacy_blacklist/blacklist_io.h"
13
14 #ifdef OS_POSIX
15 #define ICHAR char
16 #define ICERR std::cerr
17 #define IMAIN main
18 #else
19 #define ICHAR wchar_t
20 #define ICERR std::wcerr
21 #define IMAIN wmain
22 #endif
23
24 namespace {
25
26 int PrintUsage(int argc, ICHAR* argv[]) {
27 ICERR << "Usage: " << argv[0] << " <source>... <target>\n"
28 " <source> are text blacklists (.pbl) to load.\n"
29 " <target> is the binary output blacklist repository.\n\n"
30 "Adds all entries from <source> to <target>.\n"
31 "Creates <target> if it does not exist.\n";
32 return 1;
33 }
34
35 }
36
37 int IMAIN(int argc, ICHAR* argv[]) {
38 base::EnableTerminationOnHeapCorruption();
39
40 if (argc < 3)
41 return PrintUsage(argc, argv);
42
43 BlacklistIO io;
44 for (int current = 1; current < argc-1; ++current) {
45 FilePath input(argv[current]);
46 if (!io.Read(input)) {
47 ICERR << "Error reading " << argv[current] << ":\n"
48 << io.last_error() << "\n";
49 return -1;
50 }
51 }
52
53 FilePath output(argv[argc-1]);
54 if (!io.Write(output))
55 ICERR << "Error writing " << argv[2] << ":\n" << io.last_error() << "\n";
56
57 return 0;
58 }
OLDNEW
« no previous file with comments | « chrome/tools/pbl_tool/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698