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

Unified Diff: webkit/glue/websocketstreamhandle_impl.cc

Issue 10668018: Websocket should fire 'error' event if no server available (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix some code styles issue Created 7 years, 8 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: webkit/glue/websocketstreamhandle_impl.cc
diff --git a/webkit/glue/websocketstreamhandle_impl.cc b/webkit/glue/websocketstreamhandle_impl.cc
index b7a95e87ba468a4a91a27acc29a0fe6efdff214f..ede3c67563bf019b1d968004a5ae94887fa6931a 100644
--- a/webkit/glue/websocketstreamhandle_impl.cc
+++ b/webkit/glue/websocketstreamhandle_impl.cc
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
tyoshino (SeeGerritForStatus) 2013/04/17 08:15:49 include base/string16.h
#include "third_party/WebKit/Source/Platform/chromium/public/WebData.h"
+#include "third_party/WebKit/Source/Platform/chromium/public/WebSocketStreamError.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebSocketStreamHandleClient.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebURL.h"
#include "webkit/glue/webkitplatformsupport_impl.h"
@@ -20,6 +21,7 @@
#include "webkit/glue/websocketstreamhandle_delegate.h"
using WebKit::WebData;
+using WebKit::WebSocketStreamError;
using WebKit::WebSocketStreamHandle;
using WebKit::WebSocketStreamHandleClient;
using WebKit::WebURL;
@@ -54,6 +56,7 @@ class WebSocketStreamHandleImpl::Context
const char*,
int) OVERRIDE;
virtual void DidClose(WebSocketStreamHandle*) OVERRIDE;
+ virtual void DidFail(WebSocketStreamHandle*, int, const string16&);
private:
friend class base::RefCounted<Context>;
@@ -145,6 +148,18 @@ void WebSocketStreamHandleImpl::Context::DidClose(
Release();
}
+void WebSocketStreamHandleImpl::Context::DidFail(
+ WebSocketStreamHandle* web_handle,
+ int error_code,
+ const string16& error_msg) {
+ VLOG(1) << "DidFail";
+ if (client_) {
+ client_->didFail(
+ handle_,
+ WebSocketStreamError(error_code, error_msg));
+ }
+}
+
// WebSocketStreamHandleImpl ------------------------------------------------
WebSocketStreamHandleImpl::WebSocketStreamHandleImpl(

Powered by Google App Engine
This is Rietveld 408576698