Title: [118590] trunk/Source
Revision
118590
Author
[email protected]
Date
2012-05-25 17:22:34 -0700 (Fri, 25 May 2012)

Log Message

[Chomium] Move sandboxSupport to Platform.h
https://bugs.webkit.org/show_bug.cgi?id=87518

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

Source/Platform:

* Platform.gypi:
* chromium/public/Platform.h:
(WebKit):
(Platform):
(WebKit::Platform::sandboxSupport):
* chromium/public/android/WebSandboxSupport.h: Added.
(WebKit):
(WebSandboxSupport):
* chromium/public/linux/WebFontFamily.h: Added.
(WebKit):
(WebFontFamily):
* chromium/public/linux/WebSandboxSupport.h: Added.
(WebKit):
(WebSandboxSupport):
* chromium/public/mac/WebSandboxSupport.h: Added.
(WebKit):
(WebSandboxSupport):
* chromium/public/win/WebSandboxSupport.h: Added.
(WebKit):
(WebSandboxSupport):

Source/WebKit/chromium:

* WebKit.gyp:
* public/platform/WebKitPlatformSupport.h:
(WebKit):
(WebKitPlatformSupport):
* public/platform/android/WebSandboxSupport.h:
* public/platform/linux/WebFontFamily.h:
* public/platform/linux/WebSandboxSupport.h:
* public/platform/mac/WebSandboxSupport.h:
* public/platform/win/WebSandboxSupport.h:
* src/PlatformSupport.cpp:
(WebCore::PlatformSupport::ensureFontLoaded):
(WebCore::PlatformSupport::loadFont):
(WebCore::PlatformSupport::getFontFamilyForCharacters):
(WebCore::PlatformSupport::getRenderStyleForStrike):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (118589 => 118590)


--- trunk/Source/Platform/ChangeLog	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/Platform/ChangeLog	2012-05-26 00:22:34 UTC (rev 118590)
@@ -1,3 +1,33 @@
+2012-05-25  Mark Pilgrim  <[email protected]>
+
+        [Chomium] Move sandboxSupport to Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=87518
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * Platform.gypi:
+        * chromium/public/Platform.h:
+        (WebKit):
+        (Platform):
+        (WebKit::Platform::sandboxSupport):
+        * chromium/public/android/WebSandboxSupport.h: Added.
+        (WebKit):
+        (WebSandboxSupport):
+        * chromium/public/linux/WebFontFamily.h: Added.
+        (WebKit):
+        (WebFontFamily):
+        * chromium/public/linux/WebSandboxSupport.h: Added.
+        (WebKit):
+        (WebSandboxSupport):
+        * chromium/public/mac/WebSandboxSupport.h: Added.
+        (WebKit):
+        (WebSandboxSupport):
+        * chromium/public/win/WebSandboxSupport.h: Added.
+        (WebKit):
+        (WebSandboxSupport):
+
 2012-05-17  Andrey Kosyakov  <[email protected]>
 
         [chromium] add instrumentation for compositing

Modified: trunk/Source/Platform/Platform.gypi (118589 => 118590)


--- trunk/Source/Platform/Platform.gypi	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/Platform/Platform.gypi	2012-05-26 00:22:34 UTC (rev 118590)
@@ -112,9 +112,13 @@
             'chromium/public/WebVideoFrame.h',
             'chromium/public/WebVideoFrameProvider.h',
             'chromium/public/WebWorkerRunLoop.h',
+            'chromium/public/android/WebSandboxSupport.h',
             'chromium/public/android/WebThemeEngine.h',
+            'chromium/public/linux/WebSandboxSupport.h',
             'chromium/public/linux/WebThemeEngine.h',
+            'chromium/public/mac/WebSandboxSupport.h',
             'chromium/public/mac/WebThemeEngine.h',
+            'chromium/public/win/WebSandboxSupport.h',
             'chromium/public/win/WebThemeEngine.h',
             'chromium/src/Platform.cpp',
             'chromium/src/WebCString.cpp',

Modified: trunk/Source/Platform/chromium/public/Platform.h (118589 => 118590)


--- trunk/Source/Platform/chromium/public/Platform.h	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/Platform/chromium/public/Platform.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -56,6 +56,7 @@
 class WebPeerConnectionHandlerClient;
 class WebURL;
 class WebURLLoader;
