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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 { | 181 { |
182 FrameConsole::unmute(); | 182 FrameConsole::unmute(); |
183 } | 183 } |
184 | 184 |
185 bool MainThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context> c alling, v8::Local<v8::Context> target) | 185 bool MainThreadDebugger::callingContextCanAccessContext(v8::Local<v8::Context> c alling, v8::Local<v8::Context> target) |
186 { | 186 { |
187 ExecutionContext* executionContext = toExecutionContext(target); | 187 ExecutionContext* executionContext = toExecutionContext(target); |
188 ASSERT(executionContext); | 188 ASSERT(executionContext); |
189 | 189 |
190 if (executionContext->isMainThreadWorkletGlobalScope()) { | 190 if (executionContext->isMainThreadWorkletGlobalScope()) { |
191 MainThreadWorkletGlobalScope* globalScope = toMainThreadWorkletGlobalSco pe(executionContext); | 191 // Similar to WorkerThreadDebugger::callingContextCanAccessContext(http: //crrev.com/1638563002). |
dgozman
2016/06/13 13:14:06
We can return |true| in workers just because we kn
| |
192 return globalScope && BindingSecurity::shouldAllowAccessTo(m_isolate, to LocalDOMWindow(toDOMWindow(calling)), globalScope, DoNotReportSecurityError); | 192 return true; |
193 } | 193 } |
194 | 194 |
195 DOMWindow* window = toDOMWindow(target); | 195 DOMWindow* window = toDOMWindow(target); |
196 return window && BindingSecurity::shouldAllowAccessTo(m_isolate, toLocalDOMW indow(toDOMWindow(calling)), window, DoNotReportSecurityError); | 196 return window && BindingSecurity::shouldAllowAccessTo(m_isolate, toLocalDOMW indow(toDOMWindow(calling)), window, DoNotReportSecurityError); |
197 } | 197 } |
198 | 198 |
199 int MainThreadDebugger::ensureDefaultContextInGroup(int contextGroupId) | 199 int MainThreadDebugger::ensureDefaultContextInGroup(int contextGroupId) |
200 { | 200 { |
201 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); | 201 LocalFrame* frame = WeakIdentifierMap<LocalFrame>::lookup(contextGroupId); |
202 if (!frame) | 202 if (!frame) |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 return; | 345 return; |
346 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get Isolate())).FromMaybe(false)) | 346 if (!nodes->Set(context, index++, toV8(node, info.Holder(), info.Get Isolate())).FromMaybe(false)) |
347 return; | 347 return; |
348 } | 348 } |
349 info.GetReturnValue().Set(nodes); | 349 info.GetReturnValue().Set(nodes); |
350 } | 350 } |
351 exceptionState.throwIfNeeded(); | 351 exceptionState.throwIfNeeded(); |
352 } | 352 } |
353 | 353 |
354 } // namespace blink | 354 } // namespace blink |
OLD | NEW |