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

Side by Side Diff: Source/core/inspector/WorkerDebuggerAgent.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
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 private: 73 private:
74 WorkerThread* m_thread; 74 WorkerThread* m_thread;
75 WorkerContext* m_workerContext; 75 WorkerContext* m_workerContext;
76 }; 76 };
77 77
78 } // namespace 78 } // namespace
79 79
80 const char* WorkerDebuggerAgent::debuggerTaskMode = "debugger"; 80 const char* WorkerDebuggerAgent::debuggerTaskMode = "debugger";
81 81
82 PassOwnPtr<WorkerDebuggerAgent> WorkerDebuggerAgent::create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* inspectorState, WorkerScriptDebug Server* scriptDebugServer, WorkerContext* inspectedWorkerContext, InjectedScript Manager* injectedScriptManager) 82 PassRefPtr<WorkerDebuggerAgent> WorkerDebuggerAgent::create(InstrumentingAgents* instrumentingAgents, InspectorState* inspectorState, WorkerScriptDebugServer* s criptDebugServer, WorkerContext* inspectedWorkerContext, InjectedScriptManager* injectedScriptManager)
83 { 83 {
84 return adoptPtr(new WorkerDebuggerAgent(instrumentingAgents, inspectorState, scriptDebugServer, inspectedWorkerContext, injectedScriptManager)); 84 return adoptRef(new WorkerDebuggerAgent(instrumentingAgents, inspectorState, scriptDebugServer, inspectedWorkerContext, injectedScriptManager));
85 } 85 }
86 86
87 WorkerDebuggerAgent::WorkerDebuggerAgent(InstrumentingAgents* instrumentingAgent s, InspectorCompositeState* inspectorState, WorkerScriptDebugServer* scriptDebug Server, WorkerContext* inspectedWorkerContext, InjectedScriptManager* injectedSc riptManager) 87 WorkerDebuggerAgent::WorkerDebuggerAgent(InstrumentingAgents* instrumentingAgent s, InspectorState* inspectorState, WorkerScriptDebugServer* scriptDebugServer, W orkerContext* inspectedWorkerContext, InjectedScriptManager* injectedScriptManag er)
88 : InspectorDebuggerAgent(instrumentingAgents, inspectorState, injectedScript Manager) 88 : InspectorDebuggerAgent(instrumentingAgents, inspectorState, injectedScript Manager)
89 , m_scriptDebugServer(scriptDebugServer) 89 , m_scriptDebugServer(scriptDebugServer)
90 , m_inspectedWorkerContext(inspectedWorkerContext) 90 , m_inspectedWorkerContext(inspectedWorkerContext)
91 { 91 {
92 MutexLocker lock(workerDebuggerAgentsMutex()); 92 MutexLocker lock(workerDebuggerAgentsMutex());
93 workerDebuggerAgents().set(inspectedWorkerContext->thread(), this); 93 workerDebuggerAgents().set(inspectedWorkerContext->thread(), this);
94 } 94 }
95 95
96 WorkerDebuggerAgent::~WorkerDebuggerAgent() 96 WorkerDebuggerAgent::~WorkerDebuggerAgent()
97 { 97 {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // We don't need to mute console for workers. 143 // We don't need to mute console for workers.
144 } 144 }
145 145
146 void WorkerDebuggerAgent::addConsoleMessage(MessageSource source, MessageLevel l evel, const String& message, const String& sourceURL) 146 void WorkerDebuggerAgent::addConsoleMessage(MessageSource source, MessageLevel l evel, const String& message, const String& sourceURL)
147 { 147 {
148 ScriptExecutionContext* context = m_inspectedWorkerContext; 148 ScriptExecutionContext* context = m_inspectedWorkerContext;
149 context->addConsoleMessage(source, level, message, sourceURL, 0); 149 context->addConsoleMessage(source, level, message, sourceURL, 0);
150 } 150 }
151 151
152 } // namespace WebCore 152 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/inspector/WorkerDebuggerAgent.h ('k') | Source/core/inspector/WorkerInspectorController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698