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

Delta Between Two Patch Sets: src/JsValue.cpp

Issue 29449592: Issue 5183 - Provide async interface for FileSystem (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Left Patch Set: Rebased on https://codereview.adblockplus.org/29481704 Created July 6, 2017, 10:40 p.m.
Right Patch Set: Rebase on master. Last changes. Created July 7, 2017, 1:36 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/JsEngine.cpp ('k') | src/Thread.h » ('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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 { 202 {
203 return v8::Local<v8::Value>::New(jsEngine->GetIsolate(), *value); 203 return v8::Local<v8::Value>::New(jsEngine->GetIsolate(), *value);
204 } 204 }
205 205
206 void AdblockPlus::JsValue::SetProperty(const std::string& name, const std::strin g& val) 206 void AdblockPlus::JsValue::SetProperty(const std::string& name, const std::strin g& val)
207 { 207 {
208 const JsContext context(*jsEngine); 208 const JsContext context(*jsEngine);
209 SetProperty(name, Utils::ToV8String(jsEngine->GetIsolate(), val)); 209 SetProperty(name, Utils::ToV8String(jsEngine->GetIsolate(), val));
210 } 210 }
211 211
212 void AdblockPlus::JsValue::SetProperty(const std::string& name, const StringBuff er& val) 212 void AdblockPlus::JsValue::SetStringBufferProperty(const std::string& name, cons t StringBuffer& val)
213 { 213 {
214 const JsContext context(*jsEngine); 214 const JsContext context(*jsEngine);
215 SetProperty(name, Utils::StringBufferToV8String(jsEngine->GetIsolate(), val)); 215 SetProperty(name, Utils::StringBufferToV8String(jsEngine->GetIsolate(), val));
216 } 216 }
217 217
218 void AdblockPlus::JsValue::SetProperty(const std::string& name, int64_t val) 218 void AdblockPlus::JsValue::SetProperty(const std::string& name, int64_t val)
219 { 219 {
220 const JsContext context(*jsEngine); 220 const JsContext context(*jsEngine);
221 SetProperty(name, v8::Number::New(jsEngine->GetIsolate(), val)); 221 SetProperty(name, v8::Number::New(jsEngine->GetIsolate(), val));
222 } 222 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 const v8::TryCatch tryCatch; 287 const v8::TryCatch tryCatch;
288 v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(UnwrapValue()); 288 v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(UnwrapValue());
289 v8::Local<v8::Value> result = func->Call(thisObj, args.size(), 289 v8::Local<v8::Value> result = func->Call(thisObj, args.size(),
290 args.size() ? &args[0] : nullptr); 290 args.size() ? &args[0] : nullptr);
291 291
292 if (tryCatch.HasCaught()) 292 if (tryCatch.HasCaught())
293 throw JsError(tryCatch.Exception(), tryCatch.Message()); 293 throw JsError(tryCatch.Exception(), tryCatch.Message());
294 294
295 return JsValue(jsEngine, result); 295 return JsValue(jsEngine, result);
296 } 296 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld