Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
| 37 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
| 38 #include "wtf/Vector.h" | 38 #include "wtf/Vector.h" |
| 39 #include "wtf/text/AtomicStringHash.h" | 39 #include "wtf/text/AtomicStringHash.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 class ExecutionContext; | 43 class ExecutionContext; |
| 44 class XMLHttpRequest; | 44 class XMLHttpRequest; |
| 45 | 45 |
| 46 class XMLHttpRequestUpload FINAL : public ScriptWrappable, public XMLHttpRequest EventTarget { | 46 class XMLHttpRequestUpload FINAL : public NoBaseWillBeRefCountedGarbageCollected <XMLHttpRequestUpload>, public ScriptWrappable, public XMLHttpRequestEventTarget { |
| 47 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(XMLHttpRequestUpload); | |
| 47 public: | 48 public: |
| 48 static PassOwnPtr<XMLHttpRequestUpload> create(XMLHttpRequest* xmlHttpReques t) | 49 static PassOwnPtrWillBeRawPtr<XMLHttpRequestUpload> create(XMLHttpRequest* x mlHttpRequest) |
| 49 { | 50 { |
| 50 return adoptPtr(new XMLHttpRequestUpload(xmlHttpRequest)); | 51 return adoptPtrWillBeRefCountedGarbageCollected(new XMLHttpRequestUpload (xmlHttpRequest)); |
| 51 } | 52 } |
| 52 | 53 |
| 54 #if ENABLE(OILPAN) | |
| 55 using RefCountedGarbageCollected::ref; | |
| 56 using RefCountedGarbageCollected::deref; | |
| 57 #else | |
| 53 void ref() { m_xmlHttpRequest->ref(); } | 58 void ref() { m_xmlHttpRequest->ref(); } |
| 54 void deref() { m_xmlHttpRequest->deref(); } | 59 void deref() { m_xmlHttpRequest->deref(); } |
| 60 #endif | |
|
haraken
2014/05/27 01:39:19
Can we avoid writing this by using DEFINE_EVENT_TA
zerny-chromium
2014/05/27 07:34:33
Ditto here.
| |
| 61 | |
| 55 XMLHttpRequest* xmlHttpRequest() const { return m_xmlHttpRequest; } | 62 XMLHttpRequest* xmlHttpRequest() const { return m_xmlHttpRequest; } |
| 56 | 63 |
| 57 virtual const AtomicString& interfaceName() const OVERRIDE; | 64 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 58 virtual ExecutionContext* executionContext() const OVERRIDE; | 65 virtual ExecutionContext* executionContext() const OVERRIDE; |
| 59 | 66 |
| 60 void dispatchEventAndLoadEnd(const AtomicString&, bool, unsigned long long, unsigned long long); | 67 void dispatchEventAndLoadEnd(const AtomicString&, bool, unsigned long long, unsigned long long); |
| 61 void dispatchProgressEvent(unsigned long long, unsigned long long); | 68 void dispatchProgressEvent(unsigned long long, unsigned long long); |
| 62 | 69 |
| 63 void handleRequestError(const AtomicString&); | 70 void handleRequestError(const AtomicString&); |
| 64 | 71 |
| 72 virtual void trace(Visitor*) OVERRIDE; | |
| 73 | |
| 65 private: | 74 private: |
| 66 explicit XMLHttpRequestUpload(XMLHttpRequest*); | 75 explicit XMLHttpRequestUpload(XMLHttpRequest*); |
| 67 | 76 |
| 68 virtual void refEventTarget() OVERRIDE { ref(); } | 77 virtual void refEventTarget() OVERRIDE { ref(); } |
| 69 virtual void derefEventTarget() OVERRIDE { deref(); } | 78 virtual void derefEventTarget() OVERRIDE { deref(); } |
| 70 | 79 |
| 71 XMLHttpRequest* m_xmlHttpRequest; | 80 RawPtrWillBeMember<XMLHttpRequest> m_xmlHttpRequest; |
| 72 EventTargetData m_eventTargetData; | 81 EventTargetData m_eventTargetData; |
| 73 | 82 |
| 74 // Last progress event values; used when issuing the | 83 // Last progress event values; used when issuing the |
| 75 // required 'progress' event on a request error or abort. | 84 // required 'progress' event on a request error or abort. |
| 76 unsigned long long m_lastBytesSent; | 85 unsigned long long m_lastBytesSent; |
| 77 unsigned long long m_lastTotalBytesToBeSent; | 86 unsigned long long m_lastTotalBytesToBeSent; |
| 78 }; | 87 }; |
| 79 | 88 |
| 80 } // namespace WebCore | 89 } // namespace WebCore |
| 81 | 90 |
| 82 #endif // XMLHttpRequestUpload_h | 91 #endif // XMLHttpRequestUpload_h |
| OLD | NEW |