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

Side by Side Diff: Source/bindings/core/v8/custom/V8InjectedScriptManager.cpp

Issue 1165453007: Reland "DevTools: extract common inspector bindigns code into InspectorWrapper" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/core/v8/inspector/InspectorWrapper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 { 47 {
48 v8::Isolate* isolate = inspectedScriptState->isolate(); 48 v8::Isolate* isolate = inspectedScriptState->isolate();
49 ScriptState::Scope scope(inspectedScriptState); 49 ScriptState::Scope scope(inspectedScriptState);
50 50
51 v8::Local<v8::FunctionTemplate> wrapperTemplate = m_injectedScriptHost->wrap perTemplate(isolate); 51 v8::Local<v8::FunctionTemplate> wrapperTemplate = m_injectedScriptHost->wrap perTemplate(isolate);
52 if (wrapperTemplate.IsEmpty()) { 52 if (wrapperTemplate.IsEmpty()) {
53 wrapperTemplate = V8InjectedScriptHost::createWrapperTemplate(isolate); 53 wrapperTemplate = V8InjectedScriptHost::createWrapperTemplate(isolate);
54 m_injectedScriptHost->setWrapperTemplate(wrapperTemplate, isolate); 54 m_injectedScriptHost->setWrapperTemplate(wrapperTemplate, isolate);
55 } 55 }
56 56
57 v8::Local<v8::Object> scriptHostWrapper = V8InjectedScriptHost::wrap(isolate , wrapperTemplate, m_injectedScriptHost); 57 v8::Local<v8::Object> scriptHostWrapper = V8InjectedScriptHost::wrap(wrapper Template, inspectedScriptState->context(), m_injectedScriptHost);
58 if (scriptHostWrapper.IsEmpty()) 58 if (scriptHostWrapper.IsEmpty())
59 return ScriptValue(); 59 return ScriptValue();
60 60
61 injectedScriptNative->setOnInjectedScriptHost(scriptHostWrapper); 61 injectedScriptNative->setOnInjectedScriptHost(scriptHostWrapper);
62 62
63 // Inject javascript into the context. The compiled script is supposed to ev aluate into 63 // Inject javascript into the context. The compiled script is supposed to ev aluate into
64 // a single anonymous function(it's anonymous to avoid cluttering the global object with 64 // a single anonymous function(it's anonymous to avoid cluttering the global object with
65 // inspector's stuff) the function is called a few lines below with Injected ScriptHost wrapper, 65 // inspector's stuff) the function is called a few lines below with Injected ScriptHost wrapper,
66 // injected script id and explicit reference to the inspected global object. The function is expected 66 // injected script id and explicit reference to the inspected global object. The function is expected
67 // to create and configure InjectedScript instance that is going to be used by the inspector. 67 // to create and configure InjectedScript instance that is going to be used by the inspector.
(...skipping 18 matching lines...) Expand all
86 return false; 86 return false;
87 v8::Local<v8::Object> holder = V8Window::findInstanceInPrototypeChain(global , scriptState->isolate()); 87 v8::Local<v8::Object> holder = V8Window::findInstanceInPrototypeChain(global , scriptState->isolate());
88 if (holder.IsEmpty()) 88 if (holder.IsEmpty())
89 return false; 89 return false;
90 LocalFrame* frame = toLocalDOMWindow(V8Window::toImpl(holder))->frame(); 90 LocalFrame* frame = toLocalDOMWindow(V8Window::toImpl(holder))->frame();
91 91
92 return BindingSecurity::shouldAllowAccessToFrame(scriptState->isolate(), fra me, DoNotReportSecurityError); 92 return BindingSecurity::shouldAllowAccessToFrame(scriptState->isolate(), fra me, DoNotReportSecurityError);
93 } 93 }
94 94
95 } // namespace blink 95 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/core/v8/inspector/InspectorWrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698