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

Side by Side Diff: src/JsEngineInternal.h

Issue 29369479: Issue #4694 - Add mutex protection to JS event handling
Patch Set: Created Dec. 21, 2016, 7:35 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
« src/Event.cpp ('K') | « src/JsEngine.cpp ('k') | no next file » | 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 #if !defined(ADBLOCK_PLUS_JS_ENGINE_INTERNAL_H) 2 #if !defined(ADBLOCK_PLUS_JS_ENGINE_INTERNAL_H)
3 #define ADBLOCK_PLUS_JS_ENGINE_INTERNAL_H 3 #define ADBLOCK_PLUS_JS_ENGINE_INTERNAL_H
4 4
5 #include <AdblockPlus/JsEngine.h> 5 #include <AdblockPlus/JsEngine.h>
6 #include <v8.h> 6 #include <v8.h>
7 #include <array> 7 #include <array>
8 #include "AllocatedArray.h" 8 #include "AllocatedArray.h"
9 #include "Event.h"
9 #include "V8Upgrade.h" 10 #include "V8Upgrade.h"
10 11
11 class PersistentValueArray 12 class PersistentValueArray
12 : public AllocatedArray<V8PersistentNG<v8::Value>> 13 : public AllocatedArray<V8PersistentNG<v8::Value>>
13 { 14 {
14 typedef AllocatedArray<V8PersistentNG<v8::Value>> Base; 15 typedef AllocatedArray<V8PersistentNG<v8::Value>> Base;
15 /** 16 /**
16 * Copy constructor deleted. Allocation is unique to single object. 17 * Copy constructor deleted. Allocation is unique to single object.
17 */ 18 */
18 PersistentValueArray(const PersistentValueArray&); // = delete; 19 PersistentValueArray(const PersistentValueArray&); // = delete;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 61 }
61 }; 62 };
62 63
63 /** 64 /**
64 * \par Implementation Notes 65 * \par Implementation Notes
65 */ 66 */
66 class JsEngineInternal 67 class JsEngineInternal
67 : public AdblockPlus::JsEngine 68 : public AdblockPlus::JsEngine
68 { 69 {
69 /** 70 /**
71 * Allows implementations of public API functions to access internal members.
72 */
73 friend class AdblockPlus::JsEngine;
74
75 /**
70 * Unique context associated with this isolate. 76 * Unique context associated with this isolate.
71 */ 77 */
72 v8::Persistent<v8::Context> context; 78 v8::Persistent<v8::Context> context;
73 79
80 /**
81 * Event manager provides implementation of event set, remove, and trigger.
82 */
83 EventManager eventMan;
sergei 2017/03/15 12:17:21 what about "ager"?
84
74 public: 85 public:
75 JsEngineInternal(const AdblockPlus::ScopedV8IsolatePtr& isolate); 86 JsEngineInternal(const AdblockPlus::ScopedV8IsolatePtr& isolate);
76 87
77 /** 88 /**
78 * Retrieve our persistent v8 context as a local handle. 89 * Retrieve our persistent v8 context as a local handle.
79 */ 90 */
80 v8::Local<v8::Context> GetContextAsLocal() const; 91 v8::Local<v8::Context> GetContextAsLocal() const;
81 92
82 /** 93 /**
83 * Retrieve the global object of our context. 94 * Retrieve the global object of our context.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 */ 173 */
163 const v8::HandleScope handleScope; 174 const v8::HandleScope handleScope;
164 const v8::Context::Scope contextScope; 175 const v8::Context::Scope contextScope;
165 public: 176 public:
166 V8ExecutionScope(JsEngineInternal* engine); 177 V8ExecutionScope(JsEngineInternal* engine);
167 }; 178 };
168 179
169 180
170 181
171 #endif 182 #endif
OLDNEW
« src/Event.cpp ('K') | « src/JsEngine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld