15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/* 25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright (C) 2009 Google Inc. All rights reserved. 35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without 55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * modification, are permitted provided that the following conditions are 65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * met: 75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * * Redistributions of source code must retain the above copyright 95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * notice, this list of conditions and the following disclaimer. 105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * * Redistributions in binary form must reproduce the above 115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer 125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * in the documentation and/or other materials provided with the 135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * distribution. 145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * * Neither the name of Google Inc. nor the names of its 155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * contributors may be used to endorse or promote products derived from 165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * this software without specific prior written permission. 175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * 185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) */ 305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 315267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#ifndef WebKit_h 325267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#define WebKit_h 335c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 345267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#include "../platform/Platform.h" 355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 3606f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)namespace v8 { 3706f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)class Isolate; 3806f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)} 3906f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles) 4051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)namespace blink { 41926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 425267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// Must be called on the thread that will be the main WebKit thread before 435267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// using any other WebKit APIs. The provided Platform; must be 445267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// non-null and must remain valid until the current thread calls shutdown. 4506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)BLINK_EXPORT void initialize(Platform*); 46926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 475267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// Must be called on the thread that will be the main WebKit thread before 485267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// using any other WebKit APIs. The provided Platform must be 495267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// non-null and must remain valid until the current thread calls shutdown. 505267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// 515267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// This is a special variant of initialize that does not intitialize V8. 5206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)BLINK_EXPORT void initializeWithoutV8(Platform*); 5306f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles) 5406f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)// Get the V8 Isolate for the main thread. 5506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)// initialize must have been called first. 5606f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)BLINK_EXPORT v8::Isolate* mainThreadIsolate(); 575c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) 585267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// Once shutdown, the Platform passed to initialize will no longer 595267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// be accessed. No other WebKit objects should be in use when this function is 605267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// called. Any background threads created by WebKit are promised to be 615267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// terminated by the time this function returns. 6206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)BLINK_EXPORT void shutdown(); 635267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) 64e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch// Once shutdown, the Platform passed to initializeWithoutV8 will no longer 65e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch// be accessed. No other WebKit objects should be in use when this function is 66e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch// called. Any background threads created by WebKit are promised to be 67e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch// terminated by the time this function returns. 68e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch// 69e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch// If initializeWithoutV8() was used to initialize WebKit, shutdownWithoutV8 70e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch// must be called to shut it down again. 7106f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)BLINK_EXPORT void shutdownWithoutV8(); 72e69819bd8e388ea4ad1636a19aa6b2eed4952191Ben Murdoch 735267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// Alters the rendering of content to conform to a fixed set of rules. 7406f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)BLINK_EXPORT void setLayoutTestMode(bool); 7506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)BLINK_EXPORT bool layoutTestMode(); 765267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) 77a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch// Alters the rendering of fonts for layout tests. 78f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo LiuBLINK_EXPORT void setFontAntialiasingEnabledForTest(bool); 79f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo LiuBLINK_EXPORT bool fontAntialiasingEnabledForTest(); 80a9984bf9ddc3cf73fdae3f29134a2bab379e7029Ben Murdoch 815267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// Enables the named log channel. See WebCore/platform/Logging.h for details. 8206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)BLINK_EXPORT void enableLogChannel(const char*); 835267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) 845267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// Purge the plugin list cache. If |reloadPages| is true, any pages 855267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)// containing plugins will be reloaded after refreshing the plugin list. 8606f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)BLINK_EXPORT void resetPluginCache(bool reloadPages); 875267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) 8851b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)} // namespace blink 895267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) 905267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#endif 91