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

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

Issue 24119002: Fix r157217, committed patch set didn't contain the latest review modifications. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | « no previous file | Source/bindings/v8/ScriptState.cpp » ('j') | Source/bindings/v8/V8Binding.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 if (function.IsEmpty()) 118 if (function.IsEmpty())
119 return ScriptValue(); 119 return ScriptValue();
120 return ScriptValue(function); 120 return ScriptValue(function);
121 } 121 }
122 122
123 ScriptState* eventListenerHandlerScriptState(Frame* frame, EventListener* listen er) 123 ScriptState* eventListenerHandlerScriptState(Frame* frame, EventListener* listen er)
124 { 124 {
125 if (listener->type() != EventListener::JSEventListenerType) 125 if (listener->type() != EventListener::JSEventListenerType)
126 return 0; 126 return 0;
127 V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>( listener); 127 V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>( listener);
128 v8::HandleScope scope(frame->script()->isolate()); 128 v8::HandleScope scope(getIsolateFromFrame(frame));
129 v8::Handle<v8::Context> v8Context = frame->script()->windowShell(v8Listener- >world())->context(); 129 v8::Handle<v8::Context> v8Context = frame->script()->windowShell(v8Listener- >world())->context();
130 return ScriptState::forContext(v8Context); 130 return ScriptState::forContext(v8Context);
131 } 131 }
132 132
133 bool eventListenerHandlerLocation(Document* document, EventListener* listener, S tring& sourceName, String& scriptId, int& lineNumber) 133 bool eventListenerHandlerLocation(Document* document, EventListener* listener, S tring& sourceName, String& scriptId, int& lineNumber)
134 { 134 {
135 if (listener->type() != EventListener::JSEventListenerType) 135 if (listener->type() != EventListener::JSEventListenerType)
136 return false; 136 return false;
137 137
138 v8::HandleScope scope(getIsolateFromScriptExecutionContext(document)); 138 v8::HandleScope scope(getIsolateFromScriptExecutionContext(document));
(...skipping 10 matching lines...) Expand all
149 v8::ScriptOrigin origin = function->GetScriptOrigin(); 149 v8::ScriptOrigin origin = function->GetScriptOrigin();
150 if (origin.ResourceName()->IsString() && !origin.ResourceName().IsEmpty()) 150 if (origin.ResourceName()->IsString() && !origin.ResourceName().IsEmpty())
151 sourceName = toWebCoreString(origin.ResourceName()); 151 sourceName = toWebCoreString(origin.ResourceName());
152 else 152 else
153 sourceName = ""; 153 sourceName = "";
154 lineNumber = function->GetScriptLineNumber(); 154 lineNumber = function->GetScriptLineNumber();
155 return true; 155 return true;
156 } 156 }
157 157
158 } // namespace WebCore 158 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/v8/ScriptState.cpp » ('j') | Source/bindings/v8/V8Binding.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698