|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Definition of CSynchRequest |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CSYNCHREQUEST_H |
|
20 #define CSYNCHREQUEST_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 #include "Frame.h" |
|
26 #include "ResourceHandle.h" |
|
27 #include "ResourceRequest.h" |
|
28 #include "ResourceResponse.h" |
|
29 |
|
30 #include "SynchLoader.h" |
|
31 |
|
32 namespace WebCore |
|
33 { |
|
34 |
|
35 class ResourceError; |
|
36 |
|
37 /** |
|
38 * @class CSynchRequest |
|
39 * @short AO to process synchronous messages |
|
40 * @since 5.0 |
|
41 */ |
|
42 class CSynchRequest : public CActive |
|
43 { |
|
44 public: |
|
45 // Constructors and destructor |
|
46 |
|
47 /** |
|
48 * Create new CSynchRequest object. |
|
49 * @return a pointer to the created instance of CSynchRequest |
|
50 */ |
|
51 static CSynchRequest* NewL(); |
|
52 |
|
53 /** |
|
54 * Create new CSynchRequest object. |
|
55 * @return a pointer to the created instance of CSynchRequest |
|
56 */ |
|
57 static CSynchRequest* NewLC(); |
|
58 |
|
59 /** |
|
60 * Destroy the object and release all memory of the objects. |
|
61 */ |
|
62 virtual ~CSynchRequest(); |
|
63 |
|
64 private: |
|
65 // Default constructors |
|
66 |
|
67 /** |
|
68 * Default constructor |
|
69 */ |
|
70 CSynchRequest(); |
|
71 |
|
72 /** |
|
73 * Second-phase constructor. |
|
74 */ |
|
75 void ConstructL(); |
|
76 |
|
77 protected: |
|
78 // From CActive |
|
79 |
|
80 /** |
|
81 * Handles an active object's request completion event. |
|
82 */ |
|
83 void DoCancel(); |
|
84 |
|
85 /** |
|
86 * Implements cancellation of an outstanding request. |
|
87 */ |
|
88 void RunL(); |
|
89 |
|
90 /** |
|
91 * Handles a leave occurring in the request completion event handler RunL(). |
|
92 * @param aError The default implementation returned aError. |
|
93 * @return The error codes. |
|
94 */ |
|
95 TInt RunError(TInt); |
|
96 |
|
97 public: |
|
98 // New functions |
|
99 |
|
100 void CreateResource(const ResourceRequest&, |
|
101 ResourceError&, |
|
102 ResourceResponse&, |
|
103 Vector<char>&, |
|
104 Frame*); |
|
105 |
|
106 private: |
|
107 // New functions |
|
108 |
|
109 |
|
110 private: |
|
111 // Member data |
|
112 |
|
113 /** |
|
114 * Controls a single scheduling loop in the current active scheduler |
|
115 * Owned by CSynchRequest object. |
|
116 */ |
|
117 CActiveSchedulerWait* iActiveSchedulerWait; |
|
118 RefPtr<SynchResourceHandleClient> m_synchLoader; |
|
119 ResourceError m_error; |
|
120 |
|
121 }; |
|
122 |
|
123 } // end namespace WebCore |
|
124 |
|
125 #endif // CSYNCHREQUEST_H |
|
126 // End of File |