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

Delta Between Two Patch Sets: include/AdblockPlus/JsValue.h

Issue 6584950149087232: Issue 1280 - Update v8 (Closed)
Left Patch Set: Created Oct. 24, 2014, 12:42 p.m.
Right Patch Set: revert not critical chanegs in JsValue ctr Created Nov. 3, 2014, 2:49 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 | « createsolution.bat ('k') | include/AdblockPlus/V8ValueHolder.h » ('j') | 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 <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 * List of JavaScript values. 47 * List of JavaScript values.
48 */ 48 */
49 typedef std::vector<AdblockPlus::JsValuePtr> JsValueList; 49 typedef std::vector<AdblockPlus::JsValuePtr> JsValueList;
50 50
51 /** 51 /**
52 * Wrapper for JavaScript values. 52 * Wrapper for JavaScript values.
53 * See `JsEngine` for creating `JsValue` objects. 53 * See `JsEngine` for creating `JsValue` objects.
54 */ 54 */
55 class JsValue 55 class JsValue
56 { 56 {
57 friend class JsEngine;
57 public: 58 public:
58 struct Private
59 {
60 private:
61 // allow access to the ctr only JsEngine and don't allow JsEngine to acces s other members.
62 friend class JsEngine;
63 friend class JsValue;
64 struct CtrArg
65 {
66 };
67 };
68 protected:
69 typedef Private::CtrArg PrivateCtrArg;
70 JsValue(const JsValuePtr& value);
71 public:
72 JsValue(const JsEnginePtr& jsEngine, const v8::Handle<v8::Value> value, Priv ateCtrArg);
73 virtual ~JsValue(); 59 virtual ~JsValue();
74 60
75 bool IsUndefined() const; 61 bool IsUndefined() const;
76 bool IsNull() const; 62 bool IsNull() const;
77 bool IsString() const; 63 bool IsString() const;
78 bool IsNumber() const; 64 bool IsNumber() const;
79 bool IsBool() const; 65 bool IsBool() const;
80 bool IsObject() const; 66 bool IsObject() const;
81 bool IsArray() const; 67 bool IsArray() const;
82 bool IsFunction() const; 68 bool IsFunction() const;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 116
131 /** 117 /**
132 * Invokes the value as a function (see `IsFunction()`). 118 * Invokes the value as a function (see `IsFunction()`).
133 * @param params Optional list of parameters. 119 * @param params Optional list of parameters.
134 * @param thisPtr Optional `this` value. 120 * @param thisPtr Optional `this` value.
135 * @return Value returned by the function. 121 * @return Value returned by the function.
136 */ 122 */
137 JsValuePtr Call(const JsValueList& params = JsValueList(), 123 JsValuePtr Call(const JsValueList& params = JsValueList(),
138 AdblockPlus::JsValuePtr thisPtr = AdblockPlus::JsValuePtr()) const; 124 AdblockPlus::JsValuePtr thisPtr = AdblockPlus::JsValuePtr()) const;
139 125
140 v8::Local<v8::Value> unwrapValue() const; 126 v8::Local<v8::Value> UnwrapValue() const;
141 private:
142 void SetProperty(const std::string& name, const v8::Handle<v8::Value> val);
143 protected: 127 protected:
128 JsValue(JsValuePtr value);
144 JsEnginePtr jsEngine; 129 JsEnginePtr jsEngine;
145 private: 130 private:
131 JsValue(JsEnginePtr jsEngine, v8::Handle<v8::Value> value);
132 void SetProperty(const std::string& name, v8::Handle<v8::Value> val);
146 V8ValueHolder<v8::Value> value; 133 V8ValueHolder<v8::Value> value;
147 }; 134 };
148 } 135 }
149 136
150 #endif 137 #endif
LEFTRIGHT

Powered by Google App Engine
This is Rietveld