1/*
2 * Copyright (C) 2014 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 *    notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 *    notice, this list of conditions and the following disclaimer in the
11 *    documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#ifndef APIContextConfiguration_h
27#define APIContextConfiguration_h
28
29#include "APIObject.h"
30#include <wtf/text/WTFString.h>
31
32namespace WebKit {
33struct WebContextConfiguration;
34}
35
36namespace API {
37
38class ContextConfiguration : public ObjectImpl<Object::Type::ContextConfiguration> {
39public:
40    static PassRefPtr<ContextConfiguration> create()
41    {
42        return adoptRef(new ContextConfiguration);
43    }
44    virtual ~ContextConfiguration();
45
46    String indexedDBDatabaseDirectory() const { return m_indexedDBDatabaseDirectory; }
47    void setIndexedDBDatabaseDirectory(const String& indexedDBDatabaseDirectory) { m_indexedDBDatabaseDirectory = indexedDBDatabaseDirectory; }
48
49    String injectedBundlePath() const { return m_injectedBundlePath; }
50    void setInjectedBundlePath(const String& injectedBundlePath) { m_injectedBundlePath = injectedBundlePath; }
51
52    String localStorageDirectory() const { return m_localStorageDirectory; }
53    void setLocalStorageDirectory(const String& localStorageDirectory) { m_localStorageDirectory = localStorageDirectory; }
54
55    String webSQLDatabaseDirectory() const { return m_webSQLDatabaseDirectory; }
56    void setWebSQLDatabaseDirectory(const String& webSQLDatabaseDirectory) { m_webSQLDatabaseDirectory = webSQLDatabaseDirectory; }
57
58    WebKit::WebContextConfiguration webContextConfiguration() const;
59
60private:
61    ContextConfiguration();
62
63    String m_indexedDBDatabaseDirectory;
64    String m_injectedBundlePath;
65    String m_localStorageDirectory;
66    String m_webSQLDatabaseDirectory;
67};
68
69} // namespace API
70
71#endif // APIContextConfiguration_h
72