1 // Copyright 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CONTENT_PUBLIC_BROWSER_CONSOLE_MESSAGE_H_ 6 #define CONTENT_PUBLIC_BROWSER_CONSOLE_MESSAGE_H_ 7 8 #include "base/strings/string16.h" 9 #include "third_party/blink/public/mojom/devtools/console_message.mojom.h" 10 #include "url/gurl.h" 11 12 namespace content { 13 14 // A collection of information about a message that has been added to the 15 // console. 16 struct ConsoleMessage { ConsoleMessageConsoleMessage17 ConsoleMessage(blink::mojom::ConsoleMessageSource source, 18 blink::mojom::ConsoleMessageLevel message_level, 19 const base::string16& message, 20 int line_number, 21 const GURL& source_url) 22 : source(source), 23 message_level(message_level), 24 message(message), 25 line_number(line_number), 26 source_url(source_url) {} 27 28 // The type of source this came from. 29 const blink::mojom::ConsoleMessageSource source; 30 // The severity of the console message. 31 const blink::mojom::ConsoleMessageLevel message_level; 32 // The message that was logged to the console. 33 const base::string16 message; 34 // The line in the script file that the log was emitted at. 35 const int line_number; 36 // The URL that emitted the log. 37 const GURL source_url; 38 }; 39 40 } // namespace content 41 42 #endif // CONTENT_PUBLIC_BROWSER_CONSOLE_MESSAGE_H_ 43