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

Delta Between Two Patch Sets: src/GlobalJsObject.cpp

Issue 29410664: Issue 5013 - Use const JsValue and pass reference where applicable (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Left Patch Set: Created April 12, 2017, 3:24 p.m.
Right Patch Set: Fixed comment Created April 13, 2017, 3:45 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/FilterEngine.cpp ('k') | src/JsEngine.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 std::string eventName = converted.front()->AsString(); 64 std::string eventName = converted.front()->AsString();
65 converted.erase(converted.begin()); 65 converted.erase(converted.begin());
66 jsEngine->TriggerEvent(eventName, converted); 66 jsEngine->TriggerEvent(eventName, converted);
67 return v8::Undefined(); 67 return v8::Undefined();
68 } 68 }
69 } 69 }
70 70
71 JsValuePtr GlobalJsObject::Setup(JsEngine& jsEngine, const AppInfo& appInfo, 71 JsValuePtr GlobalJsObject::Setup(JsEngine& jsEngine, const AppInfo& appInfo,
72 const JsValuePtr& obj) 72 const JsValuePtr& obj)
73 { 73 {
74 obj->SetProperty("setTimeout", *jsEngine.NewCallback(::SetTimeoutCallback)); 74 obj->SetProperty("setTimeout", jsEngine.NewCallback(::SetTimeoutCallback));
75 obj->SetProperty("_triggerEvent", *jsEngine.NewCallback(::TriggerEventCallback )); 75 obj->SetProperty("_triggerEvent", jsEngine.NewCallback(::TriggerEventCallback) );
76 obj->SetProperty("_fileSystem", 76 obj->SetProperty("_fileSystem",
77 FileSystemJsObject::Setup(jsEngine, *jsEngine.NewObject())); 77 FileSystemJsObject::Setup(jsEngine, jsEngine.NewObject()));
78 obj->SetProperty("_webRequest", 78 obj->SetProperty("_webRequest",
79 WebRequestJsObject::Setup(jsEngine, *jsEngine.NewObject())); 79 WebRequestJsObject::Setup(jsEngine, jsEngine.NewObject()));
80 obj->SetProperty("console", 80 obj->SetProperty("console",
81 ConsoleJsObject::Setup(jsEngine, *jsEngine.NewObject())); 81 ConsoleJsObject::Setup(jsEngine, jsEngine.NewObject()));
82 obj->SetProperty("_appInfo", 82 obj->SetProperty("_appInfo",
83 AppInfoJsObject::Setup(appInfo, *jsEngine.NewObject())); 83 AppInfoJsObject::Setup(appInfo, jsEngine.NewObject()));
84 return obj; 84 return obj;
85 } 85 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld