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

Delta Between Two Patch Sets: src/FileSystemJsObject.cpp

Issue 6193234183192576: Issue 1197 - change local copy of v8 (to 4.3.15) to work with Visual Studio 2013 (Closed)
Left Patch Set: Created June 11, 2015, 1:19 p.m.
Right Patch Set: rebase and update Created May 17, 2016, 3:18 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/ConsoleJsObject.cpp ('k') | src/GlobalJsObject.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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2016 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 : IoThread(jsEngine, callback), path(path) 54 : IoThread(jsEngine, callback), path(path)
55 { 55 {
56 } 56 }
57 57
58 void Run() 58 void Run()
59 { 59 {
60 std::string content; 60 std::string content;
61 std::string error; 61 std::string error;
62 try 62 try
63 { 63 {
64 std::tr1::shared_ptr<std::istream> stream = fileSystem->Read(path); 64 std::shared_ptr<std::istream> stream = fileSystem->Read(path);
65 content = Utils::Slurp(*stream); 65 content = Utils::Slurp(*stream);
66 } 66 }
67 catch (std::exception& e) 67 catch (std::exception& e)
68 { 68 {
69 error = e.what(); 69 error = e.what();
70 } 70 }
71 catch (...) 71 catch (...)
72 { 72 {
73 error = "Unknown error while reading from " + path; 73 error = "Unknown error while reading from " + path;
74 } 74 }
(...skipping 19 matching lines...) Expand all
94 const std::string& path, const std::string& content) 94 const std::string& path, const std::string& content)
95 : IoThread(jsEngine, callback), path(path), content(content) 95 : IoThread(jsEngine, callback), path(path), content(content)
96 { 96 {
97 } 97 }
98 98
99 void Run() 99 void Run()
100 { 100 {
101 std::string error; 101 std::string error;
102 try 102 try
103 { 103 {
104 std::tr1::shared_ptr<std::iostream> stream(new std::stringstream); 104 std::shared_ptr<std::iostream> stream(new std::stringstream);
105 *stream << content; 105 *stream << content;
106 fileSystem->Write(path, stream); 106 fileSystem->Write(path, stream);
107 } 107 }
108 catch (std::exception& e) 108 catch (std::exception& e)
109 { 109 {
110 error = e.what(); 110 error = e.what();
111 } 111 }
112 catch (...) 112 catch (...)
113 { 113 {
114 error = "Unknown error while writing to " + path; 114 error = "Unknown error while writing to " + path;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 JsValuePtr FileSystemJsObject::Setup(JsEnginePtr jsEngine, JsValuePtr obj) 340 JsValuePtr FileSystemJsObject::Setup(JsEnginePtr jsEngine, JsValuePtr obj)
341 { 341 {
342 obj->SetProperty("read", jsEngine->NewCallback(::ReadCallback)); 342 obj->SetProperty("read", jsEngine->NewCallback(::ReadCallback));
343 obj->SetProperty("write", jsEngine->NewCallback(::WriteCallback)); 343 obj->SetProperty("write", jsEngine->NewCallback(::WriteCallback));
344 obj->SetProperty("move", jsEngine->NewCallback(::MoveCallback)); 344 obj->SetProperty("move", jsEngine->NewCallback(::MoveCallback));
345 obj->SetProperty("remove", jsEngine->NewCallback(::RemoveCallback)); 345 obj->SetProperty("remove", jsEngine->NewCallback(::RemoveCallback));
346 obj->SetProperty("stat", jsEngine->NewCallback(::StatCallback)); 346 obj->SetProperty("stat", jsEngine->NewCallback(::StatCallback));
347 obj->SetProperty("resolve", jsEngine->NewCallback(::ResolveCallback)); 347 obj->SetProperty("resolve", jsEngine->NewCallback(::ResolveCallback));
348 return obj; 348 return obj;
349 } 349 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld