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

Side by Side Diff: sky/engine/core/html/imports/HTMLImportLoader.cpp

Issue 711513003: Make import failures log errors (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: moar lceanup Created 6 years, 1 month 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #endif 74 #endif
75 75
76 void HTMLImportLoader::startLoading(const KURL& url) 76 void HTMLImportLoader::startLoading(const KURL& url)
77 { 77 {
78 m_fetcher = adoptPtr(new MojoFetcher(this, url)); 78 m_fetcher = adoptPtr(new MojoFetcher(this, url));
79 } 79 }
80 80
81 void HTMLImportLoader::OnReceivedResponse(mojo::URLResponsePtr response) 81 void HTMLImportLoader::OnReceivedResponse(mojo::URLResponsePtr response)
82 { 82 {
83 if (response->error || response->status_code >= 400) { 83 if (response->error || response->status_code >= 400) {
84 // FIXME: Consider refactoring to use FrameConsole::reportResourceRespon seReceived
85 String message = "Failed to load resource: the server responded with a s tatus of " + String::number(response->status_code) + " (" + response->status_lin e.data() + ')';
86 RefPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(NetworkMe ssageSource, ErrorMessageLevel, message, response->url.data());
87 m_controller->master()->addMessage(consoleMessage);
84 setState(StateError); 88 setState(StateError);
85 return; 89 return;
86 } 90 }
87 setState(startWritingAndParsing(response.Pass())); 91 setState(startWritingAndParsing(response.Pass()));
88 } 92 }
89 93
90 HTMLImportLoader::State HTMLImportLoader::startWritingAndParsing(mojo::URLRespon sePtr response) 94 HTMLImportLoader::State HTMLImportLoader::startWritingAndParsing(mojo::URLRespon sePtr response)
91 { 95 {
92 ASSERT(!m_imports.isEmpty()); 96 ASSERT(!m_imports.isEmpty());
93 KURL url(ParsedURLString, String::fromUTF8(response->url)); 97 KURL url(ParsedURLString, String::fromUTF8(response->url));
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 { 195 {
192 visitor->trace(m_controller); 196 visitor->trace(m_controller);
193 #if ENABLE(OILPAN) 197 #if ENABLE(OILPAN)
194 visitor->trace(m_imports); 198 visitor->trace(m_imports);
195 #endif 199 #endif
196 visitor->trace(m_document); 200 visitor->trace(m_document);
197 visitor->trace(m_microtaskQueue); 201 visitor->trace(m_microtaskQueue);
198 } 202 }
199 203
200 } // namespace blink 204 } // namespace blink
OLDNEW
« sky/engine/core/frame/FrameConsole.cpp ('K') | « sky/engine/core/frame/FrameConsole.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698