| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // Call custom code to create InjectedScripHost wrapper specific for the con
text | 83 // Call custom code to create InjectedScripHost wrapper specific for the con
text |
| 84 // instead of calling toV8() that would create the | 84 // instead of calling toV8() that would create the |
| 85 // wrapper in the current context. | 85 // wrapper in the current context. |
| 86 // FIXME: make it possible to use generic bindings factory for InjectedScrip
tHost. | 86 // FIXME: make it possible to use generic bindings factory for InjectedScrip
tHost. |
| 87 v8::Local<v8::Object> scriptHostWrapper = createInjectedScriptHostV8Wrapper(
m_injectedScriptHost.get(), inspectedContext->GetIsolate()); | 87 v8::Local<v8::Object> scriptHostWrapper = createInjectedScriptHostV8Wrapper(
m_injectedScriptHost.get(), inspectedContext->GetIsolate()); |
| 88 if (scriptHostWrapper.IsEmpty()) | 88 if (scriptHostWrapper.IsEmpty()) |
| 89 return ScriptObject(); | 89 return ScriptObject(); |
| 90 | 90 |
| 91 v8::Local<v8::Object> windowGlobal = inspectedContext->Global(); | 91 v8::Local<v8::Object> windowGlobal = inspectedContext->Global(); |
| 92 | 92 |
| 93 V8ScopedCompilation debuggerCompilation(inspectedContext, DevtoolsFunctionCo
mpilation); |
| 94 |
| 93 // Inject javascript into the context. The compiled script is supposed to ev
aluate into | 95 // Inject javascript into the context. The compiled script is supposed to ev
aluate into |
| 94 // a single anonymous function(it's anonymous to avoid cluttering the global
object with | 96 // a single anonymous function(it's anonymous to avoid cluttering the global
object with |
| 95 // inspector's stuff) the function is called a few lines below with Injected
ScriptHost wrapper, | 97 // inspector's stuff) the function is called a few lines below with Injected
ScriptHost wrapper, |
| 96 // injected script id and explicit reference to the inspected global object.
The function is expected | 98 // injected script id and explicit reference to the inspected global object.
The function is expected |
| 97 // to create and configure InjectedScript instance that is going to be used
by the inspector. | 99 // to create and configure InjectedScript instance that is going to be used
by the inspector. |
| 98 v8::Local<v8::Script> script = v8::Script::Compile(v8String(scriptSource, in
spectedContext->GetIsolate())); | 100 v8::Local<v8::Script> script = v8::Script::Compile(v8String(scriptSource, in
spectedContext->GetIsolate())); |
| 99 V8RecursionScope::MicrotaskSuppression recursionScope; | 101 V8RecursionScope::MicrotaskSuppression recursionScope; |
| 100 v8::Local<v8::Value> v = script->Run(); | 102 v8::Local<v8::Value> v = script->Run(); |
| 101 ASSERT(!v.IsEmpty()); | 103 ASSERT(!v.IsEmpty()); |
| 102 ASSERT(v->IsFunction()); | 104 ASSERT(v->IsFunction()); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 123 if (holder.IsEmpty()) | 125 if (holder.IsEmpty()) |
| 124 return false; | 126 return false; |
| 125 Frame* frame = V8DOMWindow::toNative(holder)->frame(); | 127 Frame* frame = V8DOMWindow::toNative(holder)->frame(); |
| 126 | 128 |
| 127 v8::Context::Scope contextScope(context); | 129 v8::Context::Scope contextScope(context); |
| 128 return BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), f
rame, DoNotReportSecurityError); | 130 return BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), f
rame, DoNotReportSecurityError); |
| 129 } | 131 } |
| 130 | 132 |
| 131 } // namespace WebCore | 133 } // namespace WebCore |
| 132 | 134 |
| OLD | NEW |