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

Side by Side Diff: src/Platform.cpp

Issue 29661564: Template out V8 and prepare for other JS engine implementations
Patch Set: Created Jan. 10, 2018, 1:29 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/JsValue.cpp ('k') | src/WebRequestJsObject.h » ('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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 void Platform::SetUpJsEngine(const AppInfo& appInfo, std::unique_ptr<IV8IsolateP rovider> isolate) 57 void Platform::SetUpJsEngine(const AppInfo& appInfo, std::unique_ptr<IV8IsolateP rovider> isolate)
58 { 58 {
59 std::lock_guard<std::mutex> lock(modulesMutex); 59 std::lock_guard<std::mutex> lock(modulesMutex);
60 if (jsEngine) 60 if (jsEngine)
61 return; 61 return;
62 jsEngine = JsEngine::New(appInfo, *this, std::move(isolate)); 62 jsEngine = JsEngine::New(appInfo, *this, std::move(isolate));
63 } 63 }
64 64
65 JsEngine& Platform::GetJsEngine() 65 JsEngineTemplate<JsEngineNamespaceImpl>& Platform::GetJsEngine()
66 { 66 {
67 SetUpJsEngine(); 67 SetUpJsEngine();
68 return *jsEngine; 68 return *jsEngine;
69 } 69 }
70 70
71 void Platform::CreateFilterEngineAsync(const FilterEngine::CreationParameters& p arameters, 71 void Platform::CreateFilterEngineAsync(const FilterEngine::CreationParameters& p arameters,
72 const OnFilterEngineCreatedCallback& onCreated) 72 const OnFilterEngineCreatedCallback& onCreated)
73 { 73 {
74 std::shared_ptr<std::promise<FilterEnginePtr>> filterEnginePromise; 74 std::shared_ptr<std::promise<FilterEnginePtr>> filterEnginePromise;
75 { 75 {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 CreateDefaultTimer(); 229 CreateDefaultTimer();
230 if (!fileSystem) 230 if (!fileSystem)
231 CreateDefaultFileSystem(); 231 CreateDefaultFileSystem();
232 if (!webRequest) 232 if (!webRequest)
233 CreateDefaultWebRequest(); 233 CreateDefaultWebRequest();
234 234
235 std::unique_ptr<Platform> platform(new DefaultPlatform(asyncExecutor, std::mov e(*this))); 235 std::unique_ptr<Platform> platform(new DefaultPlatform(asyncExecutor, std::mov e(*this)));
236 asyncExecutor.reset(); 236 asyncExecutor.reset();
237 return platform; 237 return platform;
238 } 238 }
OLDNEW
« no previous file with comments | « src/JsValue.cpp ('k') | src/WebRequestJsObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld