| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | |
| 3 * | |
| 4 * Redistribution and use in source and binary forms, with or without | |
| 5 * modification, are permitted provided that the following conditions are | |
| 6 * met: | |
| 7 * | |
| 8 * * Redistributions of source code must retain the above copyright | |
| 9 * notice, this list of conditions and the following disclaimer. | |
| 10 * * Redistributions in binary form must reproduce the above | |
| 11 * copyright notice, this list of conditions and the following disclaimer | |
| 12 * in the documentation and/or other materials provided with the | |
| 13 * distribution. | |
| 14 * * Neither the name of Google Inc. nor the names of its | |
| 15 * contributors may be used to endorse or promote products derived from | |
| 16 * this software without specific prior written permission. | |
| 17 * | |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 29 */ | |
| 30 | |
| 31 #ifndef WebDataSource_h | |
| 32 #define WebDataSource_h | |
| 33 | |
| 34 #include "WebCommon.h" | |
| 35 #include "WebNavigationType.h" | |
| 36 | |
| 37 namespace WebKit { | |
| 38 | |
| 39 class WebString; | |
| 40 class WebURL; | |
| 41 class WebURLRequest; | |
| 42 class WebURLResponse; | |
| 43 template <typename T> class WebVector; | |
| 44 | |
| 45 class WebDataSource { | |
| 46 public: | |
| 47 class ExtraData { | |
| 48 public: | |
| 49 virtual ~ExtraData() { } | |
| 50 }; | |
| 51 | |
| 52 // Returns the original request that resulted in this datasource. | |
| 53 virtual const WebURLRequest& originalRequest() const = 0; | |
| 54 | |
| 55 // Returns the request corresponding to this datasource. It may | |
| 56 // include additional request headers added by WebKit that were not | |
| 57 // present in the original request. This request may also correspond | |
| 58 // to a location specified by a redirect that was followed. | |
| 59 virtual const WebURLRequest& request() const = 0; | |
| 60 | |
| 61 // Returns the response associated with this datasource. | |
| 62 virtual const WebURLResponse& response() const = 0; | |
| 63 | |
| 64 // When this datasource was created as a result of WebFrame::loadData, | |
| 65 // there may be an associated unreachableURL. | |
| 66 virtual bool hasUnreachableURL() const = 0; | |
| 67 virtual WebURL unreachableURL() const = 0; | |
| 68 | |
| 69 // Returns all redirects that occurred (both client and server) before | |
| 70 // at last committing the current page. This will contain one entry | |
| 71 // for each intermediate URL, and one entry for the last URL (so if | |
| 72 // there are no redirects, it will contain exactly the current URL, and | |
| 73 // if there is one redirect, it will contain the source and destination | |
| 74 // URL). | |
| 75 virtual void redirectChain(WebVector<WebURL>&) const = 0; | |
| 76 | |
| 77 // Returns the title for the current page. | |
| 78 virtual WebString pageTitle() const = 0; | |
| 79 | |
| 80 // The type of navigation that triggered the creation of this datasource. | |
| 81 virtual WebNavigationType navigationType() const = 0; | |
| 82 | |
| 83 // The time in seconds (since the epoch) of the event that triggered | |
| 84 // the creation of this datasource. Returns 0 if unknown. | |
| 85 virtual double triggeringEventTime() const = 0; | |
| 86 | |
| 87 // Extra data associated with this datasource. If non-null, the extra | |
| 88 // data pointer will be deleted when the datasource is destroyed. | |
| 89 // Setting the extra data pointer will cause any existing non-null | |
| 90 // extra data pointer to be deleted. | |
| 91 virtual ExtraData* extraData() const = 0; | |
| 92 virtual void setExtraData(ExtraData*) = 0; | |
| 93 | |
| 94 protected: | |
| 95 ~WebDataSource() { } | |
| 96 }; | |
| 97 | |
| 98 } // namespace WebKit | |
| 99 | |
| 100 #endif | |
| OLD | NEW |