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

Side by Side Diff: Source/core/xml/XMLHttpRequest.h

Issue 23005006: Fix XMLHttpRequest leak document when send() is called multiple times. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: check readyState == 4 to comply with change made in r156212 Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@nypop.com> 3 * Copyright (C) 2005, 2006 Alexey Proskuryakov <ap@nypop.com>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * Copyright (C) 2012 Intel Corporation 5 * Copyright (C) 2012 Intel Corporation
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public 8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 enum ResponseTypeCode { 69 enum ResponseTypeCode {
70 ResponseTypeDefault, 70 ResponseTypeDefault,
71 ResponseTypeText, 71 ResponseTypeText,
72 ResponseTypeJSON, 72 ResponseTypeJSON,
73 ResponseTypeDocument, 73 ResponseTypeDocument,
74 ResponseTypeBlob, 74 ResponseTypeBlob,
75 ResponseTypeArrayBuffer 75 ResponseTypeArrayBuffer
76 }; 76 };
77 77
78 enum DropProtection {
79 DropProtectionSync,
80 DropProtectionAsync,
81 };
82
78 virtual void contextDestroyed(); 83 virtual void contextDestroyed();
79 virtual void didTimeout(); 84 virtual void didTimeout();
80 virtual bool canSuspend() const; 85 virtual bool canSuspend() const;
81 virtual void suspend(ReasonForSuspension); 86 virtual void suspend(ReasonForSuspension);
82 virtual void resume(); 87 virtual void resume();
83 virtual void stop(); 88 virtual void stop();
84 89
85 virtual const AtomicString& interfaceName() const OVERRIDE; 90 virtual const AtomicString& interfaceName() const OVERRIDE;
86 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; 91 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
87 92
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 bool initSend(ExceptionState&); 167 bool initSend(ExceptionState&);
163 void sendBytesData(const void*, size_t, ExceptionState&); 168 void sendBytesData(const void*, size_t, ExceptionState&);
164 169
165 String getRequestHeader(const AtomicString& name) const; 170 String getRequestHeader(const AtomicString& name) const;
166 void setRequestHeaderInternal(const AtomicString& name, const String& value) ; 171 void setRequestHeaderInternal(const AtomicString& name, const String& value) ;
167 172
168 void changeState(State newState); 173 void changeState(State newState);
169 void callReadyStateChangeListener(); 174 void callReadyStateChangeListener();
170 void dropProtectionSoon(); 175 void dropProtectionSoon();
171 void dropProtection(Timer<XMLHttpRequest>* = 0); 176 void dropProtection(Timer<XMLHttpRequest>* = 0);
172 void internalAbort(); 177 void internalAbort(DropProtection = DropProtectionSync);
173 void clearResponse(); 178 void clearResponse();
174 void clearResponseBuffers(); 179 void clearResponseBuffers();
175 void clearRequest(); 180 void clearRequest();
176 181
177 void createRequest(ExceptionState&); 182 void createRequest(ExceptionState&);
178 183
179 void genericError(); 184 void genericError();
180 void networkError(); 185 void networkError();
181 void abortError(); 186 void abortError();
182 187
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 231
227 // An enum corresponding to the allowed string values for the responseType a ttribute. 232 // An enum corresponding to the allowed string values for the responseType a ttribute.
228 ResponseTypeCode m_responseTypeCode; 233 ResponseTypeCode m_responseTypeCode;
229 Timer<XMLHttpRequest> m_protectionTimer; 234 Timer<XMLHttpRequest> m_protectionTimer;
230 RefPtr<SecurityOrigin> m_securityOrigin; 235 RefPtr<SecurityOrigin> m_securityOrigin;
231 }; 236 };
232 237
233 } // namespace WebCore 238 } // namespace WebCore
234 239
235 #endif // XMLHttpRequest_h 240 #endif // XMLHttpRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698