+class WebSandboxSupport;
 class WebSocketStreamHandle;
 class WebThemeEngine;
 class WebThread;
@@ -80,6 +81,9 @@
     // Must return non-null.
     virtual WebMimeRegistry* mimeRegistry() { return 0; }
 
+    // May return null if sandbox support is not necessary
+    virtual WebSandboxSupport* sandboxSupport() { return 0; }
+
     // May return null on some platforms.
     virtual WebThemeEngine* themeEngine() { return 0; }
 

Copied: trunk/Source/Platform/chromium/public/android/WebSandboxSupport.h (from rev 118589, trunk/Source/WebKit/chromium/public/platform/android/WebSandboxSupport.h) (0 => 118590)


--- trunk/Source/Platform/chromium/public/android/WebSandboxSupport.h	                        (rev 0)
+++ trunk/Source/Platform/chromium/public/android/WebSandboxSupport.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2011 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
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * 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
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebSandboxSupport_h
+#define WebSandboxSupport_h
+
+namespace WebKit {
+
+// Empty class, as we need it to compile.
+class WebSandboxSupport {
+public:
+};
+
+} // namespace WebKit
+
+#endif

Copied: trunk/Source/Platform/chromium/public/linux/WebFontFamily.h (from rev 118589, trunk/Source/WebKit/chromium/public/platform/linux/WebFontFamily.h) (0 => 118590)


--- trunk/Source/Platform/chromium/public/linux/WebFontFamily.h	                        (rev 0)
+++ trunk/Source/Platform/chromium/public/linux/WebFontFamily.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011 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
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * 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
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFontFamily_h
+#define WebFontFamily_h
+
+#include "../WebCString.h"
+#include "../WebCommon.h"
+
+namespace WebKit {
+
+struct WebFontFamily {
+    WebCString name;
+    bool isBold;
+    bool isItalic;
+};
+
+} // namespace WebKit
+
+#endif // WebFontFamily_h

Copied: trunk/Source/Platform/chromium/public/linux/WebSandboxSupport.h (from rev 118589, trunk/Source/WebKit/chromium/public/platform/linux/WebSandboxSupport.h) (0 => 118590)


