Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2011 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 void MainThreadDebugger::muteConsole() | 180 void MainThreadDebugger::muteConsole() |
| 181 { | 181 { |
| 182 FrameConsole::mute(); | 182 FrameConsole::mute(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void MainThreadDebugger::unmuteConsole() | 185 void MainThreadDebugger::unmuteConsole() |
| 186 { | 186 { |
| 187 FrameConsole::unmute(); | 187 FrameConsole::unmute(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 bool MainThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context> c alling, v8::Local<v8::Context> target) | 190 bool MainThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context> c alling, v8::Local<v8::Context> target) |
|
haraken
2016/06/29 00:23:35
Not directly related to the CL, but is there any r
Gleb Lanbin
2016/06/29 17:07:13
please see the reply from dgozman@ above in this t
| |
| 191 { | 191 { |
| 192 ExecutionContext* executionContext = toExecutionContext(target); | 192 return BindingSecurity::shouldAllowAccessTo(m_isolate, calling, target, DoNo tReportSecurityError); |
| 193 ASSERT(executionContext); | |
| 194 | |
| 195 if (executionContext->isMainThreadWorkletGlobalScope()) { | |
| 196 MainThreadWorkletGlobalScope* globalScope = toMainThreadWorkletGlobalSco pe(executionContext); | |
| 197 return globalScope && BindingSecurity::shouldAllowAccessTo(m_isolate, to LocalDOMWindow(toDOMWindow(calling)), globalScope, DoNotReportSecurityError); | |
| 198 } | |
| 199 | |
| 200 DOMWindow* window = toDOMWindow(target); | |
| 201 return window && BindingSecurity::shouldAllowAccessTo(m_isolate, toLocalDOMW indow(toDOMWindow(calling)), window, DoNotReportSecurityError); | |
| 202 } | 193 } |
| 203 | 194 |
| 204 int MainThreadDebugger::ensureDefaultContextInGroup(int contextGroupId) | 195 int MainThreadDebugger::ensureDefaultContextInGroup(int contextGroupId) |
| 205 { | 196 { |
| 206 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); | 197 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); |
| 207 if (!frame) | 198 if (!frame) |
| 208 return 0; | 199 return 0; |
| 209 ScriptState* scriptState = ScriptState::forMainWorld(frame); | 200 ScriptState* scriptState = ScriptState::forMainWorld(frame); |
| 210 if (!scriptState) | 201 if (!scriptState) |
| 211 return 0; | 202 return 0; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 return; | 330 return; |
| 340 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get Isolate())).FromMaybe(false)) | 331 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get Isolate())).FromMaybe(false)) |
| 341 return; | 332 return; |
| 342 } | 333 } |
| 343 info.GetReturnValue().Set(nodes); | 334 info.GetReturnValue().Set(nodes); |
| 344 } | 335 } |
| 345 exceptionState.throwIfNeeded(); | 336 exceptionState.throwIfNeeded(); |
| 346 } | 337 } |
| 347 | 338 |
| 348 } // namespace blink | 339 } // namespace blink |
| OLD | NEW |