summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/content_renderer.gypi6
-rw-r--r--content/renderer/renderer_webkitplatformsupport_impl.cc8
-rw-r--r--content/renderer/renderer_webkitplatformsupport_impl.h4
-rw-r--r--content/renderer/webpublicsuffixlist_impl.cc23
-rw-r--r--content/renderer/webpublicsuffixlist_impl.h22
5 files changed, 61 insertions, 2 deletions
diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi
index 736fc82..f08e2d3 100644
--- a/content/content_renderer.gypi
+++ b/content/content_renderer.gypi
@@ -492,17 +492,19 @@
'renderer/text_input_client_observer.h',
'renderer/v8_value_converter_impl.cc',
'renderer/v8_value_converter_impl.h',
- 'renderer/webclipboard_impl.cc',
- 'renderer/webclipboard_impl.h',
'renderer/web_preferences.cc',
'renderer/web_ui_extension.cc',
'renderer/web_ui_extension.h',
'renderer/web_ui_extension_data.cc',
'renderer/web_ui_extension_data.h',
+ 'renderer/webclipboard_impl.cc',
+ 'renderer/webclipboard_impl.h',
'renderer/webcrypto/webcrypto_impl.cc',
'renderer/webcrypto/webcrypto_impl.h',
'renderer/webcrypto/webcrypto_impl_nss.cc',
'renderer/webcrypto/webcrypto_impl_openssl.cc',
+ 'renderer/webpublicsuffixlist_impl.cc',
+ 'renderer/webpublicsuffixlist_impl.h',
'renderer/websharedworker_proxy.cc',
'renderer/websharedworker_proxy.h',
],
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index 6ccf457..7a3f1b9 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -48,6 +48,7 @@
#include "content/renderer/renderer_clipboard_client.h"
#include "content/renderer/webclipboard_impl.h"
#include "content/renderer/webcrypto/webcrypto_impl.h"
+#include "content/renderer/webpublicsuffixlist_impl.h"
#include "gpu/config/gpu_info.h"
#include "ipc/ipc_sync_message_filter.h"
#include "media/audio/audio_output_device.h"
@@ -806,6 +807,13 @@ void RendererWebKitPlatformSupportImpl::getPluginList(
//------------------------------------------------------------------------------
+blink::WebPublicSuffixList*
+RendererWebKitPlatformSupportImpl::publicSuffixList() {
+ return &public_suffix_list_;
+}
+
+//------------------------------------------------------------------------------
+
blink::WebString
RendererWebKitPlatformSupportImpl::signedPublicKeyAndChallengeString(
unsigned key_size_index,
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.h b/content/renderer/renderer_webkitplatformsupport_impl.h
index 793acb38..a759b19 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.h
+++ b/content/renderer/renderer_webkitplatformsupport_impl.h
@@ -10,6 +10,7 @@
#include "base/platform_file.h"
#include "content/child/webkitplatformsupport_impl.h"
#include "content/common/content_export.h"
+#include "content/renderer/webpublicsuffixlist_impl.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
#include "third_party/WebKit/public/platform/WebIDBFactory.h"
#include "webkit/renderer/compositor_bindings/web_compositor_support_impl.h"
@@ -88,6 +89,7 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportImpl
const blink::WebURL& url);
virtual void getPluginList(bool refresh,
blink::WebPluginListBuilder* builder);
+ virtual blink::WebPublicSuffixList* publicSuffixList();
virtual void screenColorProfile(blink::WebVector<char>* to_profile);
virtual blink::WebIDBFactory* idbFactory();
virtual blink::WebFileSystem* fileSystem();
@@ -203,6 +205,8 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportImpl
scoped_ptr<blink::WebBlobRegistry> blob_registry_;
+ WebPublicSuffixListImpl public_suffix_list_;
+
scoped_ptr<DeviceMotionEventPump> device_motion_event_pump_;
scoped_ptr<DeviceOrientationEventPump> device_orientation_event_pump_;
diff --git a/content/renderer/webpublicsuffixlist_impl.cc b/content/renderer/webpublicsuffixlist_impl.cc
new file mode 100644
index 0000000..e1e00c22
--- /dev/null
+++ b/content/renderer/webpublicsuffixlist_impl.cc
@@ -0,0 +1,23 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/renderer/webpublicsuffixlist_impl.h"
+
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+
+namespace content {
+
+WebPublicSuffixListImpl::~WebPublicSuffixListImpl() {
+}
+
+size_t WebPublicSuffixListImpl::getPublicSuffixLength(
+ const blink::WebString& host) {
+ size_t result = net::registry_controlled_domains::GetRegistryLength(
+ host.utf8(),
+ net::registry_controlled_domains::INCLUDE_UNKNOWN_REGISTRIES,
+ net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
+ return result ? result : host.length();
+}
+
+} // namespace content
diff --git a/content/renderer/webpublicsuffixlist_impl.h b/content/renderer/webpublicsuffixlist_impl.h
new file mode 100644
index 0000000..65fcc65
--- /dev/null
+++ b/content/renderer/webpublicsuffixlist_impl.h
@@ -0,0 +1,22 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_WEBPUBLICSUFFIXLIST_IMPL_H_
+#define CONTENT_RENDERER_WEBPUBLICSUFFIXLIST_IMPL_H_
+
+#include "base/compiler_specific.h"
+#include "third_party/WebKit/public/platform/WebPublicSuffixList.h"
+
+namespace content {
+
+class WebPublicSuffixListImpl : public blink::WebPublicSuffixList {
+ public:
+ // WebPublicSuffixList methods:
+ virtual size_t getPublicSuffixLength(const blink::WebString& host);
+ virtual ~WebPublicSuffixListImpl();
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_WEBPUBLICSUFFIXLIST_IMPL_H_