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

Side by Side Diff: bindings/js/ScriptController.cpp

Issue 542055: DevTools: injected script per context(WebCore part) (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/WebCore/
Patch Set: '' Created 10 years, 11 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 | « bindings/js/ScriptController.h ('k') | bindings/js/ScriptObject.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) 1999-2001 Harri Porten (porten@kde.org) 2 * Copyright (C) 1999-2001 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public 7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 JSObject* object = jsObjectForPluginElement(plugin); 367 JSObject* object = jsObjectForPluginElement(plugin);
368 if (!object) 368 if (!object)
369 return _NPN_CreateNoScriptObject(); 369 return _NPN_CreateNoScriptObject();
370 370
371 // Wrap the JSObject in an NPObject 371 // Wrap the JSObject in an NPObject
372 return _NPN_CreateScriptObject(0, object, bindingRootObject()); 372 return _NPN_CreateScriptObject(0, object, bindingRootObject());
373 } 373 }
374 374
375 #endif 375 #endif
376 376
377 ScriptState* ScriptController::mainWorldScriptState()
378 {
379 JSDOMWindowShell* shell = windowShell(mainThreadNormalWorld());
380 return shell->window()->globalExec();
381 }
382
377 JSObject* ScriptController::jsObjectForPluginElement(HTMLPlugInElement* plugin) 383 JSObject* ScriptController::jsObjectForPluginElement(HTMLPlugInElement* plugin)
378 { 384 {
379 // Can't create JSObjects when JavaScript is disabled 385 // Can't create JSObjects when JavaScript is disabled
380 if (!canExecuteScripts()) 386 if (!canExecuteScripts())
381 return 0; 387 return 0;
382 388
383 // Create a JSObject bound to this element 389 // Create a JSObject bound to this element
384 JSLock lock(SilenceAssertionsOnly); 390 JSLock lock(SilenceAssertionsOnly);
385 JSDOMWindow* globalObj = globalObject(pluginWorld()); 391 JSDOMWindow* globalObj = globalObject(pluginWorld());
386 // FIXME: is normal okay? - used for NP plugins? 392 // FIXME: is normal okay? - used for NP plugins?
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 460
455 if (!wasInExecuteScript) { 461 if (!wasInExecuteScript) {
456 m_inExecuteScript = false; 462 m_inExecuteScript = false;
457 Document::updateStyleForAllDocuments(); 463 Document::updateStyleForAllDocuments();
458 } 464 }
459 465
460 return result; 466 return result;
461 } 467 }
462 468
463 } // namespace WebCore 469 } // namespace WebCore
OLDNEW
« no previous file with comments | « bindings/js/ScriptController.h ('k') | bindings/js/ScriptObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698