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

Side by Side Diff: src/FileSystemJsObject.cpp

Issue 6584950149087232: Issue 1280 - Update v8 (Closed)
Patch Set: Created Oct. 24, 2014, 12:42 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
« no previous file with comments | « src/DefaultWebRequestWinInet.cpp ('k') | src/JsContext.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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 { 335 {
336 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::FromArguments(arg uments); 336 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::FromArguments(arg uments);
337 AdblockPlus::JsValueList converted = jsEngine->ConvertArguments(arguments); 337 AdblockPlus::JsValueList converted = jsEngine->ConvertArguments(arguments);
338 338
339 if (converted.size() != 1) 339 if (converted.size() != 1)
340 return v8::ThrowException(v8::String::New( 340 return v8::ThrowException(v8::String::New(
341 "_fileSystem.resolve requires 1 parameter")); 341 "_fileSystem.resolve requires 1 parameter"));
342 342
343 std::string resolved = jsEngine->GetFileSystem()->Resolve(converted[0]->AsSt ring()); 343 std::string resolved = jsEngine->GetFileSystem()->Resolve(converted[0]->AsSt ring());
344 344
345 return Utils::ToV8String(resolved); 345 return Utils::ToV8String(arguments.GetIsolate(), resolved);
346 } 346 }
347 347
348 } 348 }
349 349
350 350
351 JsValuePtr FileSystemJsObject::Setup(JsEnginePtr jsEngine, JsValuePtr obj) 351 JsValuePtr FileSystemJsObject::Setup(JsEnginePtr jsEngine, JsValuePtr obj)
352 { 352 {
353 obj->SetProperty("read", jsEngine->NewCallback(::ReadCallback)); 353 obj->SetProperty("read", jsEngine->NewCallback(::ReadCallback));
354 obj->SetProperty("write", jsEngine->NewCallback(::WriteCallback)); 354 obj->SetProperty("write", jsEngine->NewCallback(::WriteCallback));
355 obj->SetProperty("move", jsEngine->NewCallback(::MoveCallback)); 355 obj->SetProperty("move", jsEngine->NewCallback(::MoveCallback));
356 obj->SetProperty("remove", jsEngine->NewCallback(::RemoveCallback)); 356 obj->SetProperty("remove", jsEngine->NewCallback(::RemoveCallback));
357 obj->SetProperty("stat", jsEngine->NewCallback(::StatCallback)); 357 obj->SetProperty("stat", jsEngine->NewCallback(::StatCallback));
358 obj->SetProperty("resolve", jsEngine->NewCallback(::ResolveCallback)); 358 obj->SetProperty("resolve", jsEngine->NewCallback(::ResolveCallback));
359 return obj; 359 return obj;
360 } 360 }
OLDNEW
« no previous file with comments | « src/DefaultWebRequestWinInet.cpp ('k') | src/JsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld