Fix recursive calling of handle().
This commit is contained in:
		
					parent
					
						
							
								409a431892
							
						
					
				
			
			
				commit
				
					
						d53915c6ab
					
				
			
		
					 2 changed files with 6 additions and 11 deletions
				
			
		|  | @ -29,11 +29,6 @@ class EventEmitter : public node::ObjectWrap { | ||||||
|   bool Emit(const std::string& name); |   bool Emit(const std::string& name); | ||||||
|   bool Emit(const std::string& name, base::ListValue* args); |   bool Emit(const std::string& name, base::ListValue* args); | ||||||
| 
 | 
 | ||||||
|   // The handle() of ObjectWrap doesn't provide the const version.
 |  | ||||||
|   inline v8::Local<v8::Object> handle() const { |  | ||||||
|     return const_cast<EventEmitter*>(this)->handle(); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|  protected: |  protected: | ||||||
|   explicit EventEmitter(v8::Handle<v8::Object> wrapper); |   explicit EventEmitter(v8::Handle<v8::Object> wrapper); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -54,7 +54,7 @@ Menu::~Menu() { | ||||||
| bool Menu::IsCommandIdChecked(int command_id) const { | bool Menu::IsCommandIdChecked(int command_id) const { | ||||||
|   v8::HandleScope handle_scope(node_isolate); |   v8::HandleScope handle_scope(node_isolate); | ||||||
|   return CallDelegate(v8::False(), |   return CallDelegate(v8::False(), | ||||||
|                       handle(), |                       const_cast<Menu*>(this)->handle(), | ||||||
|                       "isCommandIdChecked", |                       "isCommandIdChecked", | ||||||
|                       command_id)->BooleanValue(); |                       command_id)->BooleanValue(); | ||||||
| } | } | ||||||
|  | @ -62,7 +62,7 @@ bool Menu::IsCommandIdChecked(int command_id) const { | ||||||
| bool Menu::IsCommandIdEnabled(int command_id) const { | bool Menu::IsCommandIdEnabled(int command_id) const { | ||||||
|   v8::HandleScope handle_scope(node_isolate); |   v8::HandleScope handle_scope(node_isolate); | ||||||
|   return CallDelegate(v8::True(), |   return CallDelegate(v8::True(), | ||||||
|                       handle(), |                       const_cast<Menu*>(this)->handle(), | ||||||
|                       "isCommandIdEnabled", |                       "isCommandIdEnabled", | ||||||
|                       command_id)->BooleanValue(); |                       command_id)->BooleanValue(); | ||||||
| } | } | ||||||
|  | @ -70,7 +70,7 @@ bool Menu::IsCommandIdEnabled(int command_id) const { | ||||||
| bool Menu::IsCommandIdVisible(int command_id) const { | bool Menu::IsCommandIdVisible(int command_id) const { | ||||||
|   v8::HandleScope handle_scope(node_isolate); |   v8::HandleScope handle_scope(node_isolate); | ||||||
|   return CallDelegate(v8::True(), |   return CallDelegate(v8::True(), | ||||||
|                       handle(), |                       const_cast<Menu*>(this)->handle(), | ||||||
|                       "isCommandIdVisible", |                       "isCommandIdVisible", | ||||||
|                       command_id)->BooleanValue(); |                       command_id)->BooleanValue(); | ||||||
| } | } | ||||||
|  | @ -93,7 +93,7 @@ bool Menu::GetAcceleratorForCommandId(int command_id, | ||||||
| bool Menu::IsItemForCommandIdDynamic(int command_id) const { | bool Menu::IsItemForCommandIdDynamic(int command_id) const { | ||||||
|   v8::HandleScope handle_scope(node_isolate); |   v8::HandleScope handle_scope(node_isolate); | ||||||
|   return CallDelegate(v8::False(), |   return CallDelegate(v8::False(), | ||||||
|                       handle(), |                       const_cast<Menu*>(this)->handle(), | ||||||
|                       "isItemForCommandIdDynamic", |                       "isItemForCommandIdDynamic", | ||||||
|                       command_id)->BooleanValue(); |                       command_id)->BooleanValue(); | ||||||
| } | } | ||||||
|  | @ -101,7 +101,7 @@ bool Menu::IsItemForCommandIdDynamic(int command_id) const { | ||||||
| string16 Menu::GetLabelForCommandId(int command_id) const { | string16 Menu::GetLabelForCommandId(int command_id) const { | ||||||
|   v8::HandleScope handle_scope(node_isolate); |   v8::HandleScope handle_scope(node_isolate); | ||||||
|   return FromV8Value(CallDelegate(v8::False(), |   return FromV8Value(CallDelegate(v8::False(), | ||||||
|                                   handle(), |                                   const_cast<Menu*>(this)->handle(), | ||||||
|                                   "getLabelForCommandId", |                                   "getLabelForCommandId", | ||||||
|                                   command_id)); |                                   command_id)); | ||||||
| } | } | ||||||
|  | @ -109,7 +109,7 @@ string16 Menu::GetLabelForCommandId(int command_id) const { | ||||||
| string16 Menu::GetSublabelForCommandId(int command_id) const { | string16 Menu::GetSublabelForCommandId(int command_id) const { | ||||||
|   v8::HandleScope handle_scope(node_isolate); |   v8::HandleScope handle_scope(node_isolate); | ||||||
|   return FromV8Value(CallDelegate(v8::False(), |   return FromV8Value(CallDelegate(v8::False(), | ||||||
|                                   handle(), |                                   const_cast<Menu*>(this)->handle(), | ||||||
|                                   "getSubLabelForCommandId", |                                   "getSubLabelForCommandId", | ||||||
|                                   command_id)); |                                   command_id)); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Cheng Zhao
				Cheng Zhao