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

Unified Diff: Source/modules/websockets/DOMWebSocket.h

Issue 337343002: IDL: make optional arguments (without default) explicit sometimes Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-default-arguments-next
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/modules/webaudio/AudioNode.idl ('k') | Source/modules/websockets/DOMWebSocket.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/DOMWebSocket.h
diff --git a/Source/modules/websockets/DOMWebSocket.h b/Source/modules/websockets/DOMWebSocket.h
index 4123e1602a4b41367e5125b2986af4cd0033de87..591ee85ac524a23b0b7146ce898675eafd98a281 100644
--- a/Source/modules/websockets/DOMWebSocket.h
+++ b/Source/modules/websockets/DOMWebSocket.h
@@ -31,6 +31,7 @@
#ifndef DOMWebSocket_h
#define DOMWebSocket_h
+#include "bindings/core/v8/Optional.h"
#include "core/dom/ActiveDOMObject.h"
#include "core/events/EventListener.h"
#include "modules/EventTargetModules.h"
@@ -56,7 +57,6 @@ public:
// DOMWebSocket instances must be used with a wrapper since this class's
// lifetime management is designed assuming the V8 holds a ref on it while
// hasPendingActivity() returns true.
- static DOMWebSocket* create(ExecutionContext*, const String& url, ExceptionState&);
static DOMWebSocket* create(ExecutionContext*, const String& url, const String& protocol, ExceptionState&);
static DOMWebSocket* create(ExecutionContext*, const String& url, const Vector<String>& protocols, ExceptionState&);
virtual ~DOMWebSocket();
@@ -75,14 +75,7 @@ public:
void send(ArrayBufferView*, ExceptionState&);
void send(Blob*, ExceptionState&);
- // To distinguish close method call with the code parameter from one
- // without, we have these three signatures. Use of
- // Optional=DefaultIsUndefined in the IDL file doesn't help for now since
- // it's bound to a value of 0 which is indistinguishable from the case 0
- // is passed as code parameter.
- void close(unsigned short code, const String& reason, ExceptionState&);
- void close(ExceptionState&);
- void close(unsigned short code, ExceptionState&);
+ void close(Optional<unsigned short> code, const String& reason, ExceptionState&);
const KURL& url() const;
State readyState() const;
« no previous file with comments | « Source/modules/webaudio/AudioNode.idl ('k') | Source/modules/websockets/DOMWebSocket.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698