OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (!location->IsUnknown() && | 98 if (!location->IsUnknown() && |
99 frame_->GetChromeClient().ShouldReportDetailedMessageForSource(*frame_, | 99 frame_->GetChromeClient().ShouldReportDetailedMessageForSource(*frame_, |
100 url)) | 100 url)) |
101 stack_trace = location->ToString(); | 101 stack_trace = location->ToString(); |
102 } | 102 } |
103 | 103 |
104 frame_->GetChromeClient().AddMessageToConsole( | 104 frame_->GetChromeClient().AddMessageToConsole( |
105 frame_, source, level, message, location->LineNumber(), url, stack_trace); | 105 frame_, source, level, message, location->LineNumber(), url, stack_trace); |
106 } | 106 } |
107 | 107 |
108 void FrameConsole::AddMessageFromWorker( | |
109 MessageLevel level, | |
110 const String& message, | |
111 std::unique_ptr<SourceLocation> location, | |
112 const String& worker_id) { | |
113 ReportMessageToClient(kWorkerMessageSource, level, message, location.get()); | |
114 AddMessageToStorage(ConsoleMessage::CreateFromWorker( | |
115 level, message, std::move(location), worker_id)); | |
116 } | |
117 | |
118 void FrameConsole::AddSingletonMessage(ConsoleMessage* console_message) { | 108 void FrameConsole::AddSingletonMessage(ConsoleMessage* console_message) { |
119 if (singleton_messages_.Contains(console_message->Message())) | 109 if (singleton_messages_.Contains(console_message->Message())) |
120 return; | 110 return; |
121 singleton_messages_.insert(console_message->Message()); | 111 singleton_messages_.insert(console_message->Message()); |
122 AddMessage(console_message); | 112 AddMessage(console_message); |
123 } | 113 } |
124 | 114 |
125 void FrameConsole::ReportResourceResponseReceived( | 115 void FrameConsole::ReportResourceResponseReceived( |
126 DocumentLoader* loader, | 116 DocumentLoader* loader, |
127 unsigned long request_identifier, | 117 unsigned long request_identifier, |
(...skipping 27 matching lines...) Expand all Loading... |
155 AddMessageToStorage(ConsoleMessage::CreateForRequest( | 145 AddMessageToStorage(ConsoleMessage::CreateForRequest( |
156 kNetworkMessageSource, kErrorMessageLevel, message.ToString(), | 146 kNetworkMessageSource, kErrorMessageLevel, message.ToString(), |
157 error.FailingURL(), request_identifier)); | 147 error.FailingURL(), request_identifier)); |
158 } | 148 } |
159 | 149 |
160 DEFINE_TRACE(FrameConsole) { | 150 DEFINE_TRACE(FrameConsole) { |
161 visitor->Trace(frame_); | 151 visitor->Trace(frame_); |
162 } | 152 } |
163 | 153 |
164 } // namespace blink | 154 } // namespace blink |
OLD | NEW |