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

Side by Side Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h

Issue 2646733003: XMLHttpRequest: Don't use nullness of isolatedWorldSecurityOrigin to determine whether or not it's … (Closed)
Patch Set: Rebase Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 DEFINE_ATTRIBUTE_EVENT_LISTENER(readystatechange); 164 DEFINE_ATTRIBUTE_EVENT_LISTENER(readystatechange);
165 165
166 // (Also) eagerly finalized so as to prevent access to the eagerly finalized 166 // (Also) eagerly finalized so as to prevent access to the eagerly finalized
167 // progress event throttle. 167 // progress event throttle.
168 EAGERLY_FINALIZE(); 168 EAGERLY_FINALIZE();
169 DECLARE_VIRTUAL_TRACE(); 169 DECLARE_VIRTUAL_TRACE();
170 DECLARE_TRACE_WRAPPERS(); 170 DECLARE_TRACE_WRAPPERS();
171 171
172 private: 172 private:
173 class BlobLoader; 173 class BlobLoader;
174 XMLHttpRequest(ExecutionContext*, PassRefPtr<SecurityOrigin>); 174 XMLHttpRequest(ExecutionContext*,
175 bool isIsolatedWorld,
176 PassRefPtr<SecurityOrigin>);
175 177
176 Document* document() const; 178 Document* document() const;
179
180 // Returns the SecurityOrigin of the isolated world if the XMLHttpRequest was
181 // created in an isolated world. Otherwise, returns the SecurityOrigin of the
182 // execution context.
177 SecurityOrigin* getSecurityOrigin() const; 183 SecurityOrigin* getSecurityOrigin() const;
178 184
179 void didSendData(unsigned long long bytesSent, 185 void didSendData(unsigned long long bytesSent,
180 unsigned long long totalBytesToBeSent) override; 186 unsigned long long totalBytesToBeSent) override;
181 void didReceiveResponse(unsigned long identifier, 187 void didReceiveResponse(unsigned long identifier,
182 const ResourceResponse&, 188 const ResourceResponse&,
183 std::unique_ptr<WebDataConsumerHandle>) override; 189 std::unique_ptr<WebDataConsumerHandle>) override;
184 void didReceiveData(const char* data, unsigned dataLength) override; 190 void didReceiveData(const char* data, unsigned dataLength) override;
185 // When responseType is set to "blob", didDownloadData() is called instead 191 // When responseType is set to "blob", didDownloadData() is called instead
186 // of didReceiveData(). 192 // of didReceiveData().
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 // An exception to throw in synchronous mode. It's set when failure 316 // An exception to throw in synchronous mode. It's set when failure
311 // notification is received from m_loader and thrown at the end of send() if 317 // notification is received from m_loader and thrown at the end of send() if
312 // any. 318 // any.
313 ExceptionCode m_exceptionCode; 319 ExceptionCode m_exceptionCode;
314 320
315 Member<XMLHttpRequestProgressEventThrottle> m_progressEventThrottle; 321 Member<XMLHttpRequestProgressEventThrottle> m_progressEventThrottle;
316 322
317 // An enum corresponding to the allowed string values for the responseType 323 // An enum corresponding to the allowed string values for the responseType
318 // attribute. 324 // attribute.
319 ResponseTypeCode m_responseTypeCode; 325 ResponseTypeCode m_responseTypeCode;
326
327 // Set to true if the XMLHttpRequest was created in an isolated world.
328 bool m_isIsolatedWorld;
329 // Stores the SecurityOrigin associated with the isolated world if any.
320 RefPtr<SecurityOrigin> m_isolatedWorldSecurityOrigin; 330 RefPtr<SecurityOrigin> m_isolatedWorldSecurityOrigin;
321 331
322 // This blob loader will be used if |m_downloadingToFile| is true and 332 // This blob loader will be used if |m_downloadingToFile| is true and
323 // |m_responseTypeCode| is NOT ResponseTypeBlob. 333 // |m_responseTypeCode| is NOT ResponseTypeBlob.
324 Member<BlobLoader> m_blobLoader; 334 Member<BlobLoader> m_blobLoader;
325 335
326 // Positive if we are dispatching events. 336 // Positive if we are dispatching events.
327 // This is an integer specifying the recursion level rather than a boolean 337 // This is an integer specifying the recursion level rather than a boolean
328 // because in some cases we have recursive dispatching. 338 // because in some cases we have recursive dispatching.
329 int m_eventDispatchRecursionLevel; 339 int m_eventDispatchRecursionLevel;
(...skipping 12 matching lines...) Expand all
342 bool m_downloadingToFile; 352 bool m_downloadingToFile;
343 bool m_responseTextOverflow; 353 bool m_responseTextOverflow;
344 bool m_sendFlag; 354 bool m_sendFlag;
345 }; 355 };
346 356
347 std::ostream& operator<<(std::ostream&, const XMLHttpRequest*); 357 std::ostream& operator<<(std::ostream&, const XMLHttpRequest*);
348 358
349 } // namespace blink 359 } // namespace blink
350 360
351 #endif // XMLHttpRequest_h 361 #endif // XMLHttpRequest_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698