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

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

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 7 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 | « Source/core/inspector/PageRuntimeAgent.h ('k') | Source/core/inspector/WorkerConsoleAgent.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) 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "weborigin/SecurityOrigin.h" 44 #include "weborigin/SecurityOrigin.h"
45 45
46 using WebCore::TypeBuilder::Runtime::ExecutionContextDescription; 46 using WebCore::TypeBuilder::Runtime::ExecutionContextDescription;
47 47
48 namespace WebCore { 48 namespace WebCore {
49 49
50 namespace PageRuntimeAgentState { 50 namespace PageRuntimeAgentState {
51 static const char runtimeEnabled[] = "runtimeEnabled"; 51 static const char runtimeEnabled[] = "runtimeEnabled";
52 }; 52 };
53 53
54 PageRuntimeAgent::PageRuntimeAgent(InstrumentingAgents* instrumentingAgents, Ins pectorCompositeState* state, InjectedScriptManager* injectedScriptManager, Scrip tDebugServer* scriptDebugServer, Page* page, InspectorPageAgent* pageAgent) 54 PassRefPtr<PageRuntimeAgent> PageRuntimeAgent::create(InstrumentingAgents* instr umentingAgents, InspectorState* state, Page* page, PassRefPtr<InspectorPageAgent > pageAgent, InjectedScriptManager* injectedScriptManager, ScriptDebugServer* sc riptDebugServer)
55 {
56 return adoptRef(new PageRuntimeAgent(instrumentingAgents, state, page, pageA gent, injectedScriptManager, scriptDebugServer));
57 }
58
59 PageRuntimeAgent::PageRuntimeAgent(InstrumentingAgents* instrumentingAgents, Ins pectorState* state, Page* page, PassRefPtr<InspectorPageAgent> pageAgent, Inject edScriptManager* injectedScriptManager, ScriptDebugServer* scriptDebugServer)
55 : InspectorRuntimeAgent(instrumentingAgents, state, injectedScriptManager, s criptDebugServer) 60 : InspectorRuntimeAgent(instrumentingAgents, state, injectedScriptManager, s criptDebugServer)
56 , m_inspectedPage(page) 61 , m_inspectedPage(page)
57 , m_pageAgent(pageAgent) 62 , m_pageAgent(pageAgent)
58 , m_frontend(0) 63 , m_frontend(0)
59 , m_mainWorldContextCreated(false) 64 , m_mainWorldContextCreated(false)
60 { 65 {
61 m_instrumentingAgents->setPageRuntimeAgent(this); 66 m_instrumentingAgents->setPageRuntimeAgent(this);
62 } 67 }
63 68
64 PageRuntimeAgent::~PageRuntimeAgent() 69 PageRuntimeAgent::~PageRuntimeAgent()
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 int executionContextId = injectedScriptManager()->injectedScriptIdFor(script State); 188 int executionContextId = injectedScriptManager()->injectedScriptIdFor(script State);
184 String name = securityOrigin ? securityOrigin->toRawString() : ""; 189 String name = securityOrigin ? securityOrigin->toRawString() : "";
185 m_frontend->executionContextCreated(ExecutionContextDescription::create() 190 m_frontend->executionContextCreated(ExecutionContextDescription::create()
186 .setId(executionContextId) 191 .setId(executionContextId)
187 .setIsPageContext(isPageContext) 192 .setIsPageContext(isPageContext)
188 .setName(name) 193 .setName(name)
189 .setFrameId(frameId) 194 .setFrameId(frameId)
190 .release()); 195 .release());
191 } 196 }
192 197
198 PageRuntimeFactory::PageRuntimeFactory(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, Page* page, InspectorPageFactory* page Factory, InjectedScriptManager* injectedScriptManager, ScriptDebugServer* script DebugServer)
199 : InspectorRuntimeFactory(instrumentingAgents, compositeState)
200 {
201 setAgent(PageRuntimeAgent::create(m_instrumentingAgents, m_state, page, page Factory->agent(), injectedScriptManager, scriptDebugServer));
202 }
203
193 } // namespace WebCore 204 } // namespace WebCore
194 205
OLDNEW
« no previous file with comments | « Source/core/inspector/PageRuntimeAgent.h ('k') | Source/core/inspector/WorkerConsoleAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698