OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 { | 273 { |
274 if (loader->frame() != frame->page()->mainFrame()) | 274 if (loader->frame() != frame->page()->mainFrame()) |
275 return; | 275 return; |
276 reset(); | 276 reset(); |
277 } | 277 } |
278 | 278 |
279 void InspectorConsoleAgent::didFinishXHRLoading(XMLHttpRequest*, ThreadableLoade
rClient*, unsigned long requestIdentifier, ScriptString, const AtomicString& met
hod, const String& url, const String& sendURL, unsigned sendLineNumber) | 279 void InspectorConsoleAgent::didFinishXHRLoading(XMLHttpRequest*, ThreadableLoade
rClient*, unsigned long requestIdentifier, ScriptString, const AtomicString& met
hod, const String& url, const String& sendURL, unsigned sendLineNumber) |
280 { | 280 { |
281 if (m_frontend && m_state->getBoolean(ConsoleAgentState::monitoringXHR)) { | 281 if (m_frontend && m_state->getBoolean(ConsoleAgentState::monitoringXHR)) { |
282 String message = "XHR finished loading: " + method + " \"" + url + "\"."
; | 282 String message = "XHR finished loading: " + method + " \"" + url + "\"."
; |
283 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(NetworkMe
ssageSource, DebugMessageLevel, message, sendURL, sendLineNumber); | 283 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::crea
te(NetworkMessageSource, DebugMessageLevel, message, sendURL, sendLineNumber); |
284 consoleMessage->setRequestIdentifier(requestIdentifier); | 284 consoleMessage->setRequestIdentifier(requestIdentifier); |
285 addMessageToConsole(consoleMessage.get()); | 285 addMessageToConsole(consoleMessage.get()); |
286 } | 286 } |
287 } | 287 } |
288 | 288 |
289 void InspectorConsoleAgent::didReceiveResourceResponse(LocalFrame*, unsigned lon
g requestIdentifier, DocumentLoader* loader, const ResourceResponse& response, R
esourceLoader* resourceLoader) | 289 void InspectorConsoleAgent::didReceiveResourceResponse(LocalFrame*, unsigned lon
g requestIdentifier, DocumentLoader* loader, const ResourceResponse& response, R
esourceLoader* resourceLoader) |
290 { | 290 { |
291 if (!loader) | 291 if (!loader) |
292 return; | 292 return; |
293 if (response.httpStatusCode() >= 400) { | 293 if (response.httpStatusCode() >= 400) { |
294 String message = "Failed to load resource: the server responded with a s
tatus of " + String::number(response.httpStatusCode()) + " (" + response.httpSta
tusText() + ')'; | 294 String message = "Failed to load resource: the server responded with a s
tatus of " + String::number(response.httpStatusCode()) + " (" + response.httpSta
tusText() + ')'; |
295 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(NetworkMe
ssageSource, ErrorMessageLevel, message, response.url().string()); | 295 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::crea
te(NetworkMessageSource, ErrorMessageLevel, message, response.url().string()); |
296 consoleMessage->setRequestIdentifier(requestIdentifier); | 296 consoleMessage->setRequestIdentifier(requestIdentifier); |
297 addMessageToConsole(consoleMessage.get()); | 297 addMessageToConsole(consoleMessage.get()); |
298 } | 298 } |
299 } | 299 } |
300 | 300 |
301 void InspectorConsoleAgent::didFailLoading(unsigned long requestIdentifier, cons
t ResourceError& error) | 301 void InspectorConsoleAgent::didFailLoading(unsigned long requestIdentifier, cons
t ResourceError& error) |
302 { | 302 { |
303 if (error.isCancellation()) // Report failures only. | 303 if (error.isCancellation()) // Report failures only. |
304 return; | 304 return; |
305 StringBuilder message; | 305 StringBuilder message; |
306 message.appendLiteral("Failed to load resource"); | 306 message.appendLiteral("Failed to load resource"); |
307 if (!error.localizedDescription().isEmpty()) { | 307 if (!error.localizedDescription().isEmpty()) { |
308 message.appendLiteral(": "); | 308 message.appendLiteral(": "); |
309 message.append(error.localizedDescription()); | 309 message.append(error.localizedDescription()); |
310 } | 310 } |
311 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(NetworkMessag
eSource, ErrorMessageLevel, message.toString(), error.failingURL()); | 311 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(N
etworkMessageSource, ErrorMessageLevel, message.toString(), error.failingURL()); |
312 consoleMessage->setRequestIdentifier(requestIdentifier); | 312 consoleMessage->setRequestIdentifier(requestIdentifier); |
313 addMessageToConsole(consoleMessage.get()); | 313 addMessageToConsole(consoleMessage.get()); |
314 } | 314 } |
315 | 315 |
316 void InspectorConsoleAgent::setMonitoringXHREnabled(ErrorString*, bool enabled) | 316 void InspectorConsoleAgent::setMonitoringXHREnabled(ErrorString*, bool enabled) |
317 { | 317 { |
318 m_state->setBoolean(ConsoleAgentState::monitoringXHR, enabled); | 318 m_state->setBoolean(ConsoleAgentState::monitoringXHR, enabled); |
319 } | 319 } |
320 | 320 |
321 void InspectorConsoleAgent::addConsoleMessage(PassOwnPtr<InspectorConsoleMessage
> consoleMessage) | 321 void InspectorConsoleAgent::addConsoleMessage(PassOwnPtr<InspectorConsoleMessage
> consoleMessage) |
(...skipping 21 matching lines...) Expand all Loading... |
343 private: | 343 private: |
344 int m_heapObjectId; | 344 int m_heapObjectId; |
345 }; | 345 }; |
346 | 346 |
347 void InspectorConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHe
apObjectId) | 347 void InspectorConsoleAgent::addInspectedHeapObject(ErrorString*, int inspectedHe
apObjectId) |
348 { | 348 { |
349 m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(n
ew InspectableHeapObject(inspectedHeapObjectId))); | 349 m_injectedScriptManager->injectedScriptHost()->addInspectedObject(adoptPtr(n
ew InspectableHeapObject(inspectedHeapObjectId))); |
350 } | 350 } |
351 | 351 |
352 } // namespace blink | 352 } // namespace blink |
353 | |
OLD | NEW |