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

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

Issue 29508569: Issue 5450 - don't expose std::shared_ptr<JsEngine> (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created Aug. 7, 2017, 8:39 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « shell/src/GcCommand.cpp ('k') | shell/src/PrefsCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 { 58 {
59 AdblockPlus::AppInfo appInfo; 59 AdblockPlus::AppInfo appInfo;
60 appInfo.version = "1.0"; 60 appInfo.version = "1.0";
61 appInfo.name = "abpshell"; 61 appInfo.name = "abpshell";
62 appInfo.application = "standalone"; 62 appInfo.application = "standalone";
63 appInfo.applicationVersion = "1.0"; 63 appInfo.applicationVersion = "1.0";
64 appInfo.locale = "en-US"; 64 appInfo.locale = "en-US";
65 65
66 AdblockPlus::Platform platform; 66 AdblockPlus::Platform platform;
67 platform.SetUpJsEngine(appInfo); 67 platform.SetUpJsEngine(appInfo);
68 AdblockPlus::JsEnginePtr jsEngine = platform.GetJsEngine(); 68 AdblockPlus::JsEngine& jsEngine = platform.GetJsEngine();
69 auto filterEngine = platform.GetFilterEngine(); 69 auto filterEngine = platform.GetFilterEngine();
70 70
71 CommandMap commands; 71 CommandMap commands;
72 Add(commands, new GcCommand(jsEngine)); 72 Add(commands, new GcCommand(jsEngine));
73 Add(commands, new HelpCommand(commands)); 73 Add(commands, new HelpCommand(commands));
74 Add(commands, new FiltersCommand(*filterEngine)); 74 Add(commands, new FiltersCommand(*filterEngine));
75 Add(commands, new SubscriptionsCommand(*filterEngine)); 75 Add(commands, new SubscriptionsCommand(*filterEngine));
76 Add(commands, new MatchesCommand(*filterEngine)); 76 Add(commands, new MatchesCommand(*filterEngine));
77 Add(commands, new PrefsCommand(*filterEngine)); 77 Add(commands, new PrefsCommand(*filterEngine));
78 78
(...skipping 16 matching lines...) Expand all
95 std::cout << error.what() << std::endl; 95 std::cout << error.what() << std::endl;
96 } 96 }
97 } 97 }
98 } 98 }
99 catch (const std::exception& e) 99 catch (const std::exception& e)
100 { 100 {
101 std::cerr << "Exception: " << e.what() << std::endl; 101 std::cerr << "Exception: " << e.what() << std::endl;
102 } 102 }
103 return 0; 103 return 0;
104 } 104 }
OLDNEW
« no previous file with comments | « shell/src/GcCommand.cpp ('k') | shell/src/PrefsCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld