Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: Source/bindings/v8/V8LazyEventListener.cpp

Issue 33523002: Have Frame::script() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/V8Initializer.cpp ('k') | Source/bindings/v8/V8WindowShell.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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 if (!context) 89 if (!context)
90 return v8::Local<v8::Value>(); 90 return v8::Local<v8::Value>();
91 91
92 if (!context->isDocument()) 92 if (!context->isDocument())
93 return v8::Local<v8::Value>(); 93 return v8::Local<v8::Value>();
94 94
95 Frame* frame = toDocument(context)->frame(); 95 Frame* frame = toDocument(context)->frame();
96 if (!frame) 96 if (!frame)
97 return v8::Local<v8::Value>(); 97 return v8::Local<v8::Value>();
98 98
99 if (!frame->script()->canExecuteScripts(AboutToExecuteScript)) 99 if (!frame->script().canExecuteScripts(AboutToExecuteScript))
100 return v8::Local<v8::Value>(); 100 return v8::Local<v8::Value>();
101 101
102 v8::Handle<v8::Value> parameters[1] = { jsEvent }; 102 v8::Handle<v8::Value> parameters[1] = { jsEvent };
103 return frame->script()->callFunction(handlerFunction, receiver, WTF_ARRAY_LE NGTH(parameters), parameters); 103 return frame->script().callFunction(handlerFunction, receiver, WTF_ARRAY_LEN GTH(parameters), parameters);
104 } 104 }
105 105
106 static void V8LazyEventListenerToString(const v8::FunctionCallbackInfo<v8::Value >& args) 106 static void V8LazyEventListenerToString(const v8::FunctionCallbackInfo<v8::Value >& args)
107 { 107 {
108 v8SetReturnValue(args, args.Holder()->GetHiddenValue(V8HiddenPropertyName::t oStringString(args.GetIsolate()))); 108 v8SetReturnValue(args, args.Holder()->GetHiddenValue(V8HiddenPropertyName::t oStringString(args.GetIsolate())));
109 } 109 }
110 110
111 void V8LazyEventListener::prepareListenerObject(ExecutionContext* context) 111 void V8LazyEventListener::prepareListenerObject(ExecutionContext* context)
112 { 112 {
113 if (context->isDocument() && !toDocument(context)->allowInlineEventHandlers( m_node, this, m_sourceURL, m_position.m_line)) { 113 if (context->isDocument() && !toDocument(context)->allowInlineEventHandlers( m_node, this, m_sourceURL, m_position.m_line)) {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // // Since we only parse once, there's no need to keep data used for parsin g around anymore. 225 // // Since we only parse once, there's no need to keep data used for parsin g around anymore.
226 // m_functionName = String(); 226 // m_functionName = String();
227 // m_code = String(); 227 // m_code = String();
228 // m_eventParameterName = String(); 228 // m_eventParameterName = String();
229 // m_sourceURL = String(); 229 // m_sourceURL = String();
230 230
231 setListenerObject(wrappedFunction); 231 setListenerObject(wrappedFunction);
232 } 232 }
233 233
234 } // namespace WebCore 234 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8Initializer.cpp ('k') | Source/bindings/v8/V8WindowShell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698