Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: shell/src/Main.cpp

Issue 10198022: Pass application data into libadblockplus (Closed)
Patch Set: Merged upstream, addressed issues, renamed AppInfo fields Created April 17, 2013, 2:47 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include <AdblockPlus.h> 1 #include <AdblockPlus.h>
2 #include <iostream> 2 #include <iostream>
3 #include <sstream> 3 #include <sstream>
4 4
5 #include "GcCommand.h" 5 #include "GcCommand.h"
6 #include "HelpCommand.h" 6 #include "HelpCommand.h"
7 #include "FiltersCommand.h" 7 #include "FiltersCommand.h"
8 #include "SubscriptionsCommand.h" 8 #include "SubscriptionsCommand.h"
9 #include "MatchesCommand.h" 9 #include "MatchesCommand.h"
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 } 43 }
44 44
45 int main() 45 int main()
46 { 46 {
47 try 47 try
48 { 48 {
49 AdblockPlus::DefaultFileSystem fileSystem; 49 AdblockPlus::DefaultFileSystem fileSystem;
50 AdblockPlus::DefaultWebRequest webRequest; 50 AdblockPlus::DefaultWebRequest webRequest;
51 CerrErrorCallback errorCallback; 51 CerrErrorCallback errorCallback;
52 AdblockPlus::JsEngine jsEngine(&fileSystem, &webRequest, &errorCallback); 52 AdblockPlus::AppInfo appInfo;
53 appInfo.version = "1.0";
54 appInfo.name = "Adblock Plus Shell";
55 AdblockPlus::JsEngine jsEngine(appInfo, &fileSystem, &webRequest,
56 &errorCallback);
53 AdblockPlus::FilterEngine filterEngine(jsEngine); 57 AdblockPlus::FilterEngine filterEngine(jsEngine);
54 58
55 CommandMap commands; 59 CommandMap commands;
56 Add(commands, new GcCommand(jsEngine)); 60 Add(commands, new GcCommand(jsEngine));
57 Add(commands, new HelpCommand(commands)); 61 Add(commands, new HelpCommand(commands));
58 Add(commands, new FiltersCommand(filterEngine)); 62 Add(commands, new FiltersCommand(filterEngine));
59 Add(commands, new SubscriptionsCommand(filterEngine)); 63 Add(commands, new SubscriptionsCommand(filterEngine));
60 Add(commands, new MatchesCommand(filterEngine)); 64 Add(commands, new MatchesCommand(filterEngine));
61 65
62 std::string commandLine; 66 std::string commandLine;
(...skipping 15 matching lines...) Expand all
78 std::cout << error.what() << std::endl; 82 std::cout << error.what() << std::endl;
79 } 83 }
80 } 84 }
81 } 85 }
82 catch (const std::exception& e) 86 catch (const std::exception& e)
83 { 87 {
84 std::cerr << "Exception: " << e.what() << std::endl; 88 std::cerr << "Exception: " << e.what() << std::endl;
85 } 89 }
86 return 0; 90 return 0;
87 } 91 }
OLDNEW
« no previous file with comments | « libadblockplus.gyp ('k') | src/AppInfoJsObject.h » ('j') | src/AppInfoJsObject.cpp » ('J')

Powered by Google App Engine
This is Rietveld