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

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

Issue 464293002: [DevTools] ConsoleMessage storage moved from ConsoleAgent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@remove-can-generate
Patch Set: Rebased 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 : m_url(url) 82 : m_url(url)
83 , m_userAgent(userAgent) 83 , m_userAgent(userAgent)
84 , m_script(adoptPtr(new WorkerScriptController(*this))) 84 , m_script(adoptPtr(new WorkerScriptController(*this)))
85 , m_thread(thread) 85 , m_thread(thread)
86 , m_workerInspectorController(adoptRefWillBeNoop(new WorkerInspectorControll er(this))) 86 , m_workerInspectorController(adoptRefWillBeNoop(new WorkerInspectorControll er(this)))
87 , m_closing(false) 87 , m_closing(false)
88 , m_eventQueue(WorkerEventQueue::create(this)) 88 , m_eventQueue(WorkerEventQueue::create(this))
89 , m_workerClients(workerClients) 89 , m_workerClients(workerClients)
90 , m_timeOrigin(timeOrigin) 90 , m_timeOrigin(timeOrigin)
91 , m_terminationObserver(0) 91 , m_terminationObserver(0)
92 , m_messageStorage(ConsoleMessageStorage::create())
92 { 93 {
93 ScriptWrappable::init(this); 94 ScriptWrappable::init(this);
94 setClient(this); 95 setClient(this);
95 setSecurityOrigin(SecurityOrigin::create(url)); 96 setSecurityOrigin(SecurityOrigin::create(url));
96 m_workerClients->reattachThread(); 97 m_workerClients->reattachThread();
97 m_thread->setWorkerInspectorController(m_workerInspectorController.get()); 98 m_thread->setWorkerInspectorController(m_workerInspectorController.get());
98 } 99 }
99 100
100 WorkerGlobalScope::~WorkerGlobalScope() 101 WorkerGlobalScope::~WorkerGlobalScope()
101 { 102 {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 { 297 {
297 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = prpConsoleMessage; 298 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = prpConsoleMessage;
298 if (!isContextThread()) { 299 if (!isContextThread()) {
299 postTask(AddConsoleMessageTask::create(consoleMessage->source(), console Message->level(), consoleMessage->message())); 300 postTask(AddConsoleMessageTask::create(consoleMessage->source(), console Message->level(), consoleMessage->message()));
300 return; 301 return;
301 } 302 }
302 thread()->workerReportingProxy().reportConsoleMessage(consoleMessage); 303 thread()->workerReportingProxy().reportConsoleMessage(consoleMessage);
303 addMessageToWorkerConsole(consoleMessage.release()); 304 addMessageToWorkerConsole(consoleMessage.release());
304 } 305 }
305 306
306 void WorkerGlobalScope::addMessageToWorkerConsole(PassRefPtrWillBeRawPtr<Console Message> consoleMessage) 307 void WorkerGlobalScope::addMessageToWorkerConsole(PassRefPtrWillBeRawPtr<Console Message> prpConsoleMessage)
307 { 308 {
308 ASSERT(isContextThread()); 309 ASSERT(isContextThread());
310 RefPtr<ConsoleMessage> consoleMessage = prpConsoleMessage;
311 m_messageStorage->addMessage(consoleMessage);
309 InspectorInstrumentation::addMessageToConsole(this, consoleMessage.get()); 312 InspectorInstrumentation::addMessageToConsole(this, consoleMessage.get());
310 } 313 }
311 314
312 bool WorkerGlobalScope::isContextThread() const 315 bool WorkerGlobalScope::isContextThread() const
313 { 316 {
314 return thread()->isCurrentThread(); 317 return thread()->isCurrentThread();
315 } 318 }
316 319
317 bool WorkerGlobalScope::isJSExecutionForbidden() const 320 bool WorkerGlobalScope::isJSExecutionForbidden() const
318 { 321 {
(...skipping 13 matching lines...) Expand all
332 void WorkerGlobalScope::countFeature(UseCounter::Feature) const 335 void WorkerGlobalScope::countFeature(UseCounter::Feature) const
333 { 336 {
334 // FIXME: How should we count features for shared/service workers? 337 // FIXME: How should we count features for shared/service workers?
335 } 338 }
336 339
337 void WorkerGlobalScope::countDeprecation(UseCounter::Feature) const 340 void WorkerGlobalScope::countDeprecation(UseCounter::Feature) const
338 { 341 {
339 // FIXME: How should we count features for shared/service workers? 342 // FIXME: How should we count features for shared/service workers?
340 } 343 }
341 344
345 ConsoleMessageStorage* WorkerGlobalScope::messageStorage()
346 {
347 return m_messageStorage.get();
348 }
349
342 void WorkerGlobalScope::trace(Visitor* visitor) 350 void WorkerGlobalScope::trace(Visitor* visitor)
343 { 351 {
344 visitor->trace(m_console); 352 visitor->trace(m_console);
345 visitor->trace(m_location); 353 visitor->trace(m_location);
346 visitor->trace(m_navigator); 354 visitor->trace(m_navigator);
347 visitor->trace(m_workerInspectorController); 355 visitor->trace(m_workerInspectorController);
348 visitor->trace(m_eventQueue); 356 visitor->trace(m_eventQueue);
349 visitor->trace(m_workerClients); 357 visitor->trace(m_workerClients);
350 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); 358 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor);
351 ExecutionContext::trace(visitor); 359 ExecutionContext::trace(visitor);
352 EventTargetWithInlineData::trace(visitor); 360 EventTargetWithInlineData::trace(visitor);
353 } 361 }
354 362
355 } // namespace blink 363 } // namespace blink
OLDNEW
« Source/core/inspector/WorkerConsoleAgent.h ('K') | « Source/core/workers/WorkerGlobalScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698