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

Unified Diff: content/child/appcache/web_application_cache_host_impl.cc

Issue 164933002: Expose details for appcache error events [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-up Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/child/appcache/web_application_cache_host_impl.cc
diff --git a/content/child/appcache/web_application_cache_host_impl.cc b/content/child/appcache/web_application_cache_host_impl.cc
index 7d5f47b92fca08af60bbb154b968ccd4e6bd9261..b084e0dbe4a56b8b4228f0b5c213d4cc39cb07c1 100644
--- a/content/child/appcache/web_application_cache_host_impl.cc
+++ b/content/child/appcache/web_application_cache_host_impl.cc
@@ -8,12 +8,14 @@
#include "base/id_map.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "third_party/WebKit/public/platform/WebURLResponse.h"
using blink::WebApplicationCacheHost;
using blink::WebApplicationCacheHostClient;
+using blink::WebString;
using blink::WebURLRequest;
using blink::WebURL;
using blink::WebURLResponse;
@@ -132,8 +134,10 @@ void WebApplicationCacheHostImpl::OnProgressEventRaised(
client_->notifyProgressEventListener(url, num_total, num_complete);
}
-void WebApplicationCacheHostImpl::OnErrorEventRaised(
- const std::string& message) {
+void WebApplicationCacheHostImpl::OnErrorEventRaised(const std::string& message,
+ const std::string& reason,
+ const GURL& url,
+ int status) {
// Emit logging output prior to calling out to script as we can get
// deleted within the script event handler.
const char* kFormatString = "Application Cache Error event: %s";
@@ -142,7 +146,7 @@ void WebApplicationCacheHostImpl::OnErrorEventRaised(
OnLogMessage(appcache::LOG_ERROR, full_message);
status_ = cache_info_.is_complete ? appcache::IDLE : appcache::UNCACHED;
- client_->notifyEventListener(static_cast<EventID>(appcache::ERROR_EVENT));
+ client_->notifyErrorEventListener(WebString::fromUTF8(reason), url, status);
}
void WebApplicationCacheHostImpl::willStartMainResourceRequest(

Powered by Google App Engine
This is Rietveld 408576698