Commit 1fd5b9c8 authored by abarth@webkit.org's avatar abarth@webkit.org

[Chromium] Rename PlatformBridge to PlatformSupport

https://bugs.webkit.org/show_bug.cgi?id=67349

Reviewed by Darin Fisher.

This matches the WebKitPlatformSupport embedder API.

Source/WebCore: 

* WebCore.gypi:
* WebCore.pro:
* bindings/v8/NPV8Object.cpp:
(_NPN_Evaluate):
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::createScriptInstanceForWidget):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::reportFatalErrorInV8):
* bindings/v8/V8GCController.cpp:
* bindings/v8/V8Proxy.cpp:
(WebCore::V8Proxy::handleOutOfMemory):
(WebCore::V8Proxy::evaluate):
* bindings/v8/V8Proxy.h:
* bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
(WebCore::histogramEnumeration):
* page/PageGroup.cpp:
(WebCore::PageGroup::isLinkVisited):
* platform/audio/chromium/AudioBusChromium.cpp:
(WebCore::AudioBus::loadPlatformResource):
(WebCore::createBusFromInMemoryAudioFile):
* platform/chromium/ChromiumDataObject.cpp:
(WebCore::ChromiumDataObject::types):
(WebCore::ChromiumDataObject::getData):
(WebCore::ChromiumDataObject::getSequenceNumber):
(WebCore::ChromiumDataObject::containsFilenames):
* platform/chromium/DataTransferItemChromium.cpp:
(WebCore::DataTransferItemChromium::getAsString):
(WebCore::DataTransferItemChromium::getAsFile):
* platform/chromium/DragDataChromium.cpp:
(WebCore::DragData::asURL):
* platform/chromium/FileSystemChromium.cpp:
(WebCore::deleteFile):
(WebCore::deleteEmptyDirectory):
(WebCore::getFileSize):
(WebCore::getFileModificationTime):
(WebCore::revealFolderInOS):
(WebCore::directoryName):
(WebCore::pathByAppendingComponent):
(WebCore::makeAllDirectories):
(WebCore::fileExists):
(WebCore::openFile):
(WebCore::closeFile):
(WebCore::seekFile):
(WebCore::truncateFile):
(WebCore::readFromFile):
(WebCore::writeToFile):
* platform/chromium/LanguageChromium.cpp:
(WebCore::platformDefaultLanguage):
* platform/chromium/LinkHashChromium.cpp:
(WebCore::visitedLinkHash):
* platform/chromium/MIMETypeRegistryChromium.cpp:
(WebCore::MIMETypeRegistry::getMIMETypeForExtension):
(WebCore::MIMETypeRegistry::getWellKnownMIMETypeForExtension):
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
(WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
(WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
(WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
* platform/chromium/PasteboardChromium.cpp:
(WebCore::Pasteboard::writeSelection):
(WebCore::Pasteboard::writePlainText):
(WebCore::Pasteboard::writeURL):
(WebCore::Pasteboard::writeImage):
(WebCore::Pasteboard::canSmartReplace):
(WebCore::Pasteboard::plainText):
(WebCore::Pasteboard::documentFragment):
* platform/chromium/PlatformBridge.h: Removed.
* platform/chromium/PlatformScreenChromium.cpp:
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenIsMonochrome):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/chromium/PlatformSupport.h: Copied from Source/WebCore/platform/chromium/PlatformBridge.h.
* platform/chromium/SSLKeyGeneratorChromium.cpp:
(WebCore::signedPublicKeyAndChallengeString):
* platform/chromium/ScrollbarThemeChromium.cpp:
* platform/chromium/ScrollbarThemeChromiumLinux.cpp:
(WebCore::ScrollbarThemeChromiumLinux::scrollbarThickness):
(WebCore::ScrollbarThemeChromiumLinux::paintTrackPiece):
(WebCore::ScrollbarThemeChromiumLinux::paintButton):
(WebCore::ScrollbarThemeChromiumLinux::paintThumb):
(WebCore::ScrollbarThemeChromiumLinux::buttonSize):
(WebCore::ScrollbarThemeChromiumLinux::minimumThumbLength):
* platform/chromium/ScrollbarThemeChromiumMac.mm:
(WebCore::scrollbarStateToThemeState):
(WebCore::ScrollbarThemeChromiumMac::paint):
* platform/chromium/ScrollbarThemeChromiumWin.cpp:
(WebCore::ScrollbarThemeChromiumWin::scrollbarThickness):
(WebCore::ScrollbarThemeChromiumWin::paintTrackPiece):
(WebCore::ScrollbarThemeChromiumWin::paintButton):
(WebCore::ScrollbarThemeChromiumWin::paintThumb):
(WebCore::ScrollbarThemeChromiumWin::buttonSize):
* platform/chromium/SharedTimerChromium.cpp:
(WebCore::setSharedTimerFiredFunction):
(WebCore::setSharedTimerFireInterval):
(WebCore::stopSharedTimer):
* platform/chromium/SuddenTerminationChromium.cpp:
(WebCore::disableSuddenTermination):
(WebCore::enableSuddenTermination):
* platform/chromium/TraceEvent.h:
(WebCore::internal::ScopeTracer::ScopeTracer):
(WebCore::internal::ScopeTracer::~ScopeTracer):
* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerPainter::paint):
* platform/graphics/chromium/CrossProcessFontLoading.mm:
* platform/graphics/chromium/FontCacheChromiumWin.cpp:
(WebCore::fontContainsCharacter):
(WebCore::FillLogFont):
* platform/graphics/chromium/FontCacheLinux.cpp:
(WebCore::FontCache::getFontDataForCharacters):
* platform/graphics/chromium/FontChromiumWin.cpp:
(WebCore::drawGlyphsWin):
* platform/graphics/chromium/FontPlatformDataChromiumWin.cpp:
(WebCore::FontPlatformData::scriptFontProperties):
* platform/graphics/chromium/FontPlatformDataLinux.cpp:
(WebCore::FontPlatformData::querySystemForRenderStyle):
* platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp:
(WebCore::fillBMPGlyphs):
* platform/graphics/chromium/ImageChromium.cpp:
(WebCore::Image::loadPlatformResource):
* platform/graphics/chromium/ImageChromiumMac.mm:
(WebCore::Image::loadPlatformResource):
* platform/graphics/chromium/SimpleFontDataChromiumWin.cpp:
(WebCore::SimpleFontData::platformInit):
(WebCore::SimpleFontData::determinePitch):
(WebCore::SimpleFontData::platformWidthForGlyph):
* platform/graphics/chromium/UniscribeHelperTextRun.cpp:
(WebCore::UniscribeHelperTextRun::tryToPreloadFont):
* platform/graphics/skia/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/network/chromium/CookieJarChromium.cpp:
(WebCore::setCookies):
(WebCore::cookies):
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::cookiesEnabled):
(WebCore::getRawCookies):
(WebCore::deleteCookie):
* platform/network/chromium/DNSChromium.cpp:
(WebCore::prefetchDNS):
* platform/qt/PlatformBridge.h: Removed.
* platform/qt/PlatformBridgeQt.cpp: Removed.
* platform/qt/PlatformSupport.h: Copied from Source/WebCore/platform/qt/PlatformBridge.h.
* platform/qt/PlatformSupportQt.cpp: Copied from Source/WebCore/platform/qt/PlatformBridgeQt.cpp.
(WebCore::PlatformSupport::popupsAllowed):
(WebCore::PlatformSupport::pluginScriptableObject):
* platform/sql/chromium/SQLiteFileSystemChromium.cpp:
(WebCore::SQLiteFileSystem::deleteDatabaseFile):
(WebCore::SQLiteFileSystem::getDatabaseFileSize):
* platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp:
* platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp:
* plugins/chromium/PluginDataChromium.cpp:
(WebCore::PluginCache::plugins):
* rendering/RenderThemeChromiumLinux.cpp:
(WebCore::getWebThemeState):
(WebCore::RenderThemeChromiumLinux::adjustSliderThumbSize):
(WebCore::RenderThemeChromiumLinux::paintCheckbox):
(WebCore::RenderThemeChromiumLinux::setCheckboxSize):
(WebCore::RenderThemeChromiumLinux::paintRadio):
(WebCore::RenderThemeChromiumLinux::setRadioSize):
(WebCore::RenderThemeChromiumLinux::paintButton):
(WebCore::RenderThemeChromiumLinux::paintTextField):
(WebCore::RenderThemeChromiumLinux::paintMenuList):
(WebCore::RenderThemeChromiumLinux::paintSliderTrack):
(WebCore::RenderThemeChromiumLinux::paintSliderThumb):
(WebCore::RenderThemeChromiumLinux::adjustInnerSpinButtonStyle):
(WebCore::RenderThemeChromiumLinux::paintInnerSpinButton):
(WebCore::RenderThemeChromiumLinux::paintProgressBar):
* rendering/RenderThemeChromiumMac.mm:
(WebCore::RenderThemeChromiumMac::usesTestModeFocusRingColor):
* rendering/RenderThemeChromiumSkia.cpp:
(WebCore::RenderThemeChromiumSkia::caretBlinkInterval):
* rendering/RenderThemeChromiumWin.cpp:
(WebCore::RenderThemeChromiumWin::platformActiveSelectionBackgroundColor):
(WebCore::RenderThemeChromiumWin::platformInactiveSelectionBackgroundColor):
(WebCore::RenderThemeChromiumWin::platformActiveSelectionForegroundColor):
(WebCore::RenderThemeChromiumWin::systemColor):
(WebCore::RenderThemeChromiumWin::paintButton):
(WebCore::RenderThemeChromiumWin::paintSliderTrack):
(WebCore::menuListButtonWidth):
(WebCore::RenderThemeChromiumWin::paintMenuList):
(WebCore::RenderThemeChromiumWin::paintTextFieldInternal):
(WebCore::RenderThemeChromiumWin::paintInnerSpinButton):
(WebCore::RenderThemeChromiumWin::paintProgressBar):
* storage/chromium/IDBFactoryBackendInterface.cpp:
(WebCore::IDBFactoryBackendInterface::create):
* storage/chromium/IDBKeyPathBackendImpl.cpp:
(WebCore::IDBKeyPathBackendImpl::createIDBKeysFromSerializedValuesAndKeyPath):
(WebCore::IDBKeyPathBackendImpl::injectIDBKeyIntoSerializedValue):
* storage/chromium/QuotaTracker.cpp:
(WebCore::QuotaTracker::getDatabaseSizeAndSpaceAvailableToOrigin):

