| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014, Opera Software ASA. All rights reserved. | 2 * Copyright (c) 2014, Opera Software ASA. 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 |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * 3. Neither the name of Opera Software ASA nor the names of its | 12 * 3. Neither the name of Opera Software ASA nor the names of its |
| 13 * contributors may be used to endorse or promote products derived | 13 * contributors may be used to endorse or promote products derived |
| 14 * from this software without specific prior written permission. | 14 * from this software without specific prior written permission. |
| 15 * | 15 * |
| 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 19 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | 19 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 20 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | 20 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
| 21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 27 * OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #ifndef SharedWorkerPerformance_h | 30 #ifndef DOMURLSearchParams_h |
| 31 #define SharedWorkerPerformance_h | 31 #define DOMURLSearchParams_h |
| 32 | 32 |
| 33 #include "platform/Supplementable.h" | 33 #include "bindings/v8/ScriptWrappable.h" |
| 34 #include "wtf/Forward.h" |
| 35 #include "wtf/RefCounted.h" |
| 36 #include "wtf/text/WTFString.h" |
| 37 #include <utility> |
| 34 | 38 |
| 35 namespace WebCore { | 39 namespace WebCore { |
| 36 | 40 |
| 37 class ExecutionContext; | 41 class DOMURLUtils; |
| 38 class SharedWorker; | |
| 39 | 42 |
| 40 class SharedWorkerPerformance FINAL : public Supplement<SharedWorker> { | 43 class DOMURLSearchParams : public ScriptWrappable, public RefCounted<DOMURLSearc
hParams> { |
| 41 public: | 44 public: |
| 42 virtual ~SharedWorkerPerformance(); | 45 static PassRefPtr<DOMURLSearchParams> create(const String& = String()); |
| 43 static SharedWorkerPerformance* from(SharedWorker*); | 46 static PassRefPtr<DOMURLSearchParams> create(DOMURLSearchParams*); |
| 44 | 47 |
| 45 static double workerStart(ExecutionContext*, SharedWorker*); | 48 String toString() const; |
| 46 double getWorkerStart(ExecutionContext*, SharedWorker*) const; | 49 |
| 50 void appendNameValue(const String& name, const String& value); |
| 51 void deleteAllWithName(const String&); |
| 52 String getFirstValue(const String&) const; |
| 53 |
| 54 Vector<String> getAllValues(const String&) const; |
| 55 bool hasName(const String&) const; |
| 56 void setNameValue(const String& name, const String& value); |
| 57 |
| 58 void setInput(const String&); |
| 59 |
| 60 void setURLObject(DOMURLUtils* urlObject) { m_urlObject = urlObject; } |
| 61 DOMURLUtils* getURLObject() const { return m_urlObject; } |
| 47 | 62 |
| 48 private: | 63 private: |
| 49 explicit SharedWorkerPerformance(); | 64 DOMURLSearchParams(); |
| 50 static const char* supplementName(); | |
| 51 | 65 |
| 52 double m_timeOrigin; | 66 void runUpdateSteps(); |
| 67 |
| 68 Vector<std::pair<String, String> > m_params; |
| 69 |
| 70 // See FIXME in DOMURLUtils::setSearchParams() regarding the |
| 71 // handling of this reference to the URL object. |
| 72 DOMURLUtils* m_urlObject; |
| 73 bool m_isUpdating; |
| 53 }; | 74 }; |
| 54 | 75 |
| 55 } // namespace WebCore | 76 } // namespace WebCore |
| 56 | 77 |
| 57 #endif // SharedWorkerPerformance_h | 78 #endif // DOMURLSearchParams_h |
| OLD | NEW |