--- trunk/Source/Platform/chromium/public/linux/WebSandboxSupport.h	                        (rev 0)
+++ trunk/Source/Platform/chromium/public/linux/WebSandboxSupport.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -0,0 +1,65 @@
+/*
+ * 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
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * 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
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebSandboxSupport_h
+#define WebSandboxSupport_h
+
+#include "../WebCommon.h"
+#include "../WebString.h"
+#include "WebFontFamily.h"
+
+namespace WebKit {
+
+struct WebFontRenderStyle;
+
+// Put methods here that are required due to sandbox restrictions.
+class WebSandboxSupport {
+public:
+    // Fonts ---------------------------------------------------------------
+
+    // Get a font family which contains glyphs for the given Unicode
+    // code-points.
+    //   characters: a UTF-16 encoded string
+    //   numCharacters: the number of 16-bit words in |characters|
+    //   preferredLocale: preferred locale identifier for the |characters|
+    //                    (e.g. "en", "ja", "zh-CN")
+    //
+    // Returns a string with the font family on an empty string if the
+    // request cannot be satisfied.
+    // Returns a WebFontFamily instance with the font name. The instance has empty font name if the request cannot be satisfied.
+    // FIXME: Make this to be a pure virtual function after transition.
+    virtual void getFontFamilyForCharacters(const WebUChar* characters, size_t numCharacters, const char* preferredLocale, WebFontFamily*) = 0;
+
+    virtual void getRenderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle*) = 0;
+};
+
+} // namespace WebKit
+
+#endif

Copied: trunk/Source/Platform/chromium/public/mac/WebSandboxSupport.h (from rev 118589, trunk/Source/WebKit/chromium/public/platform/mac/WebSandboxSupport.h) (0 => 118590)


--- trunk/Source/Platform/chromium/public/mac/WebSandboxSupport.h	                        (rev 0)
+++ trunk/Source/Platform/chromium/public/mac/WebSandboxSupport.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 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
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * 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
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebSandboxSupport_h
+#define WebSandboxSupport_h
+
+typedef struct CGFont* CGFontRef;
+
+#ifdef __OBJC__
+@class NSFont;
+#else
+class NSFont;
+#endif
+
+namespace WebKit {
+
+// Put methods here that are required due to sandbox restrictions.
+class WebSandboxSupport {
+public:
+    // Given an input font - |srcFont| [which can't be loaded due to sandbox
+    // restrictions]. Return a font belonging to an equivalent font file
+    // that can be used to access the font and a unique identifier corresponding
+    // to the on-disk font file.
+    //
+    // If this function succeeds, the caller assumes ownership of the |out|
+    // parameter and must call CGFontRelease() to unload it when done.
+    //
+    // Returns: true on success, false on error.
+    virtual bool loadFont(NSFont* srcFont, CGFontRef* out, uint32_t* fontID) = 0;
+};
+
+} // namespace WebKit
+
+#endif

Copied: trunk/Source/Platform/chromium/public/win/WebSandboxSupport.h (from rev 118589, trunk/Source/WebKit/chromium/public/platform/win/WebSandboxSupport.h) (0 => 118590)


--- trunk/Source/Platform/chromium/public/win/WebSandboxSupport.h	                        (rev 0)
+++ trunk/Source/Platform/chromium/public/win/WebSandboxSupport.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -0,0 +1,52 @@
+/*
+ * 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
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * 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
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebSandboxSupport_h
+#define WebSandboxSupport_h
+
+typedef struct HFONT__* HFONT;
+
+namespace WebKit {
+
+// Put methods here that are required due to sandbox restrictions.
+class WebSandboxSupport {
+public:
+    // Sometimes a Win32 API call will fail because a font is not loaded,
+    // and due to sandbox restrictions, the current process may be unable
+    // to access the filesystem to load the font. So, this call serves as
+    // a failover to ask the embedder to try some other way to load the
+    // font (usually by delegating to an empowered process to have it load
+    // the font). Returns true if the font was successfully loaded.
+    virtual bool ensureFontLoaded(HFONT) = 0;
+};
+
+} // namespace WebKit
+
+#endif

Modified: trunk/Source/WebKit/chromium/ChangeLog (118589 => 118590)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-26 00:22:34 UTC (rev 118590)
@@ -1,3 +1,27 @@
+2012-05-25  Mark Pilgrim  <[email protected]>
+
+        [Chomium] Move sandboxSupport to Platform.h
+        https://bugs.webkit.org/show_bug.cgi?id=87518
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * WebKit.gyp:
+        * public/platform/WebKitPlatformSupport.h:
+        (WebKit):
+        (WebKitPlatformSupport):
+        * public/platform/android/WebSandboxSupport.h:
+        * public/platform/linux/WebFontFamily.h:
+        * public/platform/linux/WebSandboxSupport.h:
+        * public/platform/mac/WebSandboxSupport.h:
+        * public/platform/win/WebSandboxSupport.h:
+        * src/PlatformSupport.cpp:
+        (WebCore::PlatformSupport::ensureFontLoaded):
+        (WebCore::PlatformSupport::loadFont):
+        (WebCore::PlatformSupport::getFontFamilyForCharacters):
+        (WebCore::PlatformSupport::getRenderStyleForStrike):
+
 2012-05-25  Dana Jansens  <[email protected]>
 
         [chromium] WebLayerTreeViewImpl should not hide methods in CCLayerTreeHost with signatures that match the Client interface

Modified: trunk/Source/WebKit/chromium/WebKit.gyp (118589 => 118590)


--- trunk/Source/WebKit/chromium/WebKit.gyp	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/WebKit/chromium/WebKit.gyp	2012-05-26 00:22:34 UTC (rev 118590)
@@ -339,9 +339,6 @@
                 'public/platform/WebURLRequest.h',
                 'public/platform/WebURLResponse.h',
                 'public/platform/WebVector.h',
-                'public/platform/android/WebSandboxSupport.h',
-                'public/platform/mac/WebSandboxSupport.h',
-                'public/platform/win/WebSandboxSupport.h',
                 'public/win/WebInputEventFactory.h',
                 'public/win/WebSandboxSupport.h',
                 'public/win/WebScreenInfoFactory.h',

Modified: trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h (118589 => 118590)


--- trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -53,16 +53,12 @@
 class WebIDBKeyPath; // FIXME: Does this belong in platform?
 class WebMessagePortChannel; // FIXME: Does this belong in platform?
 class WebPluginListBuilder; // FIXME: Does this belong in platform?
-class WebSandboxSupport;
 class WebSharedWorkerRepository; // FIXME: Does this belong in platform?
 class WebStorageNamespace; // FIXME: Does this belong in platform?
 
 // FIXME: Eventually all these API will need to move to WebKit::Platform.
 class WebKitPlatformSupport : public Platform {
 public:
-    // May return null if sandbox support is not necessary
-    virtual WebSandboxSupport* sandboxSupport() { return 0; }
-
     // DOM Storage --------------------------------------------------
 
     // Return a LocalStorage namespace that corresponds to the following path.

Modified: trunk/Source/WebKit/chromium/public/platform/android/WebSandboxSupport.h (118589 => 118590)


--- trunk/Source/WebKit/chromium/public/platform/android/WebSandboxSupport.h	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/WebKit/chromium/public/platform/android/WebSandboxSupport.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -28,16 +28,4 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebSandboxSupport_h
-#define WebSandboxSupport_h
-
-namespace WebKit {
-
-// Empty class, as we need it to compile.
-class WebSandboxSupport {
-public:
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../../../Platform/chromium/public/android/WebSandboxSupport.h"

Modified: trunk/Source/WebKit/chromium/public/platform/linux/WebFontFamily.h (118589 => 118590)


--- trunk/Source/WebKit/chromium/public/platform/linux/WebFontFamily.h	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/WebKit/chromium/public/platform/linux/WebFontFamily.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -28,20 +28,4 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebFontFamily_h
-#define WebFontFamily_h
-
-#include "../WebCString.h"
-#include "../WebCommon.h"
-
-namespace WebKit {
-
-struct WebFontFamily {
-    WebCString name;
-    bool isBold;
-    bool isItalic;
-};
-
-} // namespace WebKit
-
-#endif // WebFontFamily_h
+#include "../../../../../Platform/chromium/public/linux/WebFontFamily.h"

Modified: trunk/Source/WebKit/chromium/public/platform/linux/WebSandboxSupport.h (118589 => 118590)


--- trunk/Source/WebKit/chromium/public/platform/linux/WebSandboxSupport.h	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/WebKit/chromium/public/platform/linux/WebSandboxSupport.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -28,38 +28,4 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebSandboxSupport_h
-#define WebSandboxSupport_h
-
-#include "../WebCommon.h"
-#include "../WebString.h"
-#include "WebFontFamily.h"
-
-namespace WebKit {
-
-struct WebFontRenderStyle;
-
-// Put methods here that are required due to sandbox restrictions.
-class WebSandboxSupport {
-public:
-    // Fonts ---------------------------------------------------------------
-
-    // Get a font family which contains glyphs for the given Unicode
-    // code-points.
-    //   characters: a UTF-16 encoded string
-    //   numCharacters: the number of 16-bit words in |characters|
-    //   preferredLocale: preferred locale identifier for the |characters|
-    //                    (e.g. "en", "ja", "zh-CN")
-    //
-    // Returns a string with the font family on an empty string if the
-    // request cannot be satisfied.
-    // Returns a WebFontFamily instance with the font name. The instance has empty font name if the request cannot be satisfied.
-    // FIXME: Make this to be a pure virtual function after transition.
-    virtual void getFontFamilyForCharacters(const WebUChar* characters, size_t numCharacters, const char* preferredLocale, WebFontFamily*) = 0;
-
-    virtual void getRenderStyleForStrike(const char* family, int sizeAndStyle, WebFontRenderStyle* style) = 0;
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../../../Platform/chromium/public/linux/WebSandboxSupport.h"

Modified: trunk/Source/WebKit/chromium/public/platform/mac/WebSandboxSupport.h (118589 => 118590)


--- trunk/Source/WebKit/chromium/public/platform/mac/WebSandboxSupport.h	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/WebKit/chromium/public/platform/mac/WebSandboxSupport.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -28,34 +28,4 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebSandboxSupport_h
-#define WebSandboxSupport_h
-
-typedef struct CGFont* CGFontRef;
-
-#ifdef __OBJC__
-@class NSFont;
-#else
-class NSFont;
-#endif
-
-namespace WebKit {
-
-// Put methods here that are required due to sandbox restrictions.
-class WebSandboxSupport {
-public:
-    // Given an input font - |srcFont| [which can't be loaded due to sandbox
-    // restrictions]. Return a font belonging to an equivalent font file
-    // that can be used to access the font and a unique identifier corresponding
-    // to the on-disk font file.
-    //
-    // If this function succeeds, the caller assumes ownership of the |out|
-    // parameter and must call CGFontRelease() to unload it when done.
-    //
-    // Returns: true on success, false on error.
-    virtual bool loadFont(NSFont* srcFont, CGFontRef* out, uint32_t* fontID) = 0;
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../../../Platform/chromium/public/mac/WebSandboxSupport.h"

Modified: trunk/Source/WebKit/chromium/public/platform/win/WebSandboxSupport.h (118589 => 118590)


--- trunk/Source/WebKit/chromium/public/platform/win/WebSandboxSupport.h	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/WebKit/chromium/public/platform/win/WebSandboxSupport.h	2012-05-26 00:22:34 UTC (rev 118590)
@@ -28,25 +28,4 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebSandboxSupport_h
-#define WebSandboxSupport_h
-
-typedef struct HFONT__* HFONT;
-
-namespace WebKit {
-
-// Put methods here that are required due to sandbox restrictions.
-class WebSandboxSupport {
-public:
-    // Sometimes a Win32 API call will fail because a font is not loaded,
-    // and due to sandbox restrictions, the current process may be unable
-    // to access the filesystem to load the font. So, this call serves as
-    // a failover to ask the embedder to try some other way to load the
-    // font (usually by delegating to an empowered process to have it load
-    // the font). Returns true if the font was successfully loaded.
-    virtual bool ensureFontLoaded(HFONT) = 0;
-};
-
-} // namespace WebKit
-
-#endif
+#include "../../../../../Platform/chromium/public/win/WebSandboxSupport.h"

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (118589 => 118590)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-05-26 00:18:27 UTC (rev 118589)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-05-26 00:22:34 UTC (rev 118590)
@@ -414,7 +414,7 @@
 #if OS(WINDOWS)
 bool PlatformSupport::ensureFontLoaded(HFONT font)
 {
-    WebSandboxSupport* ss = webKitPlatformSupport()->sandboxSupport();
+    WebSandboxSupport* ss = WebKit::Platform::current()->sandboxSupport();
 
     // if there is no sandbox, then we can assume the font
     // was able to be loaded successfully already
@@ -425,7 +425,7 @@
 #if OS(DARWIN)
 bool PlatformSupport::loadFont(NSFont* srcFont, CGFontRef* out, uint32_t* fontID)
 {
-    WebSandboxSupport* ss = webKitPlatformSupport()->sandboxSupport();
+    WebSandboxSupport* ss = WebKit::Platform::current()->sandboxSupport();
     if (ss)
         return ss->loadFont(srcFont, out, fontID);
 
@@ -448,8 +448,8 @@
     family->isItalic = false;
 #else
     WebFontFamily webFamily;
-    if (webKitPlatformSupport()->sandboxSupport())
-        webKitPlatformSupport()->sandboxSupport()->getFontFamilyForCharacters(characters, numCharacters, preferredLocale, &webFamily);
+    if (WebKit::Platform::current()->sandboxSupport())
+        WebKit::Platform::current()->sandboxSupport()->getFontFamilyForCharacters(characters, numCharacters, preferredLocale, &webFamily);
     else
         WebFontInfo::familyForChars(characters, numCharacters, preferredLocale, &webFamily);
     family->name = String::fromUTF8(webFamily.name.data(), webFamily.name.length());
@@ -463,8 +463,8 @@
 #if !OS(ANDROID)
     WebFontRenderStyle style;
 
-    if (webKitPlatformSupport()->sandboxSupport())
-        webKitPlatformSupport()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style);
+    if (WebKit::Platform::current()->sandboxSupport())
+        WebKit::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style);
     else
         WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to