Source/WebKit/chromium: 

* WebKit.gyp:
* src/AssertMatchingEnums.cpp:
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::shouldRunModalDialogDuringPageDismissal):
* src/PlatformBridge.cpp: Removed.
* src/ResourceHandle.cpp:
(WebCore::ResourceHandle::cacheMetadata):
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::WebFrameImpl):
(WebKit::WebFrameImpl::~WebFrameImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::paint):
(WebKit::WebViewImplContentPainter::paint):
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 99fd9807
This diff is collapsed.
......@@ -3220,10 +3220,10 @@
'platform/chromium/MIMETypeRegistryChromium.cpp',
'platform/chromium/PasteboardChromium.cpp',
'platform/chromium/PasteboardPrivate.h',
'platform/chromium/PlatformBridge.h',
'platform/chromium/PlatformCursor.h',
'platform/chromium/PlatformKeyboardEventChromium.cpp',
'platform/chromium/PlatformScreenChromium.cpp',
'platform/chromium/PlatformSupport.h',
'platform/chromium/PlatformThemeChromiumGtk.cpp',
'platform/chromium/PlatformThemeChromiumGtk.h',
'platform/chromium/PlatformWidget.h',
......@@ -4283,11 +4283,11 @@
'platform/qt/LoggingQt.cpp',
'platform/qt/MIMETypeRegistryQt.cpp',
'platform/qt/PasteboardQt.cpp',
'platform/qt/PlatformBridge.h',
'platform/qt/PlatformBridgeQt.cpp',
'platform/qt/PlatformKeyboardEventQt.cpp',
'platform/qt/PlatformMouseEventQt.cpp',
'platform/qt/PlatformScreenQt.cpp',
'platform/qt/PlatformSupport.h',
'platform/qt/PlatformSupportQt.cpp',
'platform/qt/PlatformTouchEventQt.cpp',
'platform/qt/PlatformTouchPointQt.cpp',
'platform/qt/QWebPageClient.h',
......
......@@ -64,7 +64,7 @@ v8 {
include($$PWD/../JavaScriptCore/wtf/wtf.pri)
SOURCES += \
platform/qt/PlatformBridgeQt.cpp \
platform/qt/PlatformSupportQt.cpp \
bindings/generic/BindingSecurityBase.cpp \
\
bindings/v8/WorldContextHandle.cpp \
......
......@@ -28,7 +28,7 @@
#include "NPV8Object.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#include "DOMWindow.h"
#include "Frame.h"
#include "OwnArrayPtr.h"
......@@ -279,7 +279,7 @@ bool _NPN_InvokeDefault(NPP npp, NPObject* npObject, const NPVariant* arguments,
bool _NPN_Evaluate(NPP npp, NPObject* npObject, NPString* npScript, NPVariant* result)
{
bool popupsAllowed = PlatformBridge::popupsAllowed(npp);
bool popupsAllowed = PlatformSupport::popupsAllowed(npp);
return _NPN_EvaluateHelper(npp, popupsAllowed, npObject, npScript, result);
}
......
......@@ -32,7 +32,7 @@
#include "config.h"
#include "ScriptController.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#include "Document.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
......@@ -276,7 +276,7 @@ PassScriptInstance ScriptController::createScriptInstanceForWidget(Widget* widge
if (widget->isFrameView())
return 0;
NPObject* npObject = PlatformBridge::pluginScriptableObject(widget);
NPObject* npObject = PlatformSupport::pluginScriptableObject(widget);
if (!npObject)
return 0;
......
......@@ -31,7 +31,7 @@
#include "config.h"
#include "V8DOMWindowShell.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#include "CSSMutableStyleDeclaration.h"
#include "DateExtension.h"
#include "DocumentLoader.h"
......@@ -92,7 +92,7 @@ static void reportFatalErrorInV8(const char* location, const char* message)
// FIXME: clean up V8Proxy and disable JavaScript.
int memoryUsageMB = -1;
#if PLATFORM(CHROMIUM)
memoryUsageMB = PlatformBridge::actualMemoryUsageMB();
memoryUsageMB = PlatformSupport::actualMemoryUsageMB();
#endif
printf("V8 error: %s (%s). Current memory usage: %d MB\n", message, location, memoryUsageMB);
handleFatalErrorInV8();
......
......@@ -38,7 +38,7 @@
#include "HTMLImageElement.h"
#include "HTMLNames.h"
#include "MessagePort.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#include "RetainedDOMInfo.h"
#include "RetainedObjectInfo.h"
#include "V8Binding.h"
......@@ -421,7 +421,7 @@ namespace {
int getMemoryUsageInMB()
{
#if PLATFORM(CHROMIUM)
return PlatformBridge::memoryUsageMB();
return PlatformSupport::memoryUsageMB();
#else
return 0;
#endif
......@@ -430,7 +430,7 @@ int getMemoryUsageInMB()
int getActualMemoryUsageInMB()
{
#if PLATFORM(CHROMIUM)
return PlatformBridge::actualMemoryUsageMB();
return PlatformSupport::actualMemoryUsageMB();
#else
return 0;
#endif
......
......@@ -45,7 +45,7 @@
#include "InspectorInstrumentation.h"
#include "Page.h"
#include "PageGroup.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#include "ScriptSourceCode.h"
#include "SecurityOrigin.h"
#include "Settings.h"
......@@ -231,7 +231,7 @@ bool V8Proxy::handleOutOfMemory()
}
#if PLATFORM(CHROMIUM)
PlatformBridge::notifyJSOutOfMemory(frame);
PlatformSupport::notifyJSOutOfMemory(frame);
#endif
// Disable JS.
......@@ -368,7 +368,7 @@ v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* nod
// Compile the script.
v8::Local<v8::String> code = v8ExternalString(source.source());
#if PLATFORM(CHROMIUM)
PlatformBridge::traceEventBegin("v8.compile", node, "");
PlatformSupport::traceEventBegin("v8.compile", node, "");
#endif
OwnPtr<v8::ScriptData> scriptData = precompileScript(code, source.cachedScript());
......@@ -376,9 +376,9 @@ v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* nod
// 1, whereas v8 starts at 0.
v8::Handle<v8::Script> script = compileScript(code, source.url(), WTF::toZeroBasedTextPosition(source.startPosition()), scriptData.get());
#if PLATFORM(CHROMIUM)
PlatformBridge::traceEventEnd("v8.compile", node, "");
PlatformSupport::traceEventEnd("v8.compile", node, "");
PlatformBridge::traceEventBegin("v8.run", node, "");
PlatformSupport::traceEventBegin("v8.run", node, "");
#endif
// Set inlineCode to true for <a href="javascript:doSomething()">
// and false for <script>doSomething</script>. We make a rough guess at
......@@ -386,7 +386,7 @@ v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* nod
result = runScript(script, source.url().string().isNull());
}
#if PLATFORM(CHROMIUM)
PlatformBridge::traceEventEnd("v8.run", node, "");
PlatformSupport::traceEventEnd("v8.run", node, "");
#endif
InspectorInstrumentation::didEvaluateScript(cookie);
......
......@@ -31,7 +31,7 @@
#ifndef V8Proxy_h
#define V8Proxy_h
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#include "SharedPersistent.h"
#include "V8AbstractEventListener.h"
#include "V8DOMWindowShell.h"
......@@ -46,7 +46,7 @@
#include <wtf/text/TextPosition.h>
#if defined(ENABLE_DOM_STATS_COUNTERS) && PLATFORM(CHROMIUM)
#define INC_STATS(name) PlatformBridge::incrementStatsCounter(name)
#define INC_STATS(name) PlatformSupport::incrementStatsCounter(name)
#else
#define INC_STATS(name)
#endif
......
......@@ -36,7 +36,7 @@
#include "InspectorFrontendClient.h"
#include "InspectorFrontendHost.h"
#if !PLATFORM(QT)
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#endif
#include "PlatformString.h"
......@@ -125,7 +125,7 @@ static v8::Handle<v8::Value> histogramEnumeration(const char* name, const v8::Ar
int sample = args[0]->ToInt32()->Value();
if (sample < boundaryValue)
PlatformBridge::histogramEnumeration(name, sample, boundaryValue);
PlatformSupport::histogramEnumeration(name, sample, boundaryValue);
return v8::Undefined();
}
......
......@@ -39,7 +39,7 @@
#include "StorageNamespace.h"
#if PLATFORM(CHROMIUM)
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#endif
namespace WebCore {
......@@ -178,7 +178,7 @@ bool PageGroup::isLinkVisited(LinkHash visitedLinkHash)
{
#if PLATFORM(CHROMIUM)
// Use Chromium's built-in visited link database.
return PlatformBridge::isLinkVisited(visitedLinkHash);
return PlatformSupport::isLinkVisited(visitedLinkHash);
#else
if (!m_visitedLinksPopulated) {
m_visitedLinksPopulated = true;
......
......@@ -29,7 +29,7 @@
#include "AudioBus.h"
#include "AudioFileReader.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
......@@ -37,7 +37,7 @@ namespace WebCore {
PassOwnPtr<AudioBus> AudioBus::loadPlatformResource(const char* name, double sampleRate)
{
// FIXME: the sampleRate parameter is ignored. It should be removed from the API.
OwnPtr<AudioBus> audioBus = PlatformBridge::loadPlatformAudioResource(name, sampleRate);
OwnPtr<AudioBus> audioBus = PlatformSupport::loadPlatformAudioResource(name, sampleRate);
if (!audioBus.get())
return nullptr;
......@@ -51,7 +51,7 @@ PassOwnPtr<AudioBus> AudioBus::loadPlatformResource(const char* name, double sam
PassOwnPtr<AudioBus> createBusFromInMemoryAudioFile(const void* data, size_t dataSize, bool mixToMono, double sampleRate)
{
// FIXME: the sampleRate parameter is ignored. It should be removed from the API.
OwnPtr<AudioBus> audioBus = PlatformBridge::decodeAudioFileData(static_cast<const char*>(data), dataSize, sampleRate);
OwnPtr<AudioBus> audioBus = PlatformSupport::decodeAudioFileData(static_cast<const char*>(data), dataSize, sampleRate);
if (!audioBus.get())
return nullptr;
......
......@@ -33,7 +33,7 @@
#include "ClipboardMimeTypes.h"
#include "Pasteboard.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
namespace WebCore {
......@@ -103,7 +103,7 @@ HashSet<String> ChromiumDataObject::types() const
{
if (m_clipboardType == Clipboard::CopyAndPaste) {
bool ignoredContainsFilenames;
return PlatformBridge::clipboardReadAvailableTypes(PasteboardPrivate::StandardBuffer,
return PlatformSupport::clipboardReadAvailableTypes(PasteboardPrivate::StandardBuffer,
&ignoredContainsFilenames);
}
......@@ -134,7 +134,7 @@ String ChromiumDataObject::getData(const String& type, bool& success)
Pasteboard::generalPasteboard()->isSelectionMode() ?
PasteboardPrivate::SelectionBuffer :
PasteboardPrivate::StandardBuffer;
String text = PlatformBridge::clipboardReadPlainText(buffer);
String text = PlatformSupport::clipboardReadPlainText(buffer);
success = !text.isEmpty();
return text;
}
......@@ -160,7 +160,7 @@ String ChromiumDataObject::getData(const String& type, bool& success)
PasteboardPrivate::StandardBuffer;
String htmlText;
KURL sourceURL;
PlatformBridge::clipboardReadHTML(buffer, &htmlText, &sourceURL);
PlatformSupport::clipboardReadHTML(buffer, &htmlText, &sourceURL);
success = !htmlText.isEmpty();
return htmlText;
}
......@@ -228,7 +228,7 @@ bool ChromiumDataObject::setData(const String& type, const String& data)
uint64_t ChromiumDataObject::getSequenceNumber()
{
return PlatformBridge::clipboardGetSequenceNumber();
return PlatformSupport::clipboardGetSequenceNumber();
}
bool ChromiumDataObject::containsFilenames() const
......@@ -236,7 +236,7 @@ bool ChromiumDataObject::containsFilenames() const
bool containsFilenames;
if (m_clipboardType == Clipboard::CopyAndPaste) {
HashSet<String> ignoredResults =
PlatformBridge::clipboardReadAvailableTypes(PasteboardPrivate::StandardBuffer,
PlatformSupport::clipboardReadAvailableTypes(PasteboardPrivate::StandardBuffer,
&containsFilenames);
} else
containsFilenames = !m_filenames.isEmpty();
......
......@@ -37,7 +37,7 @@
#include "Clipboard.h"
#include "ClipboardChromium.h"
#include "ClipboardMimeTypes.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#include "SharedBuffer.h"
#include "StringCallback.h"
......@@ -91,13 +91,13 @@ void DataTransferItemChromium::getAsString(PassRefPtr<StringCallback> callback)
ASSERT(m_source == PasteboardSource);
// This is ugly but there's no real alternative.
if (type() == mimeTypeTextPlain) {
callback->scheduleCallback(m_context, PlatformBridge::clipboardReadPlainText(PasteboardPrivate::StandardBuffer));
callback->scheduleCallback(m_context, PlatformSupport::clipboardReadPlainText(PasteboardPrivate::StandardBuffer));
return;
}
if (type() == mimeTypeTextHTML) {
String html;
KURL ignoredSourceURL;
PlatformBridge::clipboardReadHTML(PasteboardPrivate::StandardBuffer, &html, &ignoredSourceURL);
PlatformSupport::clipboardReadHTML(PasteboardPrivate::StandardBuffer, &html, &ignoredSourceURL);
callback->scheduleCallback(m_context, html);
return;
}
......@@ -123,7 +123,7 @@ PassRefPtr<Blob> DataTransferItemChromium::getAsFile()
// method to the blob registry; that way the data is only copied over
// into the renderer when it's actually read, not when the blob is
// initially constructed).
RefPtr<SharedBuffer> data = PlatformBridge::clipboardReadImage(PasteboardPrivate::StandardBuffer);
RefPtr<SharedBuffer> data = PlatformSupport::clipboardReadImage(PasteboardPrivate::StandardBuffer);
RefPtr<RawData> rawData = RawData::create();
rawData->mutableData()->append(data->data(), data->size());
OwnPtr<BlobData> blobData = BlobData::create();
......
......@@ -37,8 +37,8 @@
#include "Frame.h"
#include "KURL.h"
#include "NotImplemented.h"
#include "PlatformBridge.h"
#include "PlatformString.h"
#include "PlatformSupport.h"
#include "markup.h"
namespace WebCore {
......@@ -63,7 +63,7 @@ String DragData::asURL(Frame*, FilenameConversionPolicy filenamePolicy, String*
if (title)
*title = m_platformDragData->urlTitle();
} else if (filenamePolicy == ConvertFilenames && containsFiles()) {
url = PlatformBridge::filePathToURL(PlatformBridge::getAbsolutePath(m_platformDragData->filenames()[0]));
url = PlatformSupport::filePathToURL(PlatformSupport::getAbsolutePath(m_platformDragData->filenames()[0]));
}
return url;
}
......
......@@ -32,84 +32,84 @@
#include "FileSystem.h"
#include "NotImplemented.h"
#include "PlatformBridge.h"
#include "PlatformString.h"
#include "PlatformSupport.h"
namespace WebCore {
bool deleteFile(const String& path)
{
return PlatformBridge::deleteFile(path);
return PlatformSupport::deleteFile(path);
}
bool deleteEmptyDirectory(const String& path)
{
return PlatformBridge::deleteEmptyDirectory(path);
return PlatformSupport::deleteEmptyDirectory(path);
}
bool getFileSize(const String& path, long long& result)
{
return PlatformBridge::getFileSize(path, result);
return PlatformSupport::getFileSize(path, result);
}
bool getFileModificationTime(const String& path, time_t& result)
{
return PlatformBridge::getFileModificationTime(path, result);
return PlatformSupport::getFileModificationTime(path, result);
}
void revealFolderInOS(const String& path)
{
PlatformBridge::revealFolderInOS(path);
PlatformSupport::revealFolderInOS(path);
}
String directoryName(const String& path)
{
return PlatformBridge::directoryName(path);
return PlatformSupport::directoryName(path);
}
String pathByAppendingComponent(const String& path, const String& component)
{
return PlatformBridge::pathByAppendingComponent(path, component);
return PlatformSupport::pathByAppendingComponent(path, component);
}
bool makeAllDirectories(const String& path)
{
return PlatformBridge::makeAllDirectories(path);
return PlatformSupport::makeAllDirectories(path);
}
bool fileExists(const String& path)
{
return PlatformBridge::fileExists(path);
return PlatformSupport::fileExists(path);
}
PlatformFileHandle openFile(const String& path, FileOpenMode mode)
{
return PlatformBridge::openFile(path, mode);
return PlatformSupport::openFile(path, mode);
}
void closeFile(PlatformFileHandle& handle)
{
return PlatformBridge::closeFile(handle);
return PlatformSupport::closeFile(handle);
}
long long seekFile(PlatformFileHandle handle, long long offset, FileSeekOrigin origin)
{
return PlatformBridge::seekFile(handle, offset, origin);
return PlatformSupport::seekFile(handle, offset, origin);
}
bool truncateFile(PlatformFileHandle handle, long long offset)
{
return PlatformBridge::truncateFile(handle, offset);
return PlatformSupport::truncateFile(handle, offset);
}
int readFromFile(PlatformFileHandle handle, char* data, int length)
{
return PlatformBridge::readFromFile(handle, data, length);
return PlatformSupport::readFromFile(handle, data, length);
}
int writeToFile(PlatformFileHandle handle, const char* data, int length)
{
return PlatformBridge::writeToFile(handle, data, length);
return PlatformSupport::writeToFile(handle, data, length);
}
Vector<String> listDirectory(const String& path, const String& filter)
......
......@@ -31,8 +31,8 @@
#include "config.h"
#include "Language.h"
#include "PlatformBridge.h"
#include "PlatformString.h"
#include "PlatformSupport.h"
namespace WebCore {
......@@ -40,7 +40,7 @@ String platformDefaultLanguage()
{
static String computedDefaultLanguage;
if (computedDefaultLanguage.isEmpty())
computedDefaultLanguage = PlatformBridge::computedDefaultLanguage();
computedDefaultLanguage = PlatformSupport::computedDefaultLanguage();
return computedDefaultLanguage;
}
......
......@@ -31,18 +31,18 @@
#include "config.h"
#include "LinkHash.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
namespace WebCore {
LinkHash visitedLinkHash(const UChar* url, unsigned length)
{
return PlatformBridge::visitedLinkHash(url, length);
return PlatformSupport::visitedLinkHash(url, length);
}
LinkHash visitedLinkHash(const KURL& base, const AtomicString& attributeURL)
{
return PlatformBridge::visitedLinkHash(base, attributeURL);
return PlatformSupport::visitedLinkHash(base, attributeURL);
}
} // namespace WebCore
......@@ -32,26 +32,26 @@
#include "MIMETypeRegistry.h"
#include "MediaPlayer.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#include "PluginDataChromium.h"
#include <wtf/text/CString.h>
// NOTE: Unlike other ports, we don't use the shared implementation in
// MIMETypeRegistry.cpp. Instead, we need to route most functions via
// the PlatformBridge to the embedder.
// the PlatformSupport to the embedder.
namespace WebCore {
String MIMETypeRegistry::getMIMETypeForExtension(const String &ext)
{
return PlatformBridge::mimeTypeForExtension(ext);
return PlatformSupport::mimeTypeForExtension(ext);
}
#if ENABLE(FILE_SYSTEM)
String MIMETypeRegistry::getWellKnownMIMETypeForExtension(const String &ext)
{
// This method must be thread safe and should not consult the OS/registry.
return PlatformBridge::wellKnownMimeTypeForExtension(ext);
return PlatformSupport::wellKnownMimeTypeForExtension(ext);
}
#endif
......@@ -63,7 +63,7 @@ String MIMETypeRegistry::getPreferredExtensionForMIMEType(const String& type)
// FIXME: Is this really necessary??
String mimeType = type.substring(0, static_cast<unsigned>(type.find(';')));
String ext = PlatformBridge::preferredExtensionForMIMEType(type);
String ext = PlatformSupport::preferredExtensionForMIMEType(type);
if (!ext.isEmpty() && ext[0] == '.')
ext = ext.substring(1);
......@@ -89,7 +89,7 @@ String MIMETypeRegistry::getMIMETypeForPath(const String& path)
bool MIMETypeRegistry::isSupportedImageMIMEType(const String& mimeType)
{
return PlatformBridge::isSupportedImageMIMEType(mimeType);
return PlatformSupport::isSupportedImageMIMEType(mimeType);
}
bool MIMETypeRegistry::isSupportedImageResourceMIMEType(const String& mimeType)
......@@ -104,12 +104,12 @@ bool MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(const String& mimeTyp
bool MIMETypeRegistry::isSupportedJavaScriptMIMEType(const String& mimeType)
{
return PlatformBridge::isSupportedJavaScriptMIMEType(mimeType);
return PlatformSupport::isSupportedJavaScriptMIMEType(mimeType);
}
bool MIMETypeRegistry::isSupportedNonImageMIMEType(const String& mimeType)
{
return PlatformBridge::isSupportedNonImageMIMEType(mimeType);
return PlatformSupport::isSupportedNonImageMIMEType(mimeType);
}
bool MIMETypeRegistry::isSupportedMediaMIMEType(const String& mimeType)
......
......@@ -41,7 +41,7 @@
#include "Image.h"
#include "KURL.h"
#include "NativeImageSkia.h"
#include "PlatformBridge.h"
#include "PlatformSupport.h"
#include "Range.h"
#include "RenderImage.h"
#include "markup.h"
......@@ -91,7 +91,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
#endif
replaceNBSPWithSpace(plainText);
PlatformBridge::clipboardWriteSelection(html, url, plainText, canSmartCopyOrDelete);
PlatformSupport::clipboardWriteSelection(html, url, plainText, canSmartCopyOrDelete);
}
void Pasteboard::writePlainText(const String& text)
......@@ -99,9 +99,9 @@ void Pasteboard::writePlainText(const String& text)
#if OS(WINDOWS)
String plainText(text);
replaceNewlinesWithWindowsStyleNewlines(plainText);
PlatformBridge::clipboardWritePlainText(plainText);
PlatformSupport::clipboardWritePlainText(plainText);
#else
PlatformBridge::clipboardWritePlainText(text);
PlatformSupport::clipboardWritePlainText(text);
#endif
}
......@@ -116,7 +116,7 @@ void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame)
title = url.host();
}
PlatformBridge::clipboardWriteURL(url, title);
PlatformSupport::clipboardWriteURL(url, title);
}
void Pasteboard::writeImage(Node* node, const KURL&, const String& title)
......@@ -152,17 +152,17 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String& title)
}
KURL url = urlString.isEmpty() ? KURL() : node->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(urlString));
PlatformBridge::clipboardWriteImage(bitmap, url, title);
PlatformSupport::clipboardWriteImage(bitmap, url, title);
}