summaryrefslogtreecommitdiffstats
path: root/webkit/api
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/api')
-rw-r--r--webkit/api/public/WebDataSource.h18
-rw-r--r--webkit/api/public/WebNavigationType.h8
-rw-r--r--webkit/api/public/WebVector.h17
-rw-r--r--webkit/api/src/WebURLRequest.cpp2
-rw-r--r--webkit/api/src/WebURLRequestPrivate.h4
-rw-r--r--webkit/api/src/WebURLResponse.cpp2
-rw-r--r--webkit/api/src/WrappedResourceRequest.h26
-rw-r--r--webkit/api/src/WrappedResourceResponse.h27
8 files changed, 67 insertions, 37 deletions
diff --git a/webkit/api/public/WebDataSource.h b/webkit/api/public/WebDataSource.h
index b163221..66681da 100644
--- a/webkit/api/public/WebDataSource.h
+++ b/webkit/api/public/WebDataSource.h
@@ -31,12 +31,11 @@
#ifndef WebDataSource_h
#define WebDataSource_h
-#error "This header file is still a work in progress; do not include!"
-
#include "WebCommon.h"
#include "WebNavigationType.h"
namespace WebKit {
+ class WebString;
class WebURL;
class WebURLRequest;
class WebURLResponse;
@@ -78,23 +77,18 @@ namespace WebKit {
virtual WebString pageTitle() const = 0;
// The type of navigation that triggered the creation of this datasource.
- virtual WebNavigationType triggeringActionNavigationType() const = 0;
+ virtual WebNavigationType navigationType() const = 0;
- // The time in seconds of the event that triggered the creation of this
- // datasource. This may be 0 if there was no triggering event.
- virtual double triggeringActionEventTime() const = 0;
+ // The time in seconds (since the epoch) of the event that triggered
+ // the creation of this datasource. Returns 0 if unknown.
+ virtual double triggeringEventTime() const = 0;
// Extra data associated with this datasource. If non-null, the extra
// data pointer will be deleted when the datasource is destroyed.
// Setting the extra data pointer will cause any existing non-null
// extra data pointer to be deleted.
virtual ExtraData* extraData() const = 0;
- virtual void SetExtraData(ExtraData*) = 0;
-
- // FIXME provide alternatives to:
- // GetSearchableFormData()
- // GetPasswordFormData()
- // IsFormSubmit()
+ virtual void setExtraData(ExtraData*) = 0;
};
} // namespace WebKit
diff --git a/webkit/api/public/WebNavigationType.h b/webkit/api/public/WebNavigationType.h
index 8e57376..032f2d0 100644
--- a/webkit/api/public/WebNavigationType.h
+++ b/webkit/api/public/WebNavigationType.h
@@ -1,10 +1,10 @@
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -14,7 +14,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -31,8 +31,6 @@
#ifndef WebNavigationType_h
#define WebNavigationType_h
-#error "This header file is still a work in progress; do not include!"
-
namespace WebKit {
enum WebNavigationType {
diff --git a/webkit/api/public/WebVector.h b/webkit/api/public/WebVector.h
index 2f3cf71..ed6f01c 100644
--- a/webkit/api/public/WebVector.h
+++ b/webkit/api/public/WebVector.h
@@ -1,10 +1,10 @@
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -14,7 +14,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -51,11 +51,11 @@ namespace WebKit {
//
// It is also possible to assign from other types of random access
// containers:
- //
+ //
// void Foo(const std::vector<std::string>& input)
// {
// WebVector<WebCString> cstrings = input;
- // ...
+ // ...
// }
//
template <typename T>
@@ -86,13 +86,13 @@ namespace WebKit {
assign(other);
return *this;
}
-
+
template <typename C>
void assign(const C& other)
{
assign(other.size() ? &other[0] : 0, other.size());
}
-
+
template <typename U>
void assign(const U* values, size_t size)
{
@@ -101,6 +101,7 @@ namespace WebKit {
}
size_t size() const { return m_size; }
+ bool isEmpty() const { return m_size == 0; }
T& operator[](size_t i) { return m_ptr[i]; }
const T& operator[](size_t i) const { return m_ptr[i]; }
@@ -139,7 +140,7 @@ namespace WebKit {
new (&m_ptr[i]) T(values[i]);
}
}
-
+
void destroy()
{
for (size_t i = 0; i < m_size; ++i)
diff --git a/webkit/api/src/WebURLRequest.cpp b/webkit/api/src/WebURLRequest.cpp
index 66483f9..b62206c 100644
--- a/webkit/api/src/WebURLRequest.cpp
+++ b/webkit/api/src/WebURLRequest.cpp
@@ -238,6 +238,8 @@ const ResourceRequest& WebURLRequest::toResourceRequest() const
void WebURLRequest::assign(WebURLRequestPrivate* p)
{
+ if (m_private == p)
+ return;
if (m_private)
m_private->dispose();
m_private = p;
diff --git a/webkit/api/src/WebURLRequestPrivate.h b/webkit/api/src/WebURLRequestPrivate.h
index 57ef3d1..a2b0187 100644
--- a/webkit/api/src/WebURLRequestPrivate.h
+++ b/webkit/api/src/WebURLRequestPrivate.h
@@ -31,7 +31,9 @@
#ifndef WebURLRequestPrivate_h
#define WebURLRequestPrivate_h
-#include "WebHTTPBody.h"
+// FIXME: This relative path is a temporary hack to support using this
+// header from webkit/glue.
+#include "../public/WebHTTPBody.h"
namespace WebCore { struct ResourceRequest; }
diff --git a/webkit/api/src/WebURLResponse.cpp b/webkit/api/src/WebURLResponse.cpp
index 8b6f604..066000d 100644
--- a/webkit/api/src/WebURLResponse.cpp
+++ b/webkit/api/src/WebURLResponse.cpp
@@ -241,6 +241,8 @@ const ResourceResponse& WebURLResponse::toResourceResponse() const
void WebURLResponse::assign(WebURLResponsePrivate* p)
{
+ if (m_private == p)
+ return;
if (m_private)
m_private->dispose();
m_private = p;
diff --git a/webkit/api/src/WrappedResourceRequest.h b/webkit/api/src/WrappedResourceRequest.h
index 58188c1..f232375 100644
--- a/webkit/api/src/WrappedResourceRequest.h
+++ b/webkit/api/src/WrappedResourceRequest.h
@@ -28,6 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef WrappedResourceRequest_h
+#define WrappedResourceRequest_h
+
+// FIXME: This relative path is a temporary hack to support using this
+// header from webkit/glue.
+#include "../public/WebURLRequest.h"
#include "WebURLRequestPrivate.h"
namespace WebKit {
@@ -39,23 +45,31 @@ namespace WebKit {
reset(); // Need to drop reference to m_handle
}
+ WrappedResourceRequest() { }
+
WrappedResourceRequest(WebCore::ResourceRequest& resourceRequest)
{
- bind(&resourceRequest);
+ bind(resourceRequest);
}
WrappedResourceRequest(const WebCore::ResourceRequest& resourceRequest)
{
- bind(const_cast<WebCore::ResourceRequest*>(&resourceRequest));
+ bind(resourceRequest);
}
- private:
- void bind(WebCore::ResourceRequest* resourceRequest)
+ void bind(WebCore::ResourceRequest& resourceRequest)
{
- m_handle.m_resourceRequest = resourceRequest;
+ m_handle.m_resourceRequest = &resourceRequest;
assign(&m_handle);
}
+ void bind(const WebCore::ResourceRequest& resourceRequest)
+ {
+ m_handle.m_resourceRequest = const_cast<WebCore::ResourceRequest*>(&resourceRequest);
+ assign(&m_handle);
+ }
+
+ private:
class Handle : public WebURLRequestPrivate {
public:
virtual void dispose() { m_resourceRequest = 0; }
@@ -65,3 +79,5 @@ namespace WebKit {
};
} // namespace WebKit
+
+#endif
diff --git a/webkit/api/src/WrappedResourceResponse.h b/webkit/api/src/WrappedResourceResponse.h
index fe7bb99..8c44315 100644
--- a/webkit/api/src/WrappedResourceResponse.h
+++ b/webkit/api/src/WrappedResourceResponse.h
@@ -28,7 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "WebURLResponse.h"
+#ifndef WrappedResourceResponse_h
+#define WrappedResourceResponse_h
+
+// FIXME: This relative path is a temporary hack to support using this
+// header from webkit/glue.
+#include "../public/WebURLResponse.h"
#include "WebURLResponsePrivate.h"
namespace WebKit {
@@ -40,23 +45,31 @@ namespace WebKit {
reset(); // Need to drop reference to m_handle
}
+ WrappedResourceResponse() { }
+
WrappedResourceResponse(WebCore::ResourceResponse& resourceResponse)
{
- bind(&resourceResponse);
+ bind(resourceResponse);
}
WrappedResourceResponse(const WebCore::ResourceResponse& resourceResponse)
{
- bind(const_cast<WebCore::ResourceResponse*>(&resourceResponse));
+ bind(resourceResponse);
}
- private:
- void bind(WebCore::ResourceResponse* resourceResponse)
+ void bind(WebCore::ResourceResponse& resourceResponse)
{
- m_handle.m_resourceResponse = resourceResponse;
+ m_handle.m_resourceResponse = &resourceResponse;
assign(&m_handle);
}
+ void bind(const WebCore::ResourceResponse& resourceResponse)
+ {
+ m_handle.m_resourceResponse = const_cast<WebCore::ResourceResponse*>(&resourceResponse);
+ assign(&m_handle);
+ }
+
+ private:
class Handle : public WebURLResponsePrivate {
public:
virtual void dispose() { m_resourceResponse = 0; }
@@ -66,3 +79,5 @@ namespace WebKit {
};
} // namespace WebKit
+
+#endif