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

Side by Side Diff: webkit/port/bindings/v8/v8_custom.cpp

Issue 113085: Split V8Proxy::retrieveActiveFrame() into two methods. (Closed)
Patch Set: Darin feedback Created 11 years, 7 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
« no previous file with comments | « webkit/port/bindings/v8/ScriptController.cpp ('k') | webkit/port/bindings/v8/v8_proxy.h » ('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) 2000 Harri Porten (porten@kde.org) 2 * Copyright (C) 2000 Harri Porten (porten@kde.org)
3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
4 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 4 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
5 * Copyright (C) 2006 James G. Speth (speth@end.com) 5 * Copyright (C) 2006 James G. Speth (speth@end.com)
6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org)
7 * Copyright (C) 2007, 2008 Google Inc. All Rights Reserved. 7 * Copyright (C) 2007, 2008 Google Inc. All Rights Reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 ASSERT(key.startsWith("on")); 1076 ASSERT(key.startsWith("on"));
1077 String event_type = key.substring(2); 1077 String event_type = key.substring(2);
1078 1078
1079 // Set handler if the value is a function. Otherwise, clear the 1079 // Set handler if the value is a function. Otherwise, clear the
1080 // event handler. 1080 // event handler.
1081 if (value->IsFunction()) { 1081 if (value->IsFunction()) {
1082 V8Proxy* proxy = V8Proxy::retrieve(node->document()->frame()); 1082 V8Proxy* proxy = V8Proxy::retrieve(node->document()->frame());
1083 // the document might be created using createDocument, 1083 // the document might be created using createDocument,
1084 // which does not have a frame, use the active frame 1084 // which does not have a frame, use the active frame
1085 if (!proxy) 1085 if (!proxy)
1086 proxy = V8Proxy::retrieve(V8Proxy::retrieveActiveFrame()); 1086 proxy = V8Proxy::retrieve(V8Proxy::retrieveFrameForEnteredContext());
1087 if (!proxy) 1087 if (!proxy)
1088 return; 1088 return;
1089 1089
1090 RefPtr<EventListener> listener = 1090 RefPtr<EventListener> listener =
1091 proxy->FindOrCreateV8EventListener(value, true); 1091 proxy->FindOrCreateV8EventListener(value, true);
1092 if (listener) { 1092 if (listener) {
1093 node->setAttributeEventListener(event_type, listener); 1093 node->setAttributeEventListener(event_type, listener);
1094 } 1094 }
1095 } else { 1095 } else {
1096 node->clearAttributeEventListener(event_type); 1096 node->clearAttributeEventListener(event_type);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 #undef MAKE_CASE 1261 #undef MAKE_CASE
1262 1262
1263 default: 1263 default:
1264 return V8ClassIndex::INVALID_CLASS_INDEX; 1264 return V8ClassIndex::INVALID_CLASS_INDEX;
1265 } 1265 }
1266 } 1266 }
1267 1267
1268 #endif // ENABLE(SVG) 1268 #endif // ENABLE(SVG)
1269 1269
1270 } // namespace WebCore 1270 } // namespace WebCore
OLDNEW
« no previous file with comments | « webkit/port/bindings/v8/ScriptController.cpp ('k') | webkit/port/bindings/v8/v8_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698