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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp

Issue 2139363003: [DevTools] Cleanup v8_inspector API part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 30 matching lines...) Expand all
41 #include "core/dom/ExceptionCode.h" 41 #include "core/dom/ExceptionCode.h"
42 #include "core/dom/MessagePort.h" 42 #include "core/dom/MessagePort.h"
43 #include "core/events/ErrorEvent.h" 43 #include "core/events/ErrorEvent.h"
44 #include "core/events/Event.h" 44 #include "core/events/Event.h"
45 #include "core/fetch/MemoryCache.h" 45 #include "core/fetch/MemoryCache.h"
46 #include "core/frame/DOMTimer.h" 46 #include "core/frame/DOMTimer.h"
47 #include "core/frame/DOMTimerCoordinator.h" 47 #include "core/frame/DOMTimerCoordinator.h"
48 #include "core/frame/Deprecation.h" 48 #include "core/frame/Deprecation.h"
49 #include "core/frame/LocalDOMWindow.h" 49 #include "core/frame/LocalDOMWindow.h"
50 #include "core/inspector/ConsoleMessage.h" 50 #include "core/inspector/ConsoleMessage.h"
51 #include "core/inspector/IdentifiersFactory.h"
52 #include "core/inspector/InspectorInstrumentation.h" 51 #include "core/inspector/InspectorInstrumentation.h"
53 #include "core/inspector/WorkerInspectorController.h" 52 #include "core/inspector/WorkerInspectorController.h"
54 #include "core/inspector/WorkerThreadDebugger.h" 53 #include "core/inspector/WorkerThreadDebugger.h"
55 #include "core/loader/WorkerThreadableLoader.h" 54 #include "core/loader/WorkerThreadableLoader.h"
56 #include "core/workers/WorkerClients.h" 55 #include "core/workers/WorkerClients.h"
57 #include "core/workers/WorkerLoaderProxy.h" 56 #include "core/workers/WorkerLoaderProxy.h"
58 #include "core/workers/WorkerLocation.h" 57 #include "core/workers/WorkerLocation.h"
59 #include "core/workers/WorkerNavigator.h" 58 #include "core/workers/WorkerNavigator.h"
60 #include "core/workers/WorkerReportingProxy.h" 59 #include "core/workers/WorkerReportingProxy.h"
61 #include "core/workers/WorkerScriptLoader.h" 60 #include "core/workers/WorkerScriptLoader.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 void WorkerGlobalScope::addConsoleMessage(ConsoleMessage* consoleMessage) 274 void WorkerGlobalScope::addConsoleMessage(ConsoleMessage* consoleMessage)
276 { 275 {
277 DCHECK(isContextThread()); 276 DCHECK(isContextThread());
278 thread()->workerReportingProxy().reportConsoleMessage(consoleMessage); 277 thread()->workerReportingProxy().reportConsoleMessage(consoleMessage);
279 addMessageToWorkerConsole(consoleMessage); 278 addMessageToWorkerConsole(consoleMessage);
280 } 279 }
281 280
282 void WorkerGlobalScope::addMessageToWorkerConsole(ConsoleMessage* consoleMessage ) 281 void WorkerGlobalScope::addMessageToWorkerConsole(ConsoleMessage* consoleMessage )
283 { 282 {
284 DCHECK(isContextThread()); 283 DCHECK(isContextThread());
285 WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread()->isolat e()); 284 if (WorkerThreadDebugger* debugger = WorkerThreadDebugger::from(thread()->is olate()))
286 if (!debugger) 285 debugger->addConsoleMessage(consoleMessage);
287 return;
288 debugger->debugger()->addConsoleMessage(
289 debugger->contextGroupId(),
290 consoleMessage->source(),
291 consoleMessage->level(),
292 consoleMessage->message(),
293 consoleMessage->location()->url(),
294 consoleMessage->location()->lineNumber(),
295 consoleMessage->location()->columnNumber(),
296 consoleMessage->location()->cloneStackTrace(),
297 consoleMessage->location()->scriptId(),
298 IdentifiersFactory::requestId(consoleMessage->requestIdentifier()),
299 consoleMessage->workerId());
300 } 286 }
301 287
302 bool WorkerGlobalScope::isContextThread() const 288 bool WorkerGlobalScope::isContextThread() const
303 { 289 {
304 return thread()->isCurrentThread(); 290 return thread()->isCurrentThread();
305 } 291 }
306 292
307 bool WorkerGlobalScope::isJSExecutionForbidden() const 293 bool WorkerGlobalScope::isJSExecutionForbidden() const
308 { 294 {
309 return m_scriptController->isExecutionForbidden(); 295 return m_scriptController->isExecutionForbidden();
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 visitor->trace(m_workerClients); 389 visitor->trace(m_workerClients);
404 visitor->trace(m_timers); 390 visitor->trace(m_timers);
405 visitor->trace(m_eventListeners); 391 visitor->trace(m_eventListeners);
406 ExecutionContext::trace(visitor); 392 ExecutionContext::trace(visitor);
407 EventTargetWithInlineData::trace(visitor); 393 EventTargetWithInlineData::trace(visitor);
408 SecurityContext::trace(visitor); 394 SecurityContext::trace(visitor);
409 Supplementable<WorkerGlobalScope>::trace(visitor); 395 Supplementable<WorkerGlobalScope>::trace(visitor);
410 } 396 }
411 397
412 } // namespace blink 398 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698