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

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

Issue 466753002: DevTools: Do not push to frontend messages from worker while it is alive (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix test 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 : m_source(source) 49 : m_source(source)
50 , m_type(type) 50 , m_type(type)
51 , m_level(level) 51 , m_level(level)
52 , m_message(message) 52 , m_message(message)
53 , m_scriptState(0) 53 , m_scriptState(0)
54 , m_url() 54 , m_url()
55 , m_line(0) 55 , m_line(0)
56 , m_column(0) 56 , m_column(0)
57 , m_requestId(IdentifiersFactory::requestId(0)) 57 , m_requestId(IdentifiersFactory::requestId(0))
58 , m_timestamp(WTF::currentTime()) 58 , m_timestamp(WTF::currentTime())
59 , m_workerProxy(nullptr)
59 { 60 {
60 autogenerateMetadata(); 61 autogenerateMetadata();
61 } 62 }
62 63
63 InspectorConsoleMessage::InspectorConsoleMessage(bool shouldGenerateCallStack, M essageSource source, MessageType type, MessageLevel level, const String& message , const String& url, unsigned line, unsigned column, ScriptState* scriptState, u nsigned long requestIdentifier) 64 InspectorConsoleMessage::InspectorConsoleMessage(bool shouldGenerateCallStack, M essageSource source, MessageType type, MessageLevel level, const String& message , const String& url, unsigned line, unsigned column, ScriptState* scriptState, u nsigned long requestIdentifier)
64 : m_source(source) 65 : m_source(source)
65 , m_type(type) 66 , m_type(type)
66 , m_level(level) 67 , m_level(level)
67 , m_message(message) 68 , m_message(message)
68 , m_scriptState(scriptState) 69 , m_scriptState(scriptState)
69 , m_url(url) 70 , m_url(url)
70 , m_line(line) 71 , m_line(line)
71 , m_column(column) 72 , m_column(column)
72 , m_requestId(IdentifiersFactory::requestId(requestIdentifier)) 73 , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
73 , m_timestamp(WTF::currentTime()) 74 , m_timestamp(WTF::currentTime())
75 , m_workerProxy(nullptr)
74 { 76 {
75 autogenerateMetadata(shouldGenerateCallStack); 77 autogenerateMetadata(shouldGenerateCallStack);
76 } 78 }
77 79
78 InspectorConsoleMessage::InspectorConsoleMessage(MessageSource source, MessageTy pe type, MessageLevel level, const String& message, PassRefPtrWillBeRawPtr<Scrip tCallStack> callStack, unsigned long requestIdentifier) 80 InspectorConsoleMessage::InspectorConsoleMessage(MessageSource source, MessageTy pe type, MessageLevel level, const String& message, PassRefPtrWillBeRawPtr<Scrip tCallStack> callStack, unsigned long requestIdentifier)
79 : m_source(source) 81 : m_source(source)
80 , m_type(type) 82 , m_type(type)
81 , m_level(level) 83 , m_level(level)
82 , m_message(message) 84 , m_message(message)
83 , m_scriptState(0) 85 , m_scriptState(0)
84 , m_arguments(nullptr) 86 , m_arguments(nullptr)
85 , m_callStack(callStack) 87 , m_callStack(callStack)
86 , m_line(0) 88 , m_line(0)
87 , m_column(0) 89 , m_column(0)
88 , m_requestId(IdentifiersFactory::requestId(requestIdentifier)) 90 , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
89 , m_timestamp(WTF::currentTime()) 91 , m_timestamp(WTF::currentTime())
92 , m_workerProxy(nullptr)
90 { 93 {
91 autogenerateMetadata(false); 94 autogenerateMetadata(false);
92 } 95 }
93 96
94 InspectorConsoleMessage::InspectorConsoleMessage(MessageSource source, MessageTy pe type, MessageLevel level, const String& message, PassRefPtrWillBeRawPtr<Scrip tArguments> arguments, ScriptState* scriptState, unsigned long requestIdentifier ) 97 InspectorConsoleMessage::InspectorConsoleMessage(MessageSource source, MessageTy pe type, MessageLevel level, const String& message, PassRefPtrWillBeRawPtr<Scrip tArguments> arguments, ScriptState* scriptState, unsigned long requestIdentifier )
95 : m_source(source) 98 : m_source(source)
96 , m_type(type) 99 , m_type(type)
97 , m_level(level) 100 , m_level(level)
98 , m_message(message) 101 , m_message(message)
99 , m_scriptState(scriptState) 102 , m_scriptState(scriptState)
100 , m_arguments(arguments) 103 , m_arguments(arguments)
101 , m_url() 104 , m_url()
102 , m_line(0) 105 , m_line(0)
103 , m_column(0) 106 , m_column(0)
104 , m_requestId(IdentifiersFactory::requestId(requestIdentifier)) 107 , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
105 , m_timestamp(WTF::currentTime()) 108 , m_timestamp(WTF::currentTime())
109 , m_workerProxy(nullptr)
106 { 110 {
107 autogenerateMetadata(); 111 autogenerateMetadata();
108 } 112 }
109 113
110 InspectorConsoleMessage::~InspectorConsoleMessage() 114 InspectorConsoleMessage::~InspectorConsoleMessage()
111 { 115 {
112 } 116 }
113 117
114 void InspectorConsoleMessage::autogenerateMetadata(bool shouldGenerateCallStack) 118 void InspectorConsoleMessage::autogenerateMetadata(bool shouldGenerateCallStack)
115 { 119 {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 case LogMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::Lo g; 176 case LogMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::Lo g;
173 case WarningMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level ::Warning; 177 case WarningMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level ::Warning;
174 case ErrorMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level:: Error; 178 case ErrorMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level:: Error;
175 case InfoMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::I nfo; 179 case InfoMessageLevel: return TypeBuilder::Console::ConsoleMessage::Level::I nfo;
176 } 180 }
177 return TypeBuilder::Console::ConsoleMessage::Level::Log; 181 return TypeBuilder::Console::ConsoleMessage::Level::Log;
178 } 182 }
179 183
180 void InspectorConsoleMessage::addToFrontend(InspectorFrontend::Console* frontend , InjectedScriptManager* injectedScriptManager, bool generatePreview) 184 void InspectorConsoleMessage::addToFrontend(InspectorFrontend::Console* frontend , InjectedScriptManager* injectedScriptManager, bool generatePreview)
181 { 185 {
186 if (m_workerProxy)
187 return;
188
182 RefPtr<TypeBuilder::Console::ConsoleMessage> jsonObj = TypeBuilder::Console: :ConsoleMessage::create() 189 RefPtr<TypeBuilder::Console::ConsoleMessage> jsonObj = TypeBuilder::Console: :ConsoleMessage::create()
183 .setSource(messageSourceValue(m_source)) 190 .setSource(messageSourceValue(m_source))
184 .setLevel(messageLevelValue(m_level)) 191 .setLevel(messageLevelValue(m_level))
185 .setText(m_message) 192 .setText(m_message)
186 .setTimestamp(m_timestamp); 193 .setTimestamp(m_timestamp);
187 // FIXME: only send out type for ConsoleAPI source messages. 194 // FIXME: only send out type for ConsoleAPI source messages.
188 jsonObj->setType(messageTypeValue(m_type)); 195 jsonObj->setType(messageTypeValue(m_type));
189 jsonObj->setLine(static_cast<int>(m_line)); 196 jsonObj->setLine(static_cast<int>(m_line));
190 jsonObj->setColumn(static_cast<int>(m_column)); 197 jsonObj->setColumn(static_cast<int>(m_column));
191 jsonObj->setUrl(m_url); 198 jsonObj->setUrl(m_url);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 252 }
246 253
247 unsigned InspectorConsoleMessage::argumentCount() 254 unsigned InspectorConsoleMessage::argumentCount()
248 { 255 {
249 if (m_arguments) 256 if (m_arguments)
250 return m_arguments->argumentCount(); 257 return m_arguments->argumentCount();
251 return 0; 258 return 0;
252 } 259 }
253 260
254 } // namespace blink 261 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorConsoleMessage.h ('k') | Source/core/inspector/InspectorInstrumentation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698