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

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

Issue 419203004: DevTools: wrapping arguments addConsoleMessage in ConsoleMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@wrap-not-all-console-args
Patch Set: 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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 13 matching lines...) Expand all
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #include "config.h" 30 #include "config.h"
31 31
32 #include "core/workers/WorkerConsole.h" 32 #include "core/workers/WorkerConsole.h"
33 33
34 #include "core/inspector/ConsoleMessage.h"
34 #include "core/inspector/ScriptCallStack.h" 35 #include "core/inspector/ScriptCallStack.h"
35 #include "core/workers/WorkerGlobalScope.h" 36 #include "core/workers/WorkerGlobalScope.h"
36 #include "core/workers/WorkerReportingProxy.h" 37 #include "core/workers/WorkerReportingProxy.h"
37 #include "core/workers/WorkerThread.h" 38 #include "core/workers/WorkerThread.h"
38 39
39 40
40 namespace blink { 41 namespace blink {
41 42
42 WorkerConsole::WorkerConsole(WorkerGlobalScope* scope) 43 WorkerConsole::WorkerConsole(WorkerGlobalScope* scope)
43 : m_scope(scope) 44 : m_scope(scope)
44 { 45 {
45 ScriptWrappable::init(this); 46 ScriptWrappable::init(this);
46 } 47 }
47 48
48 WorkerConsole::~WorkerConsole() 49 WorkerConsole::~WorkerConsole()
49 { 50 {
50 } 51 }
51 52
52 void WorkerConsole::reportMessageToClient(MessageLevel level, const String& mess age, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack) 53 void WorkerConsole::reportMessageToClient(MessageLevel level, const String& mess age, PassRefPtrWillBeRawPtr<ScriptCallStack> callStack)
53 { 54 {
54 const ScriptCallFrame& lastCaller = callStack->at(0); 55 const ScriptCallFrame& lastCaller = callStack->at(0);
55 m_scope->thread()->workerReportingProxy().reportConsoleMessage(ConsoleAPIMes sageSource, level, message, lastCaller.lineNumber(), lastCaller.sourceURL()); 56 m_scope->thread()->workerReportingProxy().reportConsoleMessage(ConsoleMessag e::create(ConsoleAPIMessageSource, level, message, lastCaller.sourceURL(), lastC aller.lineNumber()));
56 } 57 }
57 58
58 ExecutionContext* WorkerConsole::context() 59 ExecutionContext* WorkerConsole::context()
59 { 60 {
60 if (!m_scope) 61 if (!m_scope)
61 return 0; 62 return 0;
62 return m_scope->executionContext(); 63 return m_scope->executionContext();
63 } 64 }
64 65
65 void WorkerConsole::trace(Visitor* visitor) 66 void WorkerConsole::trace(Visitor* visitor)
66 { 67 {
67 visitor->trace(m_scope); 68 visitor->trace(m_scope);
68 ConsoleBase::trace(visitor); 69 ConsoleBase::trace(visitor);
69 } 70 }
70 71
71 // FIXME: add memory getter 72 // FIXME: add memory getter
72 73
73 } // namespace blink 74 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/workers/SharedWorkerGlobalScope.cpp ('k') | Source/core/workers/WorkerGlobalScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698