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

Delta Between Two Patch Sets: src/JsEngine.cpp

Issue 6584950149087232: Issue 1280 - Update v8 (Closed)
Left Patch Set: get rid of auto and fix friends of JsValue Created Oct. 31, 2014, 5:06 p.m.
Right Patch Set: revert not critical chanegs in JsValue ctr Created Nov. 3, 2014, 2:49 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/JsContext.cpp ('k') | src/JsValue.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 <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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 AdblockPlus::JsEnginePtr AdblockPlus::JsEngine::New(const AppInfo& appInfo) 51 AdblockPlus::JsEnginePtr AdblockPlus::JsEngine::New(const AppInfo& appInfo)
52 { 52 {
53 JsEnginePtr result(new JsEngine()); 53 JsEnginePtr result(new JsEngine());
54 54
55 const v8::Locker locker(result->isolate); 55 const v8::Locker locker(result->isolate);
56 const v8::HandleScope handleScope; 56 const v8::HandleScope handleScope;
57 57
58 result->context.reset(result->isolate, v8::Context::New(result->isolate)); 58 result->context.reset(result->isolate, v8::Context::New(result->isolate));
59 v8::Local<v8::Object> globalContext = v8::Local<v8::Context>::New(
60 result->isolate, result->context)->Global();
59 AdblockPlus::GlobalJsObject::Setup(result, appInfo, 61 AdblockPlus::GlobalJsObject::Setup(result, appInfo,
60 JsValuePtr(new JsValue(result, v8::Local<v8::Context>::New(result->isolate , result->context)->Global()))); 62 JsValuePtr(new JsValue(result, globalContext)));
61 return result; 63 return result;
62 } 64 }
63 65
64 AdblockPlus::JsValuePtr AdblockPlus::JsEngine::Evaluate(const std::string& sourc e, 66 AdblockPlus::JsValuePtr AdblockPlus::JsEngine::Evaluate(const std::string& sourc e,
65 const std::string& filename) 67 const std::string& filename)
66 { 68 {
67 const JsContext context(shared_from_this()); 69 const JsContext context(shared_from_this());
68 const v8::TryCatch tryCatch; 70 const v8::TryCatch tryCatch;
69 const v8::Handle<v8::Script> script = CompileScript(source, filename); 71 const v8::Handle<v8::Script> script = CompileScript(source, filename);
70 CheckTryCatch(tryCatch); 72 CheckTryCatch(tryCatch);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return logSystem; 195 return logSystem;
194 } 196 }
195 197
196 void AdblockPlus::JsEngine::SetLogSystem(AdblockPlus::LogSystemPtr val) 198 void AdblockPlus::JsEngine::SetLogSystem(AdblockPlus::LogSystemPtr val)
197 { 199 {
198 if (!val) 200 if (!val)
199 throw std::runtime_error("LogSystem cannot be null"); 201 throw std::runtime_error("LogSystem cannot be null");
200 202
201 logSystem = val; 203 logSystem = val;
202 } 204 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld