Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1067)

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/InjectedScript.cpp

Issue 2058133002: Fix DevTools support of worklets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move callingContextCanAccessContext to BindingSecurity Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "platform/v8_inspector/InjectedScript.h" 31 #include "platform/v8_inspector/InjectedScript.h"
32 32
33 #include "bindings/core/v8/BindingSecurity.h"
33 #include "platform/inspector_protocol/Parser.h" 34 #include "platform/inspector_protocol/Parser.h"
34 #include "platform/inspector_protocol/String16.h" 35 #include "platform/inspector_protocol/String16.h"
35 #include "platform/inspector_protocol/Values.h" 36 #include "platform/inspector_protocol/Values.h"
36 #include "platform/v8_inspector/InjectedScriptNative.h" 37 #include "platform/v8_inspector/InjectedScriptNative.h"
37 #include "platform/v8_inspector/InjectedScriptSource.h" 38 #include "platform/v8_inspector/InjectedScriptSource.h"
38 #include "platform/v8_inspector/InspectedContext.h" 39 #include "platform/v8_inspector/InspectedContext.h"
39 #include "platform/v8_inspector/RemoteObjectId.h" 40 #include "platform/v8_inspector/RemoteObjectId.h"
40 #include "platform/v8_inspector/V8Compat.h" 41 #include "platform/v8_inspector/V8Compat.h"
41 #include "platform/v8_inspector/V8Console.h" 42 #include "platform/v8_inspector/V8Console.h"
42 #include "platform/v8_inspector/V8DebuggerImpl.h" 43 #include "platform/v8_inspector/V8DebuggerImpl.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 bool hadException = false; 270 bool hadException = false;
270 function.call(hadException); 271 function.call(hadException);
271 DCHECK(!hadException); 272 DCHECK(!hadException);
272 } 273 }
273 274
274 bool InjectedScript::canAccessInspectedWindow() const 275 bool InjectedScript::canAccessInspectedWindow() const
275 { 276 {
276 v8::Local<v8::Context> callingContext = m_context->isolate()->GetCallingCont ext(); 277 v8::Local<v8::Context> callingContext = m_context->isolate()->GetCallingCont ext();
277 if (callingContext.IsEmpty()) 278 if (callingContext.IsEmpty())
278 return true; 279 return true;
279 return m_context->debugger()->client()->callingContextCanAccessContext(calli ngContext, m_context->context()); 280 return BindingSecurity::callingContextCanAccessContext(m_context->debugger() ->isolate(), callingContext, m_context->context(), DoNotReportSecurityError);
280 } 281 }
281 282
282 v8::Local<v8::Value> InjectedScript::v8Value() const 283 v8::Local<v8::Value> InjectedScript::v8Value() const
283 { 284 {
284 return m_value.Get(m_context->isolate()); 285 return m_value.Get(m_context->isolate());
285 } 286 }
286 287
287 v8::Local<v8::Value> InjectedScript::lastEvaluationResult() const 288 v8::Local<v8::Value> InjectedScript::lastEvaluationResult() const
288 { 289 {
289 if (m_lastEvaluationResult.IsEmpty()) 290 if (m_lastEvaluationResult.IsEmpty())
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl* session) 508 void InjectedScript::CallFrameScope::findInjectedScript(V8InspectorSessionImpl* session)
508 { 509 {
509 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err orString, m_remoteCallFrameId); 510 std::unique_ptr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(m_err orString, m_remoteCallFrameId);
510 if (!remoteId) 511 if (!remoteId)
511 return; 512 return;
512 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal()); 513 m_frameOrdinal = static_cast<size_t>(remoteId->frameOrdinal());
513 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get() ); 514 m_injectedScript = session->findInjectedScript(m_errorString, remoteId.get() );
514 } 515 }
515 516
516 } // namespace blink 517 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698