MCPcopy Create free account
hub / github.com/breach/thrust / CallLocalMethod

Method CallLocalMethod

src/api/thrust_session_binding.cc:142–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140
141
142void
143ThrustSessionBinding::CallLocalMethod(
144 const std::string& method,
145 scoped_ptr<base::DictionaryValue> args,
146 const API::MethodCallback& callback)
147{
148 std::string err = std::string("");
149 base::DictionaryValue* res = new base::DictionaryValue;
150
151 LOG(INFO) << "CALL " << method;
152 if(method.compare("visitedlink_add") == 0) {
153 std::string url = "";
154 args->GetString("url", &url);
155 session_->GetVisitedLinkStore()->Add(url);
156 }
157 else if(method.compare("visitedlink_clear") == 0) {
158 session_->GetVisitedLinkStore()->Clear();
159 }
160 else if(method.compare("proxy_set") == 0) {
161 std::string rules = "";
162 args->GetString("rules", &rules);
163 ThrustSessionProxyConfigService* proxy_config_service =
164 session_->GetProxyConfigService();
165 if(proxy_config_service != NULL) {
166 proxy_config_service->SetProxyRules(rules);
167 }
168 }
169 else if(method.compare("proxy_clear") == 0) {
170 ThrustSessionProxyConfigService* proxy_config_service =
171 session_->GetProxyConfigService();
172 if(proxy_config_service != NULL) {
173 proxy_config_service->ClearProxyRules();
174 }
175 }
176 else if(method.compare("is_off_the_record") == 0) {
177 res->SetBoolean("off_the_record", session_->IsOffTheRecord());
178 }
179 else {
180 err = "exo_session_binding:method_not_found";
181 }
182
183 callback.Run(err, scoped_ptr<base::DictionaryValue>(res).Pass());
184}
185
186void
187ThrustSessionBinding::CookiesLoadCallback(

Callers

nothing calls this directly

Calls 8

GetStringMethod · 0.80
GetVisitedLinkStoreMethod · 0.80
GetProxyConfigServiceMethod · 0.80
SetProxyRulesMethod · 0.80
ClearProxyRulesMethod · 0.80
IsOffTheRecordMethod · 0.80
AddMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected