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

Side by Side Diff: include/AdblockPlus/JsValue.h

Issue 10254076: API cleanup, get rid of JsObject and GetProperty() methods that don`t return JsValue (Closed)
Patch Set: Slightly better Filter/Subscription constructors Created April 26, 2013, 11:51 a.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 | « include/AdblockPlus/FilterEngine.h ('k') | shell/src/FiltersCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef ADBLOCKPLUS_JS_VALUE_H 1 #ifndef ADBLOCKPLUS_JS_VALUE_H
2 #define ADBLOCKPLUS_JS_VALUE_H 2 #define ADBLOCKPLUS_JS_VALUE_H
3 3
4 #include <string> 4 #include <string>
5 #include <vector> 5 #include <vector>
6 #include <v8.h> 6 #include <v8.h>
7 #include "tr1_memory.h" 7 #include "tr1_memory.h"
8 8
9 namespace AdblockPlus 9 namespace AdblockPlus
10 { 10 {
11 class JsValue; 11 class JsValue;
12 class JsEngine; 12 class JsEngine;
13 13
14 typedef std::tr1::shared_ptr<JsValue> JsValuePtr; 14 typedef std::tr1::shared_ptr<JsValue> JsValuePtr;
15 typedef std::vector<AdblockPlus::JsValuePtr> JsValueList; 15 typedef std::vector<AdblockPlus::JsValuePtr> JsValueList;
16 16
17 // Forward declaration to avoid including JsEngine.h 17 // Forward declaration to avoid including JsEngine.h
18 typedef std::tr1::shared_ptr<JsEngine> JsEnginePtr; 18 typedef std::tr1::shared_ptr<JsEngine> JsEnginePtr;
19 19
20 class JsValue 20 class JsValue
21 { 21 {
22 friend class JsEngine; 22 friend class JsEngine;
23 friend class JsObject;
24 public: 23 public:
24 JsValue(JsValuePtr value);
25 virtual ~JsValue(); 25 virtual ~JsValue();
26 26
27 bool IsUndefined() const; 27 bool IsUndefined() const;
28 bool IsNull() const; 28 bool IsNull() const;
29 bool IsString() const; 29 bool IsString() const;
30 bool IsNumber() const; 30 bool IsNumber() const;
31 bool IsBool() const; 31 bool IsBool() const;
32 bool IsObject() const; 32 bool IsObject() const;
33 bool IsArray() const; 33 bool IsArray() const;
34 bool IsFunction() const; 34 bool IsFunction() const;
(...skipping 21 matching lines...) Expand all
56 protected: 56 protected:
57 JsValue(JsEnginePtr jsEngine, v8::Handle<v8::Value> value); 57 JsValue(JsEnginePtr jsEngine, v8::Handle<v8::Value> value);
58 void SetProperty(const std::string& name, v8::Handle<v8::Value> val); 58 void SetProperty(const std::string& name, v8::Handle<v8::Value> val);
59 59
60 JsEnginePtr jsEngine; 60 JsEnginePtr jsEngine;
61 v8::Persistent<v8::Value> value; 61 v8::Persistent<v8::Value> value;
62 }; 62 };
63 } 63 }
64 64
65 #endif 65 #endif
OLDNEW
« no previous file with comments | « include/AdblockPlus/FilterEngine.h ('k') | shell/src/FiltersCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld