| Differences between
and this patch
- a/Source/WebKit2/Platform/CoreIPC/Connection.h -1 / +22 lines
Lines 44-49 a/Source/WebKit2/Platform/CoreIPC/Connection.h_sec1
44
#include <string>
44
#include <string>
45
#elif PLATFORM(QT)
45
#elif PLATFORM(QT)
46
class QSocketNotifier;
46
class QSocketNotifier;
47
#if OS(SYMBIAN)
48
#include <platform/rpipe.h>
49
#endif
47
#include "PlatformProcessIdentifier.h"
50
#include "PlatformProcessIdentifier.h"
48
#endif
51
#endif
49
52
Lines 99-105 public: a/Source/WebKit2/Platform/CoreIPC/Connection.h_sec2
99
    typedef HANDLE Identifier;
102
    typedef HANDLE Identifier;
100
    static bool createServerAndClientIdentifiers(Identifier& serverIdentifier, Identifier& clientIdentifier);
103
    static bool createServerAndClientIdentifiers(Identifier& serverIdentifier, Identifier& clientIdentifier);
101
#elif PLATFORM(QT)
104
#elif PLATFORM(QT)
105
#if OS(SYMBIAN)
106
    typedef RPipe* Identifier;
107
#else
102
    typedef int Identifier;
108
    typedef int Identifier;
109
#endif
103
#elif PLATFORM(GTK)
110
#elif PLATFORM(GTK)
104
    typedef int Identifier;
111
    typedef int Identifier;
105
#endif
112
#endif
Lines 129-135 public: a/Source/WebKit2/Platform/CoreIPC/Connection.h_sec3
129
    void markCurrentlyDispatchedMessageAsInvalid();
136
    void markCurrentlyDispatchedMessageAsInvalid();
130
137
131
    static const unsigned long long NoTimeout = 10000000000ULL;
138
    static const unsigned long long NoTimeout = 10000000000ULL;
132
139
#if PLATFORM(QT) && OS(SYMBIAN)
140
    static const int MaxPipeCapacity = 4096; 
141
#endif
142
    
133
    template<typename T> bool send(const T& message, uint64_t destinationID, unsigned messageSendFlags = 0);
143
    template<typename T> bool send(const T& message, uint64_t destinationID, unsigned messageSendFlags = 0);
134
    template<typename T> bool sendSync(const T& message, const typename T::Reply& reply, uint64_t destinationID, double timeout = NoTimeout);
144
    template<typename T> bool sendSync(const T& message, const typename T::Reply& reply, uint64_t destinationID, double timeout = NoTimeout);
135
    template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, double timeout);
145
    template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, double timeout);
Lines 310-318 private: a/Source/WebKit2/Platform/CoreIPC/Connection.h_sec4
310
    void readyReadHandler();
320
    void readyReadHandler();
311
321
312
    Vector<uint8_t> m_readBuffer;
322
    Vector<uint8_t> m_readBuffer;
323
#if OS(SYMBIAN)
324
	RPipe m_readPipe;
325
    RPipe m_writePipe;
326
    QSymbianPipeNotifier* m_pipeReadNotifier; 
327
    struct ParsedMessage { 
328
        uint8_t* start ; // base address of message
329
        uint32_t size ;  // size in bytes
330
        uint32_t messageID;        
331
    };
332
#else
313
    size_t m_currentMessageSize;
333
    size_t m_currentMessageSize;
314
    QSocketNotifier* m_socketNotifier;
334
    QSocketNotifier* m_socketNotifier;
315
    int m_socketDescriptor;
335
    int m_socketDescriptor;
336
#endif
316
#elif PLATFORM(GTK)
337
#elif PLATFORM(GTK)
317
    void readEventHandler();
338
    void readEventHandler();
318
    void processCompletedMessage();
339
    void processCompletedMessage();
- a/Source/WebKit2/Platform/CoreIPC/qt/ConnectionQt.cpp +3 lines
Lines 44-49 using namespace std; a/Source/WebKit2/Platform/CoreIPC/qt/ConnectionQt.cpp_sec1
44
44
45
namespace CoreIPC {
45
namespace CoreIPC {
46
46
47
#if PLATFORM(QT) && !OS(SYMBIAN)
47
static const size_t messageMaxSize = 4096;
48
static const size_t messageMaxSize = 4096;
48
static const size_t attachmentMaxAmount = 255;
49
static const size_t attachmentMaxAmount = 255;
49
50
Lines 361-366 bool Connection::sendOutgoingMessage(MessageID messageID, PassOwnPtr<ArgumentEnc a/Source/WebKit2/Platform/CoreIPC/qt/ConnectionQt.cpp_sec2
361
    return true;
362
    return true;
362
}
363
}
363
364
365
#endif
366
364
void Connection::setShouldCloseConnectionOnProcessTermination(WebKit::PlatformProcessIdentifier process)
367
void Connection::setShouldCloseConnectionOnProcessTermination(WebKit::PlatformProcessIdentifier process)
365
{
368
{
366
    m_connectionQueue.scheduleWorkOnTermination(process, WorkItem::create(this, &Connection::connectionDidClose));
369
    m_connectionQueue.scheduleWorkOnTermination(process, WorkItem::create(this, &Connection::connectionDidClose));
- a/Source/WebKit2/Platform/CoreIPC/qt/ConnectionSymbian.cpp +156 lines
Line 0 a/Source/WebKit2/Platform/CoreIPC/qt/ConnectionSymbian.cpp_sec1
1
#include "config.h"
2
#if PLATFORM(QT) && OS(SYMBIAN)
3
#include "Connection.h"
4
5
#include "ArgumentEncoder.h"
6
#include "WorkItem.h"
7
#include <QVector>
8
#include <qt/QSymbianPipeNotifier.h>
9
#include <wtf/Assertions.h>
10
namespace CoreIPC {
11
12
static const uint32_t trailer = 0xDEADCAFE;
13
14
void Connection::platformInitialize(Identifier identifier)
15
{
16
   
17
    if (m_isServer) {
18
        m_readPipe = static_cast<RPipe*>(identifier)[0];
19
        m_writePipe = static_cast<RPipe*>(identifier)[1];
20
    } else {
21
        TInt error;
22
        // Open pipes via RProcess' "environment data slots" number 3 & 4
23
        // This is the Symbian OS way of passing handles from parent to child
24
        error = m_readPipe.Open(3); 
25
        error|= m_writePipe.Open(4);
26
        if (error) { 
27
            m_isConnected = false;
28
            return;
29
        }
30
    }
31
32
    m_readBuffer.resize(CoreIPC::Connection::MaxPipeCapacity);
33
    m_isConnected = true; 
34
        
35
}
36
37
void Connection::platformInvalidate()
38
{
39
    m_readBuffer.shrink(0);
40
    
41
    delete m_pipeReadNotifier;
42
    m_readPipe.Close();
43
    m_writePipe.Close();
44
    // TODO: delete the memory for the RPipe[2] array
45
    m_isConnected = false;
46
}
47
48
// Check if the data matches the trailer pattern
49
static inline bool isMessageTrailer(uint8_t *data) 
50
{  
51
    return ( trailer == *(reinterpret_cast<uint32_t*>(data)) );  
52
}
53
54
// Handler for "bytes available to read" event on pipe
55
void Connection::readyReadHandler()
56
{
57
    RProcess proc;
58
    
59
    m_pipeReadNotifier->setEnabled(false);
60
        
61
    // Make a temporary Symbian descriptor to point to existing buffer, with 0 current size, and a max size
62
    TPtr8 readPtr(m_readBuffer.data(), 0, m_readBuffer.size());
63
    
64
    // Read all the bytes we can. Note that multiple messages can be read in one read operation due to the stream-oriented channel
65
    TInt bytesRead = m_readPipe.Read(readPtr, readPtr.MaxSize());
66
    
67
    if (bytesRead > 0) {
68
                
69
        __ASSERT_ALWAYS(bytesRead == readPtr.Size(), User::Invariant());
70
        
71
        // Start parsing from the end of the buffer, where we expect to see a trailer and the size of this message
72
        uint8_t* messageStart = m_readBuffer.data() + bytesRead;
73
        
74
        // Place to keep track of parsed messages
75
        QVector<ParsedMessage> messsagePointers;
76
        
77
        while (true) {
78
            
79
            messageStart -= sizeof(uint32_t); // move back pointer to read trailer             
80
            
81
            if (!isMessageTrailer(messageStart)) // bail if no trailer 
82
                break; 
83
                 
84
            messageStart -= sizeof(uint32_t); // move back pointer to read messageSize
85
            uint32_t messageSize = *reinterpret_cast<uint32_t*>(messageStart); 
86
            
87
            messageStart -= sizeof(uint32_t); // move back to read messageID
88
            uint32_t messageID = *reinterpret_cast<uint32_t*>(messageStart); 
89
            
90
            messageStart -= (messageSize - sizeof(uint32_t)); 
91
                                           
92
            // Keep a note of message boundary
93
            const ParsedMessage aMessage = {messageStart, messageSize - sizeof(uint32_t), messageID};
94
            messsagePointers.append(aMessage); 
95
            
96
            __ASSERT_ALWAYS(messageStart >=  m_readBuffer.data(), User::Invariant());
97
            
98
            if (messageStart == m_readBuffer.data()) 
99
                break;
100
                
101
        } // while loop
102
      
103
        // Now dispatch parsed messages in the order they were written by the sender
104
        for (int i = messsagePointers.size()-1; i >=0 ; i--) { 
105
            const ParsedMessage aMessage = messsagePointers.at(i);
106
            processIncomingMessage(MessageID::fromInt(aMessage.messageID), adoptPtr(new ArgumentDecoder(aMessage.start, aMessage.size)));
107
        }
108
        
109
    } 
110
    
111
    m_pipeReadNotifier->setEnabled(true);
112
    
113
}
114
115
116
bool Connection::open()
117
{
118
    // platformInitialize() should have taken care of the connection by now
119
    if (!m_isConnected) 
120
        return false; 
121
    
122
    // Start listening for read 
123
    m_pipeReadNotifier = m_connectionQueue.registerPipeEventHandler(m_readPipe, QSymbianPipeNotifier::PipeReadDataAvailable, WorkItem::create(this, &Connection::readyReadHandler));
124
        
125
    // Schedule a read.
126
    m_connectionQueue.scheduleWork(WorkItem::create(this, &Connection::readyReadHandler));
127
    
128
    return true;
129
}
130
131
bool Connection::platformCanSendOutgoingMessages() const
132
{
133
    // Seems adequate for now  
134
    return true;
135
}
136
137
bool Connection::sendOutgoingMessage(MessageID messageID, PassOwnPtr<ArgumentEncoder> arguments)
138
{    
139
    // Encode messageID. 
140
    arguments->encodeUInt32(messageID.toInt());
141
    
142
    // Encode size of message excluding this 4-byte field and the 4-byte trailer which follows.
143
    arguments->encodeUInt32(arguments->bufferSize());
144
    
145
    // a trailer marker (magic number) which makes it easier to spot mesage boundary at the receiver
146
    arguments->encodeUInt32(trailer);
147
    
148
    // Write to pipe using a temporary Symbian descriptor
149
    TPtr8 writeBuffer(arguments->buffer(), arguments->bufferSize(), arguments->bufferSize() );
150
    TInt bytesWritten = m_writePipe.Write(writeBuffer, writeBuffer.Size() );     
151
    
152
    return (bytesWritten ==  writeBuffer.Size());
153
}
154
155
} // namespace CoreIPC
156
#endif
- a/Source/WebKit2/Platform/CoreIPC/qt/QSymbianPipeNotifier.cpp +78 lines
Line 0 a/Source/WebKit2/Platform/CoreIPC/qt/QSymbianPipeNotifier.cpp_sec1
1
2
#include "config.h"
3
#if PLATFORM (QT) && OS(SYMBIAN)
4
5
#include "QObject"
6
#include "QDebug"
7
#include "QCoreApplication"
8
#include "QEvent"
9
#include "QSymbianPipeNotifier.h"
10
#include "SymbianPipeActiveObject.h"
11
#include <platform/rpipe.h>
12
13
// Wrapper QObject around a Symbian Active Object (AO). We must use use an active object
14
// while registering asynchronous notification requests (e.g data available to read/space available to write) 
15
// on native Symbian IPC APIs such as RPipe
16
QSymbianPipeNotifier::QSymbianPipeNotifier(RPipe& pipe, EventType type, int bytes, QObject *parent) 
17
    :m_pipe(pipe), m_type(type), m_bytes(bytes), QObject(parent)
18
{
19
    d_ptr = new SymbianPipeActiveObject(pipe, type, bytes, this);
20
}
21
22
QSymbianPipeNotifier::~QSymbianPipeNotifier() 
23
{
24
    delete d_ptr;
25
}
26
27
void QSymbianPipeNotifier::setEnabled(bool enabled) 
28
{ 
29
    if (!d_ptr) { 
30
        // deferred initialization via postEvent(). Useful when a moveToThread() requires the Active Object to 
31
        // be deleted and re-created on the new thread. 
32
        QEvent *postThreadChangeEvent = new QEvent(PostThreadChangeEventType);
33
        QCoreApplication::postEvent(this, postThreadChangeEvent);
34
        return; 
35
    }
36
   
37
    d_ptr->setEnabled(enabled);       
38
}
39
40
// Symbian active objects (AOs) are bound to an "active scheduler" which is thread-local.
41
// Therefore, to allow moveToThread() to work correctly with the parent QObject we need to 
42
// delete the AO and re-create it once the execution moves to the new thread
43
bool QSymbianPipeNotifier::event(QEvent* ev)
44
{        
45
    if (ev->type() == QEvent::ThreadChange) { // pre-migration event
46
47
        if (d_ptr) { 
48
            if (d_ptr->IsAdded()) {
49
                bool oldState = d_ptr->IsActive();
50
                d_ptr->Deque(); // cancel outstanding request + remove from active scheduler
51
            }     
52
            delete d_ptr; 
53
            d_ptr = 0; 
54
        }
55
56
        // Fire a deferred re-initialization request
57
        QEvent *postThreadChangeEvent = new QEvent(PostThreadChangeEventType);
58
        QCoreApplication::postEvent(this, postThreadChangeEvent);
59
        return true;
60
    } 
61
    
62
    if (ev->type() == PostThreadChangeEventType) { // custom, post-migration event
63
        
64
        if (!d_ptr) { 
65
            d_ptr = new SymbianPipeActiveObject(m_pipe, m_type, m_bytes, this);
66
            // FIXME: We presumptively enable watch, even though client may have called
67
            // setEnabled(false) before the call to moveToThread()
68
            d_ptr->setEnabled(true);
69
        }
70
        
71
        return true; 
72
    }
73
74
    return false; 
75
    
76
}
77
78
#endif
- a/Source/WebKit2/Platform/CoreIPC/qt/QSymbianPipeNotifier.h +57 lines
Line 0 a/Source/WebKit2/Platform/CoreIPC/qt/QSymbianPipeNotifier.h_sec1
1
2
#ifndef QSYMBIANPIPENOTIFIER_H_
3
#define QSYMBIANPIPENOTIFIER_H_
4
5
#include <QObject>
6
#include <QEvent>
7
#include <platform/rpipe.h>
8
9
class SymbianPipeActiveObject;
10
11
// This class wraps a friendly QObject interface around a Symbian
12
// active object (AO). The AO helps us watch for data available (for read) 
13
// or write space available events on Symbian RPipe objects.  
14
class QSymbianPipeNotifier : public QObject
15
{
16
    Q_OBJECT
17
public: 
18
    enum EventType {
19
        // data can be read
20
        PipeReadDataAvailable,
21
        // write pipe can take more data
22
        PipeWriteSpaceAvailable
23
    };
24
    QSymbianPipeNotifier(RPipe&, EventType, int, QObject *parent = 0);
25
    virtual ~QSymbianPipeNotifier();
26
    bool event(QEvent*);
27
    
28
public slots:
29
    void setEnabled(bool);
30
31
signals:
32
    // emitted when PipeReadDataAvailable occurs
33
    void readyToRead(int);
34
    // emitted when PipeWriteSpaceAvailable occurs
35
    void readyToWrite(int);
36
    void errorOccured(int);
37
    
38
protected:
39
    SymbianPipeActiveObject* d_ptr;
40
41
private: 
42
    // We need to delete and re-create SymbianPipeActiveObject to 
43
    // enable QObject->moveToThread() on this object, so break PIMPL
44
    // rules, and keep some c'tor args around 
45
    RPipe m_pipe; 
46
    EventType m_type;
47
    int m_bytes;   
48
    
49
    // Custom event to help with QObject->moveToThread() 
50
    static const QEvent::Type PostThreadChangeEventType = (QEvent::Type)(QEvent::User + 100);
51
        
52
    friend class SymbianPipeActiveObject;
53
    Q_DISABLE_COPY(QSymbianPipeNotifier)
54
};
55
56
#endif // QSYMBIANPIPENOTIFIER_H_
57
- a/Source/WebKit2/Platform/CoreIPC/qt/SymbianPipeActiveObject.cpp +90 lines
Line 0 a/Source/WebKit2/Platform/CoreIPC/qt/SymbianPipeActiveObject.cpp_sec1
1
#include "config.h"
2
#if PLATFORM(QT) && OS(SYMBIAN)
3
#include "SymbianPipeActiveObject.h"
4
5
#include "QSymbianPipeNotifier.h"
6
#include <platform/rpipe.h>
7
8
9
// The Symbian Active Object that registers notification requests with the kernel, similar to POSIX's select() system call
10
// Note that unlike anything on Unix, Symbian Active Objects are schedulable objects that are bound to the current thread's Active Scheduler. 
11
// Therefore they are a lightweight version of threads from a resource utilization POV. 
12
SymbianPipeActiveObject::SymbianPipeActiveObject(RPipe pipe, QSymbianPipeNotifier::EventType type, int spaceInBytes, QSymbianPipeNotifier *qq)
13
    : CActive(CActive::EPriorityStandard), m_pipe(pipe), m_type(type), m_bytes(spaceInBytes), q_ptr(qq) 
14
{ 
15
    CActiveScheduler::Add(this);
16
}
17
    
18
SymbianPipeActiveObject::~SymbianPipeActiveObject() 
19
{ 
20
    Cancel();
21
}
22
23
void SymbianPipeActiveObject::setEnabled(bool enabled) 
24
{
25
    // start listening
26
    if (enabled && !IsActive()) {  
27
        if (m_type == QSymbianPipeNotifier::PipeReadDataAvailable) { 
28
            m_pipe.NotifyDataAvailable(iStatus);
29
            SetActive(); // base class method to declare the above request as "pending" completion
30
        }
31
        
32
        if (m_type == QSymbianPipeNotifier::PipeWriteSpaceAvailable) {
33
            int freeSpaceNeeded = m_bytes < 0 ? 1 : m_bytes; 
34
            m_pipe.NotifySpaceAvailable(freeSpaceNeeded, iStatus);
35
            SetActive(); // base class method to declare the above request as "pending" completion
36
        }
37
        
38
        return;
39
    }
40
    
41
    // stop listening
42
    if (!enabled) {
43
        Cancel(); // Automatically leads to a DoCancel() 
44
        return;
45
    }
46
}
47
48
// This method gets run by the Symbian OS Active Scheduler when the
49
// request initiated by NotifyDataAvailable above is marked as completed
50
// We send a Qt signal via our parent QObject, and then implicitly go
51
// into a disabled state, i.e notifications are off  
52
void SymbianPipeActiveObject::RunL() 
53
{
54
    Q_Q(QSymbianPipeNotifier);
55
    
56
    if (iStatus != KErrNone) {
57
        emit q->errorOccured(iStatus.Int());
58
        return; 
59
    }
60
    
61
    if (m_type == QSymbianPipeNotifier::PipeReadDataAvailable) {
62
        const int bytesAvailable =  m_pipe.Size(); // peek bytes available to read
63
        if (bytesAvailable > 0) {  
64
            emit q->readyToRead(bytesAvailable);
65
            return; 
66
        }
67
    }
68
    
69
    if (m_type == QSymbianPipeNotifier::PipeWriteSpaceAvailable) { 
70
        emit q->readyToWrite(0);
71
        return;
72
    }
73
74
}
75
  
76
void SymbianPipeActiveObject::DoCancel() 
77
{ 
78
    if (m_type == QSymbianPipeNotifier::PipeReadDataAvailable) { 
79
        m_pipe.CancelDataAvailable();
80
        return;
81
    }
82
               
83
    if (m_type == QSymbianPipeNotifier::PipeWriteSpaceAvailable) { 
84
        m_pipe.CancelSpaceAvailable();
85
        return;
86
    }
87
    
88
}
89
90
#endif
- a/Source/WebKit2/Platform/CoreIPC/qt/SymbianPipeActiveObject.h +30 lines
Line 0 a/Source/WebKit2/Platform/CoreIPC/qt/SymbianPipeActiveObject.h_sec1
1
2
#ifndef SymbianPipeActiveObject_h
3
#define SymbianPipeActiveObject_h
4
5
#include <e32base.h>
6
#include "QSymbianPipeNotifier.h"
7
#include "qglobal.h"
8
#include <platform/rpipe.h>
9
10
class SymbianPipeActiveObject : public CActive {
11
public:
12
    SymbianPipeActiveObject(RPipe, QSymbianPipeNotifier::EventType, int, QSymbianPipeNotifier *);
13
    ~SymbianPipeActiveObject();
14
    
15
private:
16
    void setEnabled(bool);
17
    
18
    void RunL();
19
    void DoCancel(); 
20
21
    RPipe m_pipe;
22
    QSymbianPipeNotifier::EventType m_type;
23
    int m_bytes; // only used for write pipe; -1 means unused
24
    
25
    QSymbianPipeNotifier * q_ptr;
26
    Q_DECLARE_PUBLIC(QSymbianPipeNotifier)
27
};
28
29
#endif // SymbianPipeActiveObject_h
30
- a/Source/WebKit2/Platform/PlatformProcessIdentifier.h +4 lines
Lines 38-44 typedef pid_t PlatformProcessIdentifier; a/Source/WebKit2/Platform/PlatformProcessIdentifier.h_sec1
38
#elif PLATFORM(WIN)
38
#elif PLATFORM(WIN)
39
typedef HANDLE PlatformProcessIdentifier;
39
typedef HANDLE PlatformProcessIdentifier;
40
#elif PLATFORM(QT)
40
#elif PLATFORM(QT)
41
#if OS(SYMBIAN)
42
typedef RProcess* PlatformProcessIdentifier;
43
#else
41
typedef QProcess* PlatformProcessIdentifier;
44
typedef QProcess* PlatformProcessIdentifier;
45
#endif
42
#elif PLATFORM(GTK)
46
#elif PLATFORM(GTK)
43
typedef pid_t PlatformProcessIdentifier;
47
typedef pid_t PlatformProcessIdentifier;
44
#endif
48
#endif
- a/Source/WebKit2/Platform/SharedMemory.h -1 / +9 lines
Lines 60-66 public: a/Source/WebKit2/Platform/SharedMemory.h_sec1
60
        void encode(CoreIPC::ArgumentEncoder*) const;
60
        void encode(CoreIPC::ArgumentEncoder*) const;
61
        static bool decode(CoreIPC::ArgumentDecoder*, Handle&);
61
        static bool decode(CoreIPC::ArgumentDecoder*, Handle&);
62
62
63
#if PLATFORM(QT)
63
#if PLATFORM(QT) && !OS(SYMBIAN)
64
        CoreIPC::Attachment releaseToAttachment() const;
64
        CoreIPC::Attachment releaseToAttachment() const;
65
        void adoptFromAttachment(int fileDescriptor, size_t);
65
        void adoptFromAttachment(int fileDescriptor, size_t);
66
#endif
66
#endif
Lines 71-78 public: a/Source/WebKit2/Platform/SharedMemory.h_sec2
71
#elif PLATFORM(WIN)
71
#elif PLATFORM(WIN)
72
        mutable HANDLE m_handle;
72
        mutable HANDLE m_handle;
73
#elif PLATFORM(QT)
73
#elif PLATFORM(QT)
74
#if OS(SYMBIAN)
75
        mutable uint32_t m_name;
76
#else
74
        mutable int m_fileDescriptor;
77
        mutable int m_fileDescriptor;
75
#endif
78
#endif
79
#endif
76
        size_t m_size;
80
        size_t m_size;
77
    };
81
    };
78
    
82
    
Lines 100-107 private: a/Source/WebKit2/Platform/SharedMemory.h_sec3
100
#elif PLATFORM(WIN)
104
#elif PLATFORM(WIN)
101
    HANDLE m_handle;
105
    HANDLE m_handle;
102
#elif PLATFORM(QT)
106
#elif PLATFORM(QT)
107
#if OS(SYMBIAN)
108
    int m_handle;
109
#else
103
    int m_fileDescriptor;
110
    int m_fileDescriptor;
104
#endif
111
#endif
112
#endif
105
};
113
};
106
114
107
};
115
};
- a/Source/WebKit2/Platform/WorkQueue.h +7 lines
Lines 45-50 a/Source/WebKit2/Platform/WorkQueue.h_sec1
45
#include "PlatformProcessIdentifier.h"
45
#include "PlatformProcessIdentifier.h"
46
class QObject;
46
class QObject;
47
class QThread;
47
class QThread;
48
#if OS(SYMBIAN)
49
#include "qt/QSymbianPipeNotifier.h"
50
#endif
48
#elif PLATFORM(GTK)
51
#elif PLATFORM(GTK)
49
typedef struct _GMainContext GMainContext;
52
typedef struct _GMainContext GMainContext;
50
typedef struct _GMainLoop GMainLoop;
53
typedef struct _GMainLoop GMainLoop;
Lines 82-88 public: a/Source/WebKit2/Platform/WorkQueue.h_sec2
82
    void registerHandle(HANDLE, PassOwnPtr<WorkItem>);
85
    void registerHandle(HANDLE, PassOwnPtr<WorkItem>);
83
    void unregisterAndCloseHandle(HANDLE);
86
    void unregisterAndCloseHandle(HANDLE);
84
#elif PLATFORM(QT)
87
#elif PLATFORM(QT)
88
#if OS(SYMBIAN)
89
    QSymbianPipeNotifier* registerPipeEventHandler(RPipe pipe, QSymbianPipeNotifier::EventType type, PassOwnPtr<WorkItem> workItem);
90
#else
85
    QSocketNotifier* registerSocketEventHandler(int, QSocketNotifier::Type, PassOwnPtr<WorkItem>);
91
    QSocketNotifier* registerSocketEventHandler(int, QSocketNotifier::Type, PassOwnPtr<WorkItem>);
92
#endif
86
    void scheduleWorkOnTermination(WebKit::PlatformProcessIdentifier, PassOwnPtr<WorkItem>);
93
    void scheduleWorkOnTermination(WebKit::PlatformProcessIdentifier, PassOwnPtr<WorkItem>);
87
#elif PLATFORM(GTK)
94
#elif PLATFORM(GTK)
88
    void registerEventSourceHandler(int, int, PassOwnPtr<WorkItem>);
95
    void registerEventSourceHandler(int, int, PassOwnPtr<WorkItem>);
- a/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp +4 lines
Lines 26-31 a/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp_sec1
26
 */
26
 */
27
27
28
#include "config.h"
28
#include "config.h"
29
#if PLATFORM(QT) && !OS(SYMBIAN)
29
#include "SharedMemory.h"
30
#include "SharedMemory.h"
30
31
31
#include "ArgumentDecoder.h"
32
#include "ArgumentDecoder.h"
Lines 226-228 unsigned SharedMemory::systemPageSize() a/Source/WebKit2/Platform/qt/SharedMemoryQt.cpp_sec2
226
}
227
}
227
228
228
} // namespace WebKit
229
} // namespace WebKit
230
231
#endif
232
- a/Source/WebKit2/Platform/qt/SharedMemorySymbian.cpp +143 lines
Line 0 a/Source/WebKit2/Platform/qt/SharedMemorySymbian.cpp_sec1
1
#include "config.h"
2
#if PLATFORM(QT) && OS(SYMBIAN)
3
#include "SharedMemory.h"
4
#include "ArgumentDecoder.h"
5
#include "ArgumentEncoder.h"
6
#include <sys/param.h>
7
#include <e32math.h>
8
9
namespace WebKit {
10
11
_LIT(KFormatToString,"%d");
12
13
SharedMemory::Handle::Handle()
14
    : m_name(0) , m_size(0)
15
{
16
}
17
18
SharedMemory::Handle::~Handle()
19
{   
20
}
21
22
bool SharedMemory::Handle::isNull() const
23
{
24
    return m_name == 0;
25
}
26
27
void SharedMemory::Handle::encode(CoreIPC::ArgumentEncoder* encoder) const
28
{
29
    ASSERT(!isNull());    
30
    encoder->encodeUInt32(m_size);
31
    // name of the global chunk (masquarading as int32_t for ease of serialization) 
32
    encoder->encodeUInt32(m_name); 
33
}
34
35
bool SharedMemory::Handle::decode(CoreIPC::ArgumentDecoder* decoder, Handle& handle)
36
{
37
    size_t size;
38
    if (!decoder->decodeUInt32(size))
39
        return false; 
40
    
41
    uint32_t name;
42
     if (!decoder->decodeUInt32(name))
43
         return false;
44
       
45
     handle.m_size = size;
46
     handle.m_name = name; 
47
     return true;
48
}
49
50
// Create a new shared memory segment
51
PassRefPtr<SharedMemory> SharedMemory::create(size_t size)
52
{
53
    
54
    // On Symbian, global chunks (shared memory segments) have system-unique names, so we pick a random 
55
    // number from the kernel's random pool and use it as a string.  
56
    // Using an integer simplifies serialization of the name in Handle::encode()
57
    uint32_t random = Math::Random(); 
58
    TBuf<KMaxKernelName> globalChunkName;
59
    globalChunkName.Format(KFormatToString, random);
60
    
61
    RChunk chunk; 
62
    TInt error; 
63
    if ( (error = chunk.CreateGlobal(globalChunkName, size, size)) != KErrNone ) {
64
        qCritical() << " Failed to create Symbian shared memory " << error; 
65
        return 0; 
66
    }
67
        
68
    RefPtr<SharedMemory> sharedMemory(adoptRef(new SharedMemory));
69
    sharedMemory->m_handle = chunk.Handle();
70
    sharedMemory->m_size = chunk.Size();
71
    sharedMemory->m_data = static_cast<void*>(chunk.Base());
72
        
73
    return sharedMemory.release();
74
}
75
76
77
// Take a shared memory handle given usually by another process, and open it locally for read or write
78
PassRefPtr<SharedMemory> SharedMemory::create(const Handle& handle, Protection protection)
79
{
80
    if (handle.isNull())
81
        return 0;
82
     
83
    // Convert number to string, and open the global chunk
84
    TBuf<KMaxKernelName> globalChunkName;
85
    globalChunkName.Format(KFormatToString, handle.m_name);
86
87
    RChunk chunk;
88
    TInt error = chunk.OpenGlobal(globalChunkName, false); // NOTE: Symbian OS doesn't support read-only global chunks
89
    if (error) 
90
        return 0;
91
        
92
    RefPtr<SharedMemory> sharedMemory(adoptRef(new SharedMemory));
93
    sharedMemory->m_handle = chunk.Handle();
94
    sharedMemory->m_size = chunk.Size();
95
    sharedMemory->m_data = static_cast<void*>(chunk.Base());
96
      
97
    return sharedMemory.release();
98
}
99
100
SharedMemory::~SharedMemory()
101
{
102
    RChunk chunk;
103
    if (!chunk.SetReturnedHandle(m_handle)) {
104
        THandleInfo info;
105
        chunk.HandleInfo(&info);
106
        // FIXME: We need to figure out when to Decommit() memory from the chunk
107
        // FIXME: We need to also understand how Close() decrements the kernel-side ref count of the 
108
        // shared memory segment and leads to premature decommits() of the shared memory area
109
    }
110
}
111
112
113
// Initialized the passed Handle 
114
bool SharedMemory::createHandle(Handle& handle, Protection protection)
115
{
116
     
117
    ASSERT_ARG(handle, handle.isNull());
118
        
119
    RChunk chunk; 
120
    if (chunk.SetReturnedHandle(m_handle))
121
        return false;
122
    
123
    // convert the name (string form) to uint32_t
124
    TName globalChunkName = chunk.Name();
125
    TLex lexer(globalChunkName);
126
    TUint32 nameAsInt = 0; 
127
    if (lexer.Val(nameAsInt, EDecimal)) 
128
        return false; 
129
         
130
    handle.m_name = nameAsInt; 
131
    handle.m_size = m_size;
132
    
133
    return true;
134
}
135
136
unsigned SharedMemory::systemPageSize()
137
{
138
    return PAGE_SIZE;
139
}
140
141
} // namespace WebKit
142
143
#endif
- a/Source/WebKit2/Platform/qt/WorkQueueQt.cpp +21 lines
Lines 77-82 public: a/Source/WebKit2/Platform/qt/WorkQueueQt.cpp_sec1
77
    WorkItem* m_workItem;
77
    WorkItem* m_workItem;
78
};
78
};
79
79
80
#if OS(SYMBIAN)
81
QSymbianPipeNotifier* WorkQueue::registerPipeEventHandler(RPipe pipe, QSymbianPipeNotifier::EventType type, PassOwnPtr<WorkItem> workItem) 
82
{
83
    QSymbianPipeNotifier* notifier = new QSymbianPipeNotifier(pipe, type, -1);
84
     
85
    notifier->setEnabled(false);
86
    notifier->moveToThread(m_workThread);
87
    
88
    WorkQueue::WorkItemQt* itemQt = new WorkQueue::WorkItemQt(this, notifier, SIGNAL(readyToRead(int)), workItem.leakPtr());
89
    
90
    itemQt->moveToThread(m_workThread);    
91
    
92
    notifier->setEnabled(true);
93
    
94
    return notifier;
95
}
96
#else
80
QSocketNotifier* WorkQueue::registerSocketEventHandler(int socketDescriptor, QSocketNotifier::Type type, PassOwnPtr<WorkItem> workItem)
97
QSocketNotifier* WorkQueue::registerSocketEventHandler(int socketDescriptor, QSocketNotifier::Type type, PassOwnPtr<WorkItem> workItem)
81
{
98
{
82
    ASSERT(m_workThread);
99
    ASSERT(m_workThread);
Lines 89-94 QSocketNotifier* WorkQueue::registerSocketEventHandler(int socketDescriptor, QSo a/Source/WebKit2/Platform/qt/WorkQueueQt.cpp_sec2
89
    notifier->setEnabled(true);
106
    notifier->setEnabled(true);
90
    return notifier;
107
    return notifier;
91
}
108
}
109
#endif
92
110
93
void WorkQueue::platformInitialize(const char*)
111
void WorkQueue::platformInitialize(const char*)
94
{
112
{
Lines 120-127 void WorkQueue::scheduleWorkAfterDelay(PassOwnPtr<WorkItem> item, double delayIn a/Source/WebKit2/Platform/qt/WorkQueueQt.cpp_sec3
120
138
121
void WorkQueue::scheduleWorkOnTermination(WebKit::PlatformProcessIdentifier process, PassOwnPtr<WorkItem> workItem)
139
void WorkQueue::scheduleWorkOnTermination(WebKit::PlatformProcessIdentifier process, PassOwnPtr<WorkItem> workItem)
122
{
140
{
141
    // FIXME: Need to implement a process watcher using Symbian RProcess
142
#if !OS(SYMBIAN)
123
    WorkQueue::WorkItemQt* itemQt = new WorkQueue::WorkItemQt(this, process, SIGNAL(finished(int, QProcess::ExitStatus)), workItem.leakPtr());
143
    WorkQueue::WorkItemQt* itemQt = new WorkQueue::WorkItemQt(this, process, SIGNAL(finished(int, QProcess::ExitStatus)), workItem.leakPtr());
124
    itemQt->moveToThread(m_workThread);
144
    itemQt->moveToThread(m_workThread);
145
#endif
125
}
146
}
126
147
127
#include "WorkQueueQt.moc"
148
#include "WorkQueueQt.moc"
- a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp +3 lines
Lines 25-30 a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp_sec1
25
 */
25
 */
26
26
27
#include "config.h"
27
#include "config.h"
28
#if PLATFORM(QT) && !OS(SYMBIAN)
28
#include "ProcessLauncher.h"
29
#include "ProcessLauncher.h"
29
30
30
#include "Connection.h"
31
#include "Connection.h"
Lines 154-156 void ProcessLauncher::platformInvalidate() a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp_sec2
154
} // namespace WebKit
155
} // namespace WebKit
155
156
156
#include "ProcessLauncherQt.moc"
157
#include "ProcessLauncherQt.moc"
158
159
#endif
- a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherSymbian.cpp +85 lines
Line 0 a/Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherSymbian.cpp_sec1
1
#include "config.h"
2
#if PLATFORM(QT) && OS(SYMBIAN)
3
#include "ProcessLauncher.h"
4
5
#include "Connection.h"
6
#include "RunLoop.h"
7
#include "WebProcess.h"
8
#include "platform/rpipe.h"
9
#include <QDebug>
10
#include <qglobal.h>
11
12
_LIT(KWorkerProcessName,"QtWebProcess.exe");
13
14
using namespace WebCore;
15
namespace WebKit {
16
17
void ProcessLauncher::launchProcess()
18
{
19
    // Make a pair of half-duplex pipes
20
    RPipe* localPipes = new RPipe[2]; 
21
    RPipe* remotePipes = new RPipe[2]; 
22
     
23
    RPipe::Init();
24
    TInt error;
25
    // Create a pipe. First arg is the read-end RPipe and the second is the write-end. 
26
    error = RPipe::Create(CoreIPC::Connection::MaxPipeCapacity, remotePipes[0], localPipes[1] );
27
    error = RPipe::Create(CoreIPC::Connection::MaxPipeCapacity, localPipes[0], remotePipes[1]);
28
    
29
    // Prepare to launch worker process
30
    RProcess* workerProcess = new RProcess() ;
31
    error = workerProcess->Create(KWorkerProcessName(), KNullDesC);
32
    // Pass ownership of pipes via RProcess' "environment data slots". 
33
    // This is the Symbian way of passing ownership of handles from parent to child
34
    error = workerProcess->SetParameter(3, remotePipes[0]); // reader
35
    error = workerProcess->SetParameter(4, remotePipes[1]); // writer
36
                
37
    // Block until the remote process is up
38
    workerProcess->Resume();
39
    TRequestStatus launchStatus; 
40
    workerProcess->Rendezvous(launchStatus); 
41
    User::WaitForRequest(launchStatus);
42
    
43
    if (launchStatus.Int() != KErrNone) 
44
        qCritical() << " Worker process failed to launch " << launchStatus.Int();
45
    
46
    // Close the pipe ends we just passed to the remote
47
    remotePipes[0].Close(); 
48
    remotePipes[1].Close();
49
    delete remotePipes;
50
    
51
    CoreIPC::Connection::Identifier identifier = localPipes;  
52
    
53
    // Declare launch process as done. Note that this class owns 'workerProcess', but Connection owns 'identifier' 
54
    RunLoop::main()->scheduleWork(WorkItem::create(this, &WebKit::ProcessLauncher::didFinishLaunchingProcess, workerProcess, identifier));
55
}
56
57
void ProcessLauncher::terminateProcess()
58
{
59
	if (!m_processIdentifier)
60
	    return;
61
	
62
    // Important: Killing another process (even if we spawned it) requires PowerManagement capability,
63
    // which is a high bar to jump over for any user application. It's also dangerous.  
64
    // TODO: Check if we should signal the web process through the pipe to terminate itself?
65
    // ..although that won't work if the process is unresponsive!
66
	RProcess me;
67
	if (me.HasCapability(ECapabilityPowerMgmt)) 
68
	    m_processIdentifier->Terminate(KErrNone);
69
	
70
}
71
72
void ProcessLauncher::platformInvalidate()
73
{
74
    if (!m_processIdentifier)
75
           return;
76
77
    m_processIdentifier->Close();
78
    delete m_processIdentifier;
79
    m_processIdentifier = 0;
80
}
81
82
} // namespace WebKit
83
84
85
#endif
- a/Source/WebKit2/UIProcess/Launcher/qt/ThreadLauncherQt.cpp -9 / +20 lines
Lines 47-61 using namespace WebCore; a/Source/WebKit2/UIProcess/Launcher/qt/ThreadLauncherQt.cpp_sec1
47
47
48
namespace WebKit {
48
namespace WebKit {
49
49
50
static CoreIPC::Connection::Identifier invalidConnectionIdentifier()
51
{ 
52
    CoreIPC::Connection::Identifier identifier; 
53
#if OS(SYMBIAN)
54
    identifier = 0; // NULL pointer
55
#else
56
    identifier = -1; // invalid socket descriptor
57
#endif
58
    return identifier;
59
}
60
50
static void* webThreadBody(void* /* context */)
61
static void* webThreadBody(void* /* context */)
51
{
62
{
52
    // Initialization
63
    // Initialization
53
    JSC::initializeThreading();
64
    JSC::initializeThreading();
54
    WTF::initializeMainThread();
65
    WTF::initializeMainThread();
55
66
56
    // FIXME: We do not support threaded mode for now.
67
    // FIXME: The Qt port does not support threaded mode for now.
57
68
58
    WebProcess::shared().initialize(-1, RunLoop::current());
69
    WebProcess::shared().initialize(invalidConnectionIdentifier(), RunLoop::current());
59
    RunLoop::run();
70
    RunLoop::run();
60
71
61
    return 0;
72
    return 0;
Lines 63-77 static void* webThreadBody(void* /* context */) a/Source/WebKit2/UIProcess/Launcher/qt/ThreadLauncherQt.cpp_sec2
63
74
64
CoreIPC::Connection::Identifier ThreadLauncher::createWebThread()
75
CoreIPC::Connection::Identifier ThreadLauncher::createWebThread()
65
{
76
{
66
    srandom(time(0));
77
    
67
    int connectionIdentifier = random();
78
    // FIXME: The Qt port does not support threaded mode for now.
68
79
    
69
    if (!createThread(webThreadBody, reinterpret_cast<void*>(connectionIdentifier), "WebKit2: WebThread")) {
80
    if (!createThread(webThreadBody, 0, "WebKit2: WebThread")) {
70
        qWarning() << "failed starting thread";
81
        qWarning() << "failed starting thread";
71
        return 0;
82
        return invalidConnectionIdentifier();
72
    }
83
    }
73
84
74
    return connectionIdentifier;
85
    return invalidConnectionIdentifier();
75
}
86
}
76
87
77
} // namespace WebKit
88
} // namespace WebKit
- a/Source/WebKit2/WebKit2.pri +2 lines
Lines 70-75 symbian { a/Source/WebKit2/WebKit2.pri_sec1
70
    INCLUDEPATH = $$WEBKIT2_INCLUDEPATH $$WEBKIT2_GENERATED_SOURCES_DIR $$INCLUDEPATH
70
    INCLUDEPATH = $$WEBKIT2_INCLUDEPATH $$WEBKIT2_GENERATED_SOURCES_DIR $$INCLUDEPATH
71
}
71
}
72
72
73
symbian: LIBS += -lrpipe
74
73
defineTest(prependWebKit2Lib) {
75
defineTest(prependWebKit2Lib) {
74
    pathToWebKit2Output = $$ARGS/$$WEBKIT2_DESTDIR
76
    pathToWebKit2Output = $$ARGS/$$WEBKIT2_DESTDIR
75
77
- a/Source/WebKit2/WebKit2.pro +6 lines
Lines 100-105 HEADERS += \ a/Source/WebKit2/WebKit2.pro_sec1
100
    Platform/CoreIPC/HandleMessage.h \
100
    Platform/CoreIPC/HandleMessage.h \
101
    Platform/CoreIPC/MessageID.h \
101
    Platform/CoreIPC/MessageID.h \
102
    Platform/CoreIPC/MessageSender.h \
102
    Platform/CoreIPC/MessageSender.h \
103
    Platform/CoreIPC/qt/QSymbianPipeNotifier.h \
103
    Platform/Logging.h \
104
    Platform/Logging.h \
104
    Platform/Module.h \
105
    Platform/Module.h \
105
    Platform/PlatformProcessIdentifier.h \
106
    Platform/PlatformProcessIdentifier.h \
Lines 300-305 SOURCES += \ a/Source/WebKit2/WebKit2.pro_sec2
300
    Platform/CoreIPC/DataReference.cpp \
301
    Platform/CoreIPC/DataReference.cpp \
301
    Platform/CoreIPC/qt/AttachmentQt.cpp \
302
    Platform/CoreIPC/qt/AttachmentQt.cpp \
302
    Platform/CoreIPC/qt/ConnectionQt.cpp \
303
    Platform/CoreIPC/qt/ConnectionQt.cpp \
304
    Platform/CoreIPC/qt/ConnectionSymbian.cpp \
305
    Platform/CoreIPC/qt/QSymbianPipeNotifier.cpp \
306
    Platform/CoreIPC/qt/SymbianPipeActiveObject.cpp \
303
    Platform/Logging.cpp \
307
    Platform/Logging.cpp \
304
    Platform/Module.cpp \
308
    Platform/Module.cpp \
305
    Platform/RunLoop.cpp \
309
    Platform/RunLoop.cpp \
Lines 307-312 SOURCES += \ a/Source/WebKit2/WebKit2.pro_sec3
307
    Platform/qt/ModuleQt.cpp \
311
    Platform/qt/ModuleQt.cpp \
308
    Platform/qt/RunLoopQt.cpp \
312
    Platform/qt/RunLoopQt.cpp \
309
    Platform/qt/SharedMemoryQt.cpp \
313
    Platform/qt/SharedMemoryQt.cpp \
314
    Platform/qt/SharedMemorySymbian.cpp \
310
    Platform/qt/WorkQueueQt.cpp \
315
    Platform/qt/WorkQueueQt.cpp \
311
    Shared/Plugins/Netscape/NetscapePluginModule.cpp \
316
    Shared/Plugins/Netscape/NetscapePluginModule.cpp \
312
    Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
317
    Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
Lines 372-377 SOURCES += \ a/Source/WebKit2/WebKit2.pro_sec4
372
    UIProcess/Launcher/ProcessLauncher.cpp \
377
    UIProcess/Launcher/ProcessLauncher.cpp \
373
    UIProcess/Launcher/ThreadLauncher.cpp \
378
    UIProcess/Launcher/ThreadLauncher.cpp \
374
    UIProcess/Launcher/qt/ProcessLauncherQt.cpp \
379
    UIProcess/Launcher/qt/ProcessLauncherQt.cpp \
380
    UIProcess/Launcher/qt/ProcessLauncherSymbian.cpp \
375
    UIProcess/Launcher/qt/ThreadLauncherQt.cpp \
381
    UIProcess/Launcher/qt/ThreadLauncherQt.cpp \
376
    UIProcess/Plugins/PluginInfoStore.cpp \
382
    UIProcess/Plugins/PluginInfoStore.cpp \
377
    UIProcess/Plugins/PluginProcessProxy.cpp \
383
    UIProcess/Plugins/PluginProcessProxy.cpp \
- a/Source/WebKit2/WebProcess.pro -1 / +16 lines
Lines 35-41 linux-* { a/Source/WebKit2/WebProcess.pro_sec1
35
35
36
symbian {
36
symbian {
37
    TARGET.UID3 = 0xA000E544
37
    TARGET.UID3 = 0xA000E544
38
    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
38
    MMP_RULES += pageddata
39
    RSS_RULES += "hidden = KAppIsHidden;" # No app icon in grid or in task switcher
40
    
41
    TARGET.CAPABILITY *= ReadUserData 
42
    TARGET.CAPABILITY *= WriteUserData
43
    TARGET.CAPABILITY *= NetworkServices  # QtNetwork and Bearer
44
    
45
    # See QtMobility docs on Symbian capabilities: 
46
    # http://doc.qt.nokia.com/qtmobility/quickstart.html
47
    TARGET.CAPABILITY *= Location         # geolocation
48
    TARGET.CAPABILITY *= ReadDeviceData   # geolocation, sensors
49
    TARGET.CAPABILITY *= WriteDeviceData  # geolocation
50
    TARGET.CAPABILITY *= LocalServices    # geolocation, sysinfo
51
    
52
    # We may later need UserEnvironment for mic/camera input
53
    
39
}
54
}
40
55
41
contains(QT_CONFIG, opengl) {
56
contains(QT_CONFIG, opengl) {
- a/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp -2 / +13 lines
Lines 132-137 static void initializeProxy() a/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp_sec1
132
132
133
Q_DECL_EXPORT int WebProcessMainQt(int argc, char** argv)
133
Q_DECL_EXPORT int WebProcessMainQt(int argc, char** argv)
134
{
134
{
135
#if defined(Q_OS_SYMBIAN)
136
    RProcess process; 
137
    process.SetPriority(EPriorityBackground);
138
#endif
139
    
135
    QApplication::setGraphicsSystem(QLatin1String("raster"));
140
    QApplication::setGraphicsSystem(QLatin1String("raster"));
136
    QApplication* app = new QApplication(argc, argv);
141
    QApplication* app = new QApplication(argc, argv);
137
#ifndef NDEBUG
142
#ifndef NDEBUG
Lines 153-158 Q_DECL_EXPORT int WebProcessMainQt(int argc, char** argv) a/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp_sec2
153
    WTF::initializeMainThread();
158
    WTF::initializeMainThread();
154
    RunLoop::initializeMainRunLoop();
159
    RunLoop::initializeMainRunLoop();
155
160
161
    CoreIPC::Connection::Identifier identifier; 
162
#if OS(SYMBIAN)
163
    // NULL, as we obtain the handles directly from the "environment data slots" on the RProcess
164
    identifier = 0; 
165
#else
156
    // Create the connection.
166
    // Create the connection.
157
    if (app->arguments().size() <= 1) {
167
    if (app->arguments().size() <= 1) {
158
        qDebug() << "Error: wrong number of arguments.";
168
        qDebug() << "Error: wrong number of arguments.";
Lines 160-171 Q_DECL_EXPORT int WebProcessMainQt(int argc, char** argv) a/Source/WebKit2/WebProcess/qt/WebProcessMainQt.cpp_sec3
160
    }
170
    }
161
171
162
    bool wasNumber = false;
172
    bool wasNumber = false;
163
    int identifier = app->arguments().at(1).toInt(&wasNumber, 10);
173
    identifier = app->arguments().at(1).toInt(&wasNumber, 10);
164
    if (!wasNumber) {
174
    if (!wasNumber) {
165
        qDebug() << "Error: connection identifier wrong.";
175
        qDebug() << "Error: connection identifier wrong.";
166
        return 1;
176
        return 1;
167
    }
177
    }
168
178
#endif
179
    
169
    WebKit::WebProcess::shared().initialize(identifier, RunLoop::main());
180
    WebKit::WebProcess::shared().initialize(identifier, RunLoop::main());
170
181
171
    RunLoop::run();
182
    RunLoop::run();
- a/Tools/MiniBrowser/qt/BrowserWindow.cpp -1 / +13 lines
Lines 119-129 BrowserWindow::BrowserWindow(QWKContext* context, WindowOptions* options) a/Tools/MiniBrowser/qt/BrowserWindow.cpp_sec1
119
    connect(m_addressBar, SIGNAL(returnPressed()), SLOT(changeLocation()));
119
    connect(m_addressBar, SIGNAL(returnPressed()), SLOT(changeLocation()));
120
120
121
    QToolBar* bar = addToolBar("Navigation");
121
    QToolBar* bar = addToolBar("Navigation");
122
#if defined(Q_OS_SYMBIAN)
123
    bar->setIconSize(QSize(16, 16));
124
#endif
122
    bar->addAction(page()->action(QWKPage::Back));
125
    bar->addAction(page()->action(QWKPage::Back));
123
    bar->addAction(page()->action(QWKPage::Forward));
126
    bar->addAction(page()->action(QWKPage::Forward));
124
    bar->addAction(page()->action(QWKPage::Reload));
127
    bar->addAction(page()->action(QWKPage::Reload));
125
    bar->addAction(page()->action(QWKPage::Stop));
128
    bar->addAction(page()->action(QWKPage::Stop));
129
#if defined(Q_OS_SYMBIAN)
130
    addToolBarBreak();
131
    addToolBar("Location")->addWidget(m_addressBar);
132
#else
126
    bar->addWidget(m_addressBar);
133
    bar->addWidget(m_addressBar);
134
#endif
127
135
128
    QShortcut* selectAddressBar = new QShortcut(Qt::CTRL | Qt::Key_L, this);
136
    QShortcut* selectAddressBar = new QShortcut(Qt::CTRL | Qt::Key_L, this);
129
    connect(selectAddressBar, SIGNAL(activated()), this, SLOT(openLocation()));
137
    connect(selectAddressBar, SIGNAL(activated()), this, SLOT(openLocation()));
Lines 137-143 BrowserWindow::BrowserWindow(QWKContext* context, WindowOptions* options) a/Tools/MiniBrowser/qt/BrowserWindow.cpp_sec2
137
        m_zoomLevels << 1.1 << 1.2 << 1.33 << 1.5 << 1.7 << 2 << 2.4 << 3;
145
        m_zoomLevels << 1.1 << 1.2 << 1.33 << 1.5 << 1.7 << 2 << 2.4 << 3;
138
    }
146
    }
139
147
140
    resize(800, 600);
148
#if defined(Q_OS_SYMBIAN)
149
    setWindowState(Qt::WindowMaximized);
150
#else
151
	resize(800, 600);
152
#endif
141
    show();
153
    show();
142
}
154
}
143
155
- a/Tools/MiniBrowser/qt/MiniBrowser.pro -1 / +15 lines
Lines 48-54 linux-* { a/Tools/MiniBrowser/qt/MiniBrowser.pro_sec1
48
48
49
symbian {
49
symbian {
50
    TARGET.UID3 = 0xA000E545
50
    TARGET.UID3 = 0xA000E545
51
    TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
51
    MMP_RULES += pageddata
52
    
53
    TARGET.CAPABILITY *= ReadUserData 
54
    TARGET.CAPABILITY *= WriteUserData
55
    TARGET.CAPABILITY *= NetworkServices  # QtNetwork and Bearer
56
    TARGET.CAPABILITY *= PowerMgmt        # killing web process from UI process
57
    
58
    # See QtMobility docs on Symbian capabilities: 
59
    # http://doc.qt.nokia.com/qtmobility/quickstart.html
60
    TARGET.CAPABILITY *= Location         # geolocation
61
    TARGET.CAPABILITY *= ReadDeviceData   # geolocation, sensors
62
    TARGET.CAPABILITY *= WriteDeviceData  # geolocation
63
    TARGET.CAPABILITY *= LocalServices    # geolocation, sysinfo
64
    
65
    # We may later need UserEnvironment for mic/camera input
52
}
66
}
53
67
54
contains(QT_CONFIG, opengl) {
68
contains(QT_CONFIG, opengl) {

Return to Bug 55877