@@ -31,7 +31,7 @@ namespace CefSharp.Internals
31
31
/// All of the registered objects are tracked via meta-data for the objects
32
32
/// expressed starting with the JavaScriptObject type.
33
33
/// </summary>
34
- public class JavascriptObjectRepository : FreezableBase , IJavascriptObjectRepository
34
+ public class JavascriptObjectRepository : FreezableBase , IJavascriptObjectRepositoryInternal
35
35
{
36
36
public const string AllObjects = "All" ;
37
37
public const string LegacyObjects = "Legacy" ;
@@ -47,7 +47,7 @@ public class JavascriptObjectRepository : FreezableBase, IJavascriptObjectReposi
47
47
/// this is done to speed up finding the object in O(1) time
48
48
/// instead of traversing the JavaScriptRootObject tree.
49
49
/// </summary>
50
- private readonly ConcurrentDictionary < long , JavascriptObject > objects = new ConcurrentDictionary < long , JavascriptObject > ( ) ;
50
+ protected readonly ConcurrentDictionary < long , JavascriptObject > objects = new ConcurrentDictionary < long , JavascriptObject > ( ) ;
51
51
52
52
/// <summary>
53
53
/// Javascript Name converter
@@ -103,7 +103,7 @@ public bool IsBound(string name)
103
103
return objects . Values . Any ( x => x . Name == name ) ;
104
104
}
105
105
106
- public List < JavascriptObject > GetLegacyBoundObjects ( )
106
+ List < JavascriptObject > IJavascriptObjectRepositoryInternal . GetLegacyBoundObjects ( )
107
107
{
108
108
RaiseResolveObjectEvent ( LegacyObjects ) ;
109
109
@@ -112,7 +112,7 @@ public List<JavascriptObject> GetLegacyBoundObjects()
112
112
113
113
//Ideally this would internal, unfurtunately it's used in C++
114
114
//and it's hard to expose internals
115
- public List < JavascriptObject > GetObjects ( List < string > names = null )
115
+ List < JavascriptObject > IJavascriptObjectRepositoryInternal . GetObjects ( List < string > names )
116
116
{
117
117
//If there are no objects names or the count is 0 then we will raise
118
118
//the resolve event then return all objects that are registered,
@@ -140,7 +140,7 @@ public List<JavascriptObject> GetObjects(List<string> names = null)
140
140
return objectsByName ;
141
141
}
142
142
143
- public void ObjectsBound ( List < Tuple < string , bool , bool > > objs )
143
+ void IJavascriptObjectRepositoryInternal . ObjectsBound ( List < Tuple < string , bool , bool > > objs )
144
144
{
145
145
var boundObjectHandler = ObjectBoundInJavascript ;
146
146
var boundObjectsHandler = ObjectsBoundInJavascript ;
@@ -255,7 +255,12 @@ public bool UnRegister(string name)
255
255
return false ;
256
256
}
257
257
258
- internal bool TryCallMethod ( long objectId , string name , object [ ] parameters , out object result , out string exception )
258
+ bool IJavascriptObjectRepositoryInternal . TryCallMethod ( long objectId , string name , object [ ] parameters , out object result , out string exception )
259
+ {
260
+ return TryCallMethod ( objectId , name , parameters , out result , out exception ) ;
261
+ }
262
+
263
+ protected virtual bool TryCallMethod ( long objectId , string name , object [ ] parameters , out object result , out string exception )
259
264
{
260
265
exception = "" ;
261
266
result = null ;
@@ -384,7 +389,12 @@ internal bool TryCallMethod(long objectId, string name, object[] parameters, out
384
389
return false ;
385
390
}
386
391
387
- internal bool TryGetProperty ( long objectId , string name , out object result , out string exception )
392
+ bool IJavascriptObjectRepositoryInternal . TryGetProperty ( long objectId , string name , out object result , out string exception )
393
+ {
394
+ return TryGetProperty ( objectId , name , out result , out exception ) ;
395
+ }
396
+
397
+ protected virtual bool TryGetProperty ( long objectId , string name , out object result , out string exception )
388
398
{
389
399
exception = "" ;
390
400
result = null ;
@@ -414,7 +424,12 @@ internal bool TryGetProperty(long objectId, string name, out object result, out
414
424
return false ;
415
425
}
416
426
417
- internal bool TrySetProperty ( long objectId , string name , object value , out string exception )
427
+ bool IJavascriptObjectRepositoryInternal . TrySetProperty ( long objectId , string name , object value , out string exception )
428
+ {
429
+ return TrySetProperty ( objectId , name , value , out exception ) ;
430
+ }
431
+
432
+ protected virtual bool TrySetProperty ( long objectId , string name , object value , out string exception )
418
433
{
419
434
exception = "" ;
420
435
JavascriptObject obj ;
0 commit comments