diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-01 14:47:55 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-01 14:47:55 +0000 |
commit | bdd2d420304d257937e311f17dedca61c06711f4 (patch) | |
tree | 3678ff1cf7617c32c78af549f4abb0bf28fa1b47 /webkit | |
parent | c2454884f0878d17ed8096edb22cfaf3209c22ac (diff) | |
download | chromium_src-bdd2d420304d257937e311f17dedca61c06711f4.zip chromium_src-bdd2d420304d257937e311f17dedca61c06711f4.tar.gz chromium_src-bdd2d420304d257937e311f17dedca61c06711f4.tar.bz2 |
Move the rest of webkit/glue into content/child
One more step towards removing src/webkit/
BUG=265753
TEST=content_shell and content_unittests
R=jochen@chromium.org,jam@chromium.org
TBR=darin
Review URL: https://codereview.chromium.org/151023002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248367 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/simple_webmimeregistry_impl.cc | 91 | ||||
-rw-r--r-- | webkit/glue/simple_webmimeregistry_impl.h | 49 | ||||
-rw-r--r-- | webkit/glue/webfileutilities_impl.cc | 87 | ||||
-rw-r--r-- | webkit/glue/webfileutilities_impl.h | 42 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.cc | 30 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.gyp | 17 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.gypi | 133 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.h | 24 | ||||
-rw-r--r-- | webkit/glue/webkit_glue_export.h | 29 |
9 files changed, 0 insertions, 502 deletions
diff --git a/webkit/glue/simple_webmimeregistry_impl.cc b/webkit/glue/simple_webmimeregistry_impl.cc deleted file mode 100644 index b6bdadc..0000000 --- a/webkit/glue/simple_webmimeregistry_impl.cc +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) 2012 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 "webkit/glue/simple_webmimeregistry_impl.h" - -#include "base/files/file_path.h" -#include "base/strings/string_util.h" -#include "base/strings/sys_string_conversions.h" -#include "base/strings/utf_string_conversions.h" -#include "net/base/mime_util.h" -#include "third_party/WebKit/public/platform/WebString.h" - -using blink::WebString; -using blink::WebMimeRegistry; - -namespace webkit_glue { - -//static -std::string SimpleWebMimeRegistryImpl::ToASCIIOrEmpty(const WebString& string) { - return IsStringASCII(string) ? UTF16ToASCII(string) : std::string(); -} - -WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMIMEType( - const WebString& mime_type) { - return net::IsSupportedMimeType(ToASCIIOrEmpty(mime_type)) ? - WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; -} - -WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsImageMIMEType( - const WebString& mime_type) { - return net::IsSupportedImageMimeType(ToASCIIOrEmpty(mime_type)) ? - WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; -} - -WebMimeRegistry::SupportsType - SimpleWebMimeRegistryImpl::supportsJavaScriptMIMEType( - const WebString& mime_type) { - return net::IsSupportedJavascriptMimeType(ToASCIIOrEmpty(mime_type)) ? - WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; -} - -// When debugging layout tests failures in the test shell, -// see TestShellWebMimeRegistryImpl. -WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType( - const WebString& mime_type, - const WebString& codecs, - const WebString& key_system) { - // Media features are only supported at the content/ layer. - return IsNotSupported; -} - -bool SimpleWebMimeRegistryImpl::supportsMediaSourceMIMEType( - const WebString& mime_type, - const WebString& codecs) { - // Media features are only supported at the content/ layer. - return IsNotSupported; -} - -WebMimeRegistry::SupportsType - SimpleWebMimeRegistryImpl::supportsNonImageMIMEType( - const WebString& mime_type) { - return net::IsSupportedNonImageMimeType(ToASCIIOrEmpty(mime_type)) ? - WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; -} - -WebString SimpleWebMimeRegistryImpl::mimeTypeForExtension( - const WebString& file_extension) { - std::string mime_type; - net::GetMimeTypeFromExtension( - base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type); - return WebString::fromUTF8(mime_type); -} - -WebString SimpleWebMimeRegistryImpl::wellKnownMimeTypeForExtension( - const WebString& file_extension) { - std::string mime_type; - net::GetWellKnownMimeTypeFromExtension( - base::FilePath::FromUTF16Unsafe(file_extension).value(), &mime_type); - return WebString::fromUTF8(mime_type); -} - -WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile( - const WebString& file_path) { - std::string mime_type; - net::GetMimeTypeFromFile(base::FilePath::FromUTF16Unsafe(file_path), - &mime_type); - return WebString::fromUTF8(mime_type); -} - -} // namespace webkit_glue diff --git a/webkit/glue/simple_webmimeregistry_impl.h b/webkit/glue/simple_webmimeregistry_impl.h deleted file mode 100644 index 9d76550..0000000 --- a/webkit/glue/simple_webmimeregistry_impl.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2012 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 WEBKIT_GLUE_SIMPLE_WEBMIMEREGISTRY_IMPL_H_ -#define WEBKIT_GLUE_SIMPLE_WEBMIMEREGISTRY_IMPL_H_ - -#include <string> - -#include "base/compiler_specific.h" -#include "third_party/WebKit/public/platform/WebMimeRegistry.h" -#include "webkit/glue/webkit_glue_export.h" - -namespace webkit_glue { - -class WEBKIT_GLUE_EXPORT SimpleWebMimeRegistryImpl : - NON_EXPORTED_BASE(public blink::WebMimeRegistry) { - public: - SimpleWebMimeRegistryImpl() {} - virtual ~SimpleWebMimeRegistryImpl() {} - - // Convert a WebString to ASCII, falling back on an empty string in the case - // of a non-ASCII string. - static std::string ToASCIIOrEmpty(const blink::WebString& string); - - // WebMimeRegistry methods: - virtual blink::WebMimeRegistry::SupportsType supportsMIMEType( - const blink::WebString&); - virtual blink::WebMimeRegistry::SupportsType supportsImageMIMEType( - const blink::WebString&); - virtual blink::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType( - const blink::WebString&); - virtual blink::WebMimeRegistry::SupportsType supportsMediaMIMEType( - const blink::WebString&, - const blink::WebString&, - const blink::WebString&); - virtual bool supportsMediaSourceMIMEType(const blink::WebString&, - const blink::WebString&); - virtual blink::WebMimeRegistry::SupportsType supportsNonImageMIMEType( - const blink::WebString&); - virtual blink::WebString mimeTypeForExtension(const blink::WebString&); - virtual blink::WebString wellKnownMimeTypeForExtension( - const blink::WebString&); - virtual blink::WebString mimeTypeFromFile(const blink::WebString&); -}; - -} // namespace webkit_glue - -#endif // WEBKIT_GLUE_SIMPLE_WEBMIMEREGISTRY_IMPL_H_ diff --git a/webkit/glue/webfileutilities_impl.cc b/webkit/glue/webfileutilities_impl.cc deleted file mode 100644 index eca5326..0000000 --- a/webkit/glue/webfileutilities_impl.cc +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) 2012 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 "webkit/glue/webfileutilities_impl.h" - -#include "base/file_util.h" -#include "base/files/file_path.h" -#include "base/logging.h" -#include "net/base/file_stream.h" -#include "net/base/net_util.h" -#include "third_party/WebKit/public/platform/WebFileInfo.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "webkit/glue/webkit_glue.h" - -using blink::WebString; - -namespace webkit_glue { - -WebFileUtilitiesImpl::WebFileUtilitiesImpl() - : sandbox_enabled_(true) { -} - -WebFileUtilitiesImpl::~WebFileUtilitiesImpl() { -} - -bool WebFileUtilitiesImpl::getFileInfo(const WebString& path, - blink::WebFileInfo& web_file_info) { - if (sandbox_enabled_) { - NOTREACHED(); - return false; - } - // TODO(rvargas): convert this code to use base::File::Info. - base::File::Info file_info; - if (!base::GetFileInfo(base::FilePath::FromUTF16Unsafe(path), - reinterpret_cast<base::File::Info*>(&file_info))) - return false; - - webkit_glue::FileInfoToWebFileInfo(file_info, &web_file_info); - web_file_info.platformPath = path; - return true; -} - -WebString WebFileUtilitiesImpl::directoryName(const WebString& path) { - return base::FilePath::FromUTF16Unsafe(path).DirName().AsUTF16Unsafe(); -} - -WebString WebFileUtilitiesImpl::baseName(const WebString& path) { - return base::FilePath::FromUTF16Unsafe(path).BaseName().AsUTF16Unsafe(); -} - -blink::WebURL WebFileUtilitiesImpl::filePathToURL(const WebString& path) { - return net::FilePathToFileURL(base::FilePath::FromUTF16Unsafe(path)); -} - -base::PlatformFile WebFileUtilitiesImpl::openFile(const WebString& path, - int mode) { - if (sandbox_enabled_) { - NOTREACHED(); - return base::kInvalidPlatformFileValue; - } - // mode==0 (read-only) is the only supported mode. - // TODO(kinuko): Remove this parameter. - DCHECK_EQ(0, mode); - return base::CreatePlatformFile( - base::FilePath::FromUTF16Unsafe(path), - base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ, - NULL, NULL); -} - -void WebFileUtilitiesImpl::closeFile(base::PlatformFile& handle) { - if (handle == base::kInvalidPlatformFileValue) - return; - if (base::ClosePlatformFile(handle)) - handle = base::kInvalidPlatformFileValue; -} - -int WebFileUtilitiesImpl::readFromFile(base::PlatformFile handle, - char* data, - int length) { - if (handle == base::kInvalidPlatformFileValue || !data || length <= 0) - return -1; - return base::ReadPlatformFileCurPosNoBestEffort(handle, data, length); -} - -} // namespace webkit_glue diff --git a/webkit/glue/webfileutilities_impl.h b/webkit/glue/webfileutilities_impl.h deleted file mode 100644 index c4e0aac..0000000 --- a/webkit/glue/webfileutilities_impl.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2012 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 WEBFILEUTILITIES_IMPL_H_ -#define WEBFILEUTILITIES_IMPL_H_ - -#include "base/platform_file.h" -#include "third_party/WebKit/public/platform/WebFileInfo.h" -#include "third_party/WebKit/public/platform/WebFileUtilities.h" -#include "webkit/glue/webkit_glue_export.h" - -namespace webkit_glue { - -class WEBKIT_GLUE_EXPORT WebFileUtilitiesImpl : - NON_EXPORTED_BASE(public blink::WebFileUtilities) { - public: - WebFileUtilitiesImpl(); - virtual ~WebFileUtilitiesImpl(); - - // WebFileUtilities methods: - virtual bool getFileInfo( - const blink::WebString& path, - blink::WebFileInfo& result); - virtual blink::WebString directoryName(const blink::WebString& path); - virtual blink::WebString baseName(const blink::WebString& path); - virtual blink::WebURL filePathToURL(const blink::WebString& path); - virtual base::PlatformFile openFile(const blink::WebString& path, int mode); - virtual void closeFile(base::PlatformFile& handle); - virtual int readFromFile(base::PlatformFile handle, char* data, int length); - - void set_sandbox_enabled(bool sandbox_enabled) { - sandbox_enabled_ = sandbox_enabled; - } - - protected: - bool sandbox_enabled_; -}; - -} // namespace webkit_glue - -#endif // WEBFILEUTILITIES_IMPL_H_ diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc deleted file mode 100644 index 05e7bca..0000000 --- a/webkit/glue/webkit_glue.cc +++ /dev/null @@ -1,30 +0,0 @@ -// 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 "webkit/glue/webkit_glue.h" - -#include "base/logging.h" -#include "third_party/WebKit/public/platform/WebFileInfo.h" - -namespace webkit_glue { - -void FileInfoToWebFileInfo( - const base::File::Info& file_info, - blink::WebFileInfo* web_file_info) { - DCHECK(web_file_info); - // WebKit now expects NaN as uninitialized/null Date. - if (file_info.last_modified.is_null()) - web_file_info->modificationTime = std::numeric_limits<double>::quiet_NaN(); - else - web_file_info->modificationTime = file_info.last_modified.ToDoubleT(); - web_file_info->length = file_info.size; - if (file_info.is_directory) - web_file_info->type = blink::WebFileInfo::TypeDirectory; - else - web_file_info->type = blink::WebFileInfo::TypeFile; -} - -COMPILE_ASSERT(std::numeric_limits<double>::has_quiet_NaN, has_quiet_NaN); - -} // namespace webkit_glue diff --git a/webkit/glue/webkit_glue.gyp b/webkit/glue/webkit_glue.gyp deleted file mode 100644 index 2b5c915..0000000 --- a/webkit/glue/webkit_glue.gyp +++ /dev/null @@ -1,17 +0,0 @@ -# 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. - -{ - 'conditions': [ - # TODO(stuartmorgan): All dependencies from code built on iOS to - # webkit/ should be removed, at which point this condition can be - # removed. - ['OS != "ios"', { - 'includes': [ - '../../build/win_precompile.gypi', - '../glue/webkit_glue.gypi', - ], - }], - ], -} diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi deleted file mode 100644 index a4ad0a8..0000000 --- a/webkit/glue/webkit_glue.gypi +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright (c) 2012 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. - -{ - 'target_defaults': { - # Disable narrowing-conversion-in-initialization-list warnings in that we - # do not want to fix it in data file "webcursor_gtk_data.h". - 'cflags+': ['-Wno-narrowing'], - 'cflags_cc+': ['-Wno-narrowing'], - }, - 'variables': { - 'chromium_code': 1, - }, - 'targets': [ - { - 'target_name': 'glue', - 'type': '<(component)', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'defines': [ - 'WEBKIT_EXTENSIONS_IMPLEMENTATION', - 'WEBKIT_GLUE_IMPLEMENTATION', - ], - 'dependencies': [ - '<(DEPTH)/base/base.gyp:base', - '<(DEPTH)/base/base.gyp:base_i18n', - '<(DEPTH)/base/base.gyp:base_static', - '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', - '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib', - '<(DEPTH)/gpu/gpu.gyp:gles2_implementation', - '<(DEPTH)/net/net.gyp:net', - '<(DEPTH)/skia/skia.gyp:skia', - '<(DEPTH)/third_party/icu/icu.gyp:icui18n', - '<(DEPTH)/third_party/icu/icu.gyp:icuuc', - '<(DEPTH)/third_party/npapi/npapi.gyp:npapi', - '<(DEPTH)/ui/gfx/gfx.gyp:gfx', - '<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry', - '<(DEPTH)/ui/gl/gl.gyp:gl', - '<(DEPTH)/url/url.gyp:url_lib', - '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', - '<(DEPTH)/webkit/common/user_agent/webkit_user_agent.gyp:user_agent', - '<(DEPTH)/webkit/common/webkit_common.gyp:webkit_common', - '<(DEPTH)/webkit/renderer/compositor_bindings/compositor_bindings.gyp:webkit_compositor_support', - '<(DEPTH)/webkit/storage_browser.gyp:webkit_storage_browser', - '<(DEPTH)/webkit/storage_common.gyp:webkit_storage_common', - '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources', - '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings', - ], - 'include_dirs': [ - '<(INTERMEDIATE_DIR)', - '<(SHARED_INTERMEDIATE_DIR)/webkit', - '<(SHARED_INTERMEDIATE_DIR)/ui', - ], - 'sources': [ - 'simple_webmimeregistry_impl.cc', - 'simple_webmimeregistry_impl.h', - 'webfileutilities_impl.cc', - 'webfileutilities_impl.h', - 'webkit_glue.cc', - 'webkit_glue.h', - 'webkit_glue_export.h', - ], - # When glue is a dependency, it needs to be a hard dependency. - # Dependents may rely on files generated by this target or one of its - # own hard dependencies. - 'hard_dependency': 1, - 'conditions': [ - ['toolkit_uses_gtk == 1', { - 'dependencies': [ - '<(DEPTH)/build/linux/system.gyp:gtk', - ], - 'sources/': [['exclude', '_x11\\.cc$']], - }], - ['use_aura==1 and use_x11==1', { - 'link_settings': { - 'libraries': [ '-lXcursor', ], - }, - }], - ['OS=="win"', { - 'include_dirs': [ - '<(DEPTH)/third_party/wtl/include', - ], - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - 'msvs_disabled_warnings': [ 4800, 4267 ], - 'conditions': [ - ['component=="shared_library"', { - 'dependencies': [ - '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink', - ], - 'export_dependent_settings': [ - '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink', - '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', - ], - }], - ], - }], - ['chrome_multiple_dll!=1', { - 'dependencies': [ - '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink', - ], - }], - ['enable_printing!=0', { - 'dependencies': [ - '<(DEPTH)/printing/printing.gyp:printing', - ], - }], - ], - }, - ], - 'conditions': [ - ['use_third_party_translations==1', { - 'targets': [ - { - 'target_name': 'inspector_strings', - 'type': 'none', - 'variables': { - 'grit_out_dir': '<(PRODUCT_DIR)/resources/inspector/l10n', - }, - 'actions': [ - { - 'action_name': 'inspector_strings', - 'variables': { - 'grit_grd_file': 'inspector_strings.grd', - }, - 'includes': [ '../../build/grit_action.gypi' ], - }, - ], - 'includes': [ '../../build/grit_target.gypi' ], - }, - ], - }], - ], -} diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h deleted file mode 100644 index 0843bbf..0000000 --- a/webkit/glue/webkit_glue.h +++ /dev/null @@ -1,24 +0,0 @@ -// 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 WEBKIT_GLUE_WEBKIT_GLUE_H_ -#define WEBKIT_GLUE_WEBKIT_GLUE_H_ - -#include "base/files/file.h" -#include "webkit/glue/webkit_glue_export.h" - -namespace blink { -struct WebFileInfo; -} - -namespace webkit_glue { - -// File info conversion -WEBKIT_GLUE_EXPORT void FileInfoToWebFileInfo( - const base::File::Info& file_info, - blink::WebFileInfo* web_file_info); - -} // namespace webkit_glue - -#endif // WEBKIT_GLUE_WEBKIT_GLUE_H_ diff --git a/webkit/glue/webkit_glue_export.h b/webkit/glue/webkit_glue_export.h deleted file mode 100644 index 0cbd365..0000000 --- a/webkit/glue/webkit_glue_export.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2012 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 WEBKIT_GLUE_WEBKIT_GLUE_EXPORT_H_ -#define WEBKIT_GLUE_WEBKIT_GLUE_EXPORT_H_ - -#if defined(COMPONENT_BUILD) -#if defined(WIN32) - -#if defined(WEBKIT_GLUE_IMPLEMENTATION) -#define WEBKIT_GLUE_EXPORT __declspec(dllexport) -#else -#define WEBKIT_GLUE_EXPORT __declspec(dllimport) -#endif // defined(WEBKIT_GLUE_IMPLEMENTATION) - -#else // defined(WIN32) -#if defined(WEBKIT_GLUE_IMPLEMENTATION) -#define WEBKIT_GLUE_EXPORT __attribute__((visibility("default"))) -#else -#define WEBKIT_GLUE_EXPORT -#endif -#endif - -#else // defined(COMPONENT_BUILD) -#define WEBKIT_GLUE_EXPORT -#endif - -#endif // WEBKIT_GLUE_WEBKIT_GLUE_EXPORT_H_ |