| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 if (scriptHostWrapper.IsEmpty()) | 89 if (scriptHostWrapper.IsEmpty()) |
| 90 return ScriptObject(); | 90 return ScriptObject(); |
| 91 | 91 |
| 92 v8::Local<v8::Object> windowGlobal = inspectedContext->Global(); | 92 v8::Local<v8::Object> windowGlobal = inspectedContext->Global(); |
| 93 | 93 |
| 94 // Inject javascript into the context. The compiled script is supposed to ev
aluate into | 94 // Inject javascript into the context. The compiled script is supposed to ev
aluate into |
| 95 // a single anonymous function(it's anonymous to avoid cluttering the global
object with | 95 // a single anonymous function(it's anonymous to avoid cluttering the global
object with |
| 96 // inspector's stuff) the function is called a few lines below with Injected
ScriptHost wrapper, | 96 // inspector's stuff) the function is called a few lines below with Injected
ScriptHost wrapper, |
| 97 // injected script id and explicit reference to the inspected global object.
The function is expected | 97 // injected script id and explicit reference to the inspected global object.
The function is expected |
| 98 // to create and configure InjectedScript instance that is going to be used
by the inspector. | 98 // to create and configure InjectedScript instance that is going to be used
by the inspector. |
| 99 v8::Local<v8::Script> script = v8::Script::Compile(v8String(scriptSource, in
spectedContext->GetIsolate())); | 99 v8::Local<v8::Script> script = v8::Script::Compile(deprecatedV8String(script
Source)); |
| 100 V8RecursionScope::MicrotaskSuppression recursionScope; | 100 V8RecursionScope::MicrotaskSuppression recursionScope; |
| 101 v8::Local<v8::Value> v = script->Run(); | 101 v8::Local<v8::Value> v = script->Run(); |
| 102 ASSERT(!v.IsEmpty()); | 102 ASSERT(!v.IsEmpty()); |
| 103 ASSERT(v->IsFunction()); | 103 ASSERT(v->IsFunction()); |
| 104 | 104 |
| 105 v8::Handle<v8::Value> args[] = { | 105 v8::Handle<v8::Value> args[] = { |
| 106 scriptHostWrapper, | 106 scriptHostWrapper, |
| 107 windowGlobal, | 107 windowGlobal, |
| 108 v8::Number::New(id), | 108 v8::Number::New(id), |
| 109 }; | 109 }; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 123 return false; | 123 return false; |
| 124 Frame* frame = V8DOMWindow::toNative(holder)->frame(); | 124 Frame* frame = V8DOMWindow::toNative(holder)->frame(); |
| 125 | 125 |
| 126 v8::Context::Scope contextScope(context); | 126 v8::Context::Scope contextScope(context); |
| 127 return BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), f
rame, DoNotReportSecurityError); | 127 return BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), f
rame, DoNotReportSecurityError); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace WebCore | 130 } // namespace WebCore |
| 131 | 131 |
| 132 #endif // ENABLE(INSPECTOR) | 132 #endif // ENABLE(INSPECTOR) |
| OLD | NEW |