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

Side by Side Diff: src/WebRequestJsObject.cpp

Issue 29393589: Issue 5013 - Make more methods const.- introduced JsConstValuePtr and JsConstValueList- JsValue:… (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created March 23, 2017, 6:12 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 /* 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 resultObject->SetProperty("responseText", result.responseText); 77 resultObject->SetProperty("responseText", result.responseText);
78 78
79 AdblockPlus::JsValuePtr headersObject = jsEngine->NewObject(); 79 AdblockPlus::JsValuePtr headersObject = jsEngine->NewObject();
80 for (AdblockPlus::HeaderList::iterator it = result.responseHeaders.begin() ; 80 for (AdblockPlus::HeaderList::iterator it = result.responseHeaders.begin() ;
81 it != result.responseHeaders.end(); ++it) 81 it != result.responseHeaders.end(); ++it)
82 { 82 {
83 headersObject->SetProperty(it->first, it->second); 83 headersObject->SetProperty(it->first, it->second);
84 } 84 }
85 resultObject->SetProperty("responseHeaders", headersObject); 85 resultObject->SetProperty("responseHeaders", headersObject);
86 86
87 AdblockPlus::JsValueList params; 87 AdblockPlus::JsConstValueList params;
88 params.push_back(resultObject); 88 params.push_back(resultObject);
89 callback->Call(params); 89 callback->Call(params);
90 } 90 }
91 91
92 private: 92 private:
93 AdblockPlus::JsEnginePtr jsEngine; 93 AdblockPlus::JsEnginePtr jsEngine;
94 std::string url; 94 std::string url;
95 AdblockPlus::HeaderList headers; 95 AdblockPlus::HeaderList headers;
96 AdblockPlus::JsValuePtr callback; 96 AdblockPlus::JsValuePtr callback;
97 }; 97 };
(...skipping 19 matching lines...) Expand all
117 return v8::Undefined(); 117 return v8::Undefined();
118 } 118 }
119 } 119 }
120 120
121 AdblockPlus::JsValuePtr AdblockPlus::WebRequestJsObject::Setup( 121 AdblockPlus::JsValuePtr AdblockPlus::WebRequestJsObject::Setup(
122 AdblockPlus::JsEnginePtr jsEngine, AdblockPlus::JsValuePtr obj) 122 AdblockPlus::JsEnginePtr jsEngine, AdblockPlus::JsValuePtr obj)
123 { 123 {
124 obj->SetProperty("GET", jsEngine->NewCallback(::GETCallback)); 124 obj->SetProperty("GET", jsEngine->NewCallback(::GETCallback));
125 return obj; 125 return obj;
126 } 126 }
OLDNEW
« src/FilterEngine.cpp ('K') | « src/JsValue.cpp ('k') | test/JsValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld