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

Delta Between Two Patch Sets: src/JsEngine.cpp

Issue 29691607: Issue 6365 - dispose v8::Isolate with a long enough delay (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Left Patch Set: Created Feb. 7, 2018, 2:26 p.m.
Right Patch Set: fix coding style Created Feb. 7, 2018, 2:54 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 | « no previous file | no next file » | 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 AdblockPlus::ScopedV8Isolate::ScopedV8Isolate() 80 AdblockPlus::ScopedV8Isolate::ScopedV8Isolate()
81 { 81 {
82 V8Initializer::Init(); 82 V8Initializer::Init();
83 isolate = v8::Isolate::New(); 83 isolate = v8::Isolate::New();
84 } 84 }
85 85
86 AdblockPlus::ScopedV8Isolate::~ScopedV8Isolate() 86 AdblockPlus::ScopedV8Isolate::~ScopedV8Isolate()
87 { 87 {
88 auto capturedIsolatePtr = isolate; 88 auto capturedIsolatePtr = isolate;
89 std::thread([capturedIsolatePtr]{ 89 std::thread([capturedIsolatePtr]
anton 2018/02/07 14:43:12 shouldn't `{`it be on the next line?
sergei 2018/02/07 14:54:20 Done.
90 {
90 std::chrono::seconds timeout(60 * 10); 91 std::chrono::seconds timeout(60 * 10);
91 std::this_thread::sleep_for(timeout); 92 std::this_thread::sleep_for(timeout);
92 capturedIsolatePtr->Dispose(); 93 capturedIsolatePtr->Dispose();
93 }).detach(); 94 }).detach();
94 isolate = nullptr; 95 isolate = nullptr;
95 } 96 }
96 97
97 JsEngine::JsWeakValuesList::~JsWeakValuesList() 98 JsEngine::JsWeakValuesList::~JsWeakValuesList()
98 { 99 {
99 for (auto& value : values) 100 for (auto& value : values)
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 logSystem = val; 345 logSystem = val;
345 } 346 }
346 347
347 348
348 void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name, 349 void AdblockPlus::JsEngine::SetGlobalProperty(const std::string& name,
349 const AdblockPlus::JsValue& value) 350 const AdblockPlus::JsValue& value)
350 { 351 {
351 auto global = GetGlobalObject(); 352 auto global = GetGlobalObject();
352 global.SetProperty(name, value); 353 global.SetProperty(name, value);
353 } 354 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld