| 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 "../platform/WebCommon.h" | |
| 35 #include "WebNavigationType.h" | |
| 36 #include "WebTextDirection.h" | |
| 37 | |
| 38 namespace WebKit { | |
| 39 | |
| 40 class WebApplicationCacheHost; | |
| 41 class WebString; | |
| 42 class WebURL; | |
| 43 class WebURLRequest; | |
| 44 class WebURLResponse; | |
| 45 template <typename T> class WebVector; | |
| 46 | |
| 47 class WebDataSource { | |
| 48 public: | |
| 49 class ExtraData { | |
| 50 public: | |
| 51 virtual ~ExtraData() { } | |
| 52 }; | |
| 53 | |
| 54 // Returns the original request that resulted in this datasource. | |
| 55 virtual const WebURLRequest& originalRequest() const = 0; | |
| 56 | |
| 57 // Returns the request corresponding to this datasource. It may | |
| 58 // include additional request headers added by WebKit that were not | |
| 59 // present in the original request. This request may also correspond | |
| 60 // to a location specified by a redirect that was followed. | |
| 61 virtual const WebURLRequest& request() const = 0; | |
| 62 | |
| 63 // Returns the response associated with this datasource. | |
| 64 virtual const WebURLResponse& response() const = 0; | |
| 65 | |
| 66 // When this datasource was created as a result of WebFrame::loadData, | |
| 67 // there may be an associated unreachableURL. | |
| 68 virtual bool hasUnreachableURL() const = 0; | |
| 69 virtual WebURL unreachableURL() const = 0; | |
| 70 | |
| 71 // Returns all redirects that occurred (both client and server) before | |
| 72 // at last committing the current page. This will contain one entry | |
| 73 // for each intermediate URL, and one entry for the last URL (so if | |
| 74 // there are no redirects, it will contain exactly the current URL, and | |
| 75 // if there is one redirect, it will contain the source and destination | |
| 76 // URL). | |
| 77 virtual void redirectChain(WebVector<WebURL>&) const = 0; | |
| 78 | |
| 79 // Returns whether the navigation associated with this datasource is a | |
| 80 // client redirect that should replace the current history item. | |
| 81 virtual bool isClientRedirect() const = 0; | |
| 82 | |
| 83 // Returns the title for the current page. | |
| 84 virtual WebString pageTitle() const = 0; | |
| 85 | |
| 86 // Returns the text direction of the title for the current page. | |
| 87 virtual WebTextDirection pageTitleDirection() const = 0; | |
| 88 | |
| 89 // The type of navigation that triggered the creation of this datasource. | |
| 90 virtual WebNavigationType navigationType() const = 0; | |
| 91 | |
| 92 // The time in seconds (since the epoch) of the event that triggered | |
| 93 // the creation of this datasource. Returns 0 if unknown. | |
| 94 virtual double triggeringEventTime() const = 0; | |
| 95 | |
| 96 // Extra data associated with this datasource. If non-null, the extra | |
| 97 // data pointer will be deleted when the datasource is destroyed. | |
| 98 // Setting the extra data pointer will cause any existing non-null | |
| 99 // extra data pointer to be deleted. | |
| 100 virtual ExtraData* extraData() const = 0; | |
| 101 virtual void setExtraData(ExtraData*) = 0; | |
| 102 | |
| 103 // The application cache host associated with this datasource. | |
| 104 virtual WebApplicationCacheHost* applicationCacheHost() = 0; | |
| 105 | |
| 106 // Set deferMainResourceDataLoad flag on the loader. This is used for | |
| 107 // testing. | |
| 108 virtual void setDeferMainResourceDataLoad(bool) = 0; | |
| 109 | |
| 110 // Sets the navigation start time for this datasource. Ordinarily, | |
| 111 // navigation start is determined in WebCore. But, in some situations, | |
| 112 // the embedder might have a better value and can override it here. This | |
| 113 // should be called before WebFrameClient::didCommitProvisionalLoad. | |
| 114 // Calling it later may confuse users, because JavaScript may have run and | |
| 115 // the user may have already recorded the original value. | |
| 116 virtual void setNavigationStartTime(double) = 0; | |
| 117 | |
| 118 protected: | |
| 119 ~WebDataSource() { } | |
| 120 }; | |
| 121 | |
| 122 } // namespace WebKit | |
| 123 | |
| 124 #endif | |
| OLD | NEW |