| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 DECLARE_TRACE(); | 80 DECLARE_TRACE(); |
| 81 | 81 |
| 82 bool initializeMainWorld(); | 82 bool initializeMainWorld(); |
| 83 WindowProxy* windowProxy(DOMWrapperWorld&); | 83 WindowProxy* windowProxy(DOMWrapperWorld&); |
| 84 WindowProxy* existingWindowProxy(DOMWrapperWorld&); | 84 WindowProxy* existingWindowProxy(DOMWrapperWorld&); |
| 85 | 85 |
| 86 // Evaluate JavaScript in the main world. | 86 // Evaluate JavaScript in the main world. |
| 87 void executeScriptInMainWorld(const String&, ExecuteScriptPolicy = DoNotExec
uteScriptWhenScriptsDisabled); | 87 void executeScriptInMainWorld(const String&, ExecuteScriptPolicy = DoNotExec
uteScriptWhenScriptsDisabled); |
| 88 void executeScriptInMainWorld(const ScriptSourceCode&, AccessControlStatus =
NotSharableCrossOrigin, double* compilationFinishTime = 0); | 88 void executeScriptInMainWorld(const ScriptSourceCode&, AccessControlStatus =
NotSharableCrossOrigin); |
| 89 v8::Local<v8::Value> executeScriptInMainWorldAndReturnValue(const ScriptSour
ceCode&, ExecuteScriptPolicy = DoNotExecuteScriptWhenScriptsDisabled); | 89 v8::Local<v8::Value> executeScriptInMainWorldAndReturnValue(const ScriptSour
ceCode&, ExecuteScriptPolicy = DoNotExecuteScriptWhenScriptsDisabled); |
| 90 v8::Local<v8::Value> executeScriptAndReturnValue(v8::Local<v8::Context>, con
st ScriptSourceCode&, AccessControlStatus = NotSharableCrossOrigin, double* comp
ilationFinishTime = 0); | 90 v8::Local<v8::Value> executeScriptAndReturnValue(v8::Local<v8::Context>, con
st ScriptSourceCode&, AccessControlStatus = NotSharableCrossOrigin); |
| 91 | 91 |
| 92 // Executes JavaScript in an isolated world. The script gets its own global
scope, | 92 // Executes JavaScript in an isolated world. The script gets its own global
scope, |
| 93 // its own prototypes for intrinsic JavaScript objects (String, Array, and s
o-on), | 93 // its own prototypes for intrinsic JavaScript objects (String, Array, and s
o-on), |
| 94 // and its own wrappers for all DOM nodes and DOM constructors. | 94 // and its own wrappers for all DOM nodes and DOM constructors. |
| 95 // | 95 // |
| 96 // If an isolated world with the specified ID already exists, it is reused. | 96 // If an isolated world with the specified ID already exists, it is reused. |
| 97 // Otherwise, a new world is created. | 97 // Otherwise, a new world is created. |
| 98 // | 98 // |
| 99 // FIXME: Get rid of extensionGroup here. | 99 // FIXME: Get rid of extensionGroup here. |
| 100 // FIXME: We don't want to support multiple scripts. | 100 // FIXME: We don't want to support multiple scripts. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 v8::Isolate* isolate() const { return m_windowProxyManager->isolate(); } | 140 v8::Isolate* isolate() const { return m_windowProxyManager->isolate(); } |
| 141 | 141 |
| 142 WindowProxyManager* getWindowProxyManager() const { return m_windowProxyMana
ger.get(); } | 142 WindowProxyManager* getWindowProxyManager() const { return m_windowProxyMana
ger.get(); } |
| 143 | 143 |
| 144 private: | 144 private: |
| 145 explicit ScriptController(LocalFrame*); | 145 explicit ScriptController(LocalFrame*); |
| 146 | 146 |
| 147 LocalFrame* frame() const { return toLocalFrame(m_windowProxyManager->frame(
)); } | 147 LocalFrame* frame() const { return toLocalFrame(m_windowProxyManager->frame(
)); } |
| 148 | 148 |
| 149 v8::Local<v8::Value> evaluateScriptInMainWorld(const ScriptSourceCode&, Acce
ssControlStatus, ExecuteScriptPolicy, double* compilationFinishTime = 0); | 149 v8::Local<v8::Value> evaluateScriptInMainWorld(const ScriptSourceCode&, Acce
ssControlStatus, ExecuteScriptPolicy); |
| 150 | 150 |
| 151 Member<WindowProxyManager> m_windowProxyManager; | 151 Member<WindowProxyManager> m_windowProxyManager; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace blink | 154 } // namespace blink |
| 155 | 155 |
| 156 #endif // ScriptController_h | 156 #endif // ScriptController_h |
| OLD | NEW |