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

Side by Side Diff: Source/core/inspector/InspectorRuntimeAgent.cpp

Issue 15764004: DevTools: show extension name in console context switcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline. Created 6 years, 4 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
OLDNEW
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 13 matching lines...) Expand all
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 "config.h" 31 #include "config.h"
32 #include "core/inspector/InspectorRuntimeAgent.h" 32 #include "core/inspector/InspectorRuntimeAgent.h"
33 33
34 #include "bindings/core/v8/DOMWrapperWorld.h"
34 #include "bindings/core/v8/ScriptDebugServer.h" 35 #include "bindings/core/v8/ScriptDebugServer.h"
35 #include "bindings/core/v8/ScriptState.h" 36 #include "bindings/core/v8/ScriptState.h"
36 #include "core/inspector/InjectedScript.h" 37 #include "core/inspector/InjectedScript.h"
37 #include "core/inspector/InjectedScriptManager.h" 38 #include "core/inspector/InjectedScriptManager.h"
38 #include "core/inspector/InspectorState.h" 39 #include "core/inspector/InspectorState.h"
39 #include "platform/JSONValues.h" 40 #include "platform/JSONValues.h"
40 41
41 using blink::TypeBuilder::Runtime::ExecutionContextDescription; 42 using blink::TypeBuilder::Runtime::ExecutionContextDescription;
42 43
43 namespace blink { 44 namespace blink {
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 void InspectorRuntimeAgent::disable(ErrorString* errorString) 194 void InspectorRuntimeAgent::disable(ErrorString* errorString)
194 { 195 {
195 if (!m_enabled) 196 if (!m_enabled)
196 return; 197 return;
197 198
198 m_scriptStateToId.clear(); 199 m_scriptStateToId.clear();
199 m_enabled = false; 200 m_enabled = false;
200 m_state->setBoolean(InspectorRuntimeAgentState::runtimeEnabled, false); 201 m_state->setBoolean(InspectorRuntimeAgentState::runtimeEnabled, false);
201 } 202 }
202 203
203 void InspectorRuntimeAgent::addExecutionContextToFrontend(ScriptState* scriptSta te, bool isPageContext, const String& name, const String& frameId) 204 void InspectorRuntimeAgent::addExecutionContextToFrontend(ScriptState* scriptSta te, bool isPageContext, const String& origin, const String& frameId)
204 { 205 {
205 int executionContextId = injectedScriptManager()->injectedScriptIdFor(script State); 206 int executionContextId = injectedScriptManager()->injectedScriptIdFor(script State);
206 m_scriptStateToId.set(scriptState, executionContextId); 207 m_scriptStateToId.set(scriptState, executionContextId);
208 String humanReadableName = scriptState->world().isolatedWorldHumanReadableNa me();
207 m_frontend->executionContextCreated(ExecutionContextDescription::create() 209 m_frontend->executionContextCreated(ExecutionContextDescription::create()
208 .setId(executionContextId) 210 .setId(executionContextId)
209 .setIsPageContext(isPageContext) 211 .setIsPageContext(isPageContext)
210 .setName(name) 212 .setName(humanReadableName)
213 .setOrigin(origin)
211 .setFrameId(frameId) 214 .setFrameId(frameId)
212 .release()); 215 .release());
213 } 216 }
214 217
215 } // namespace blink 218 } // namespace blink
216 219
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698