rhodes 5.5.0.7 → 5.5.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +1 -1
- data/CREDITS +3 -3
- data/Rakefile +24 -0
- data/extensions/instrumentation/ext/platform/android/src/com/rho/instrumentation/Instrumentation.java +5 -0
- data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/Rakefile +1 -1
- data/lib/build/jake.rb +5 -0
- data/lib/commonAPI/clipboard/ext.yml +17 -0
- data/lib/commonAPI/clipboard/ext/Clipboard.xml +49 -0
- data/lib/commonAPI/clipboard/ext/build +19 -0
- data/lib/commonAPI/clipboard/ext/build.bat +29 -0
- data/lib/commonAPI/clipboard/ext/platform/android/Rakefile +141 -0
- data/lib/commonAPI/clipboard/ext/platform/android/ext_java.files +9 -0
- data/lib/commonAPI/clipboard/ext/platform/android/ext_native.files +7 -0
- data/lib/commonAPI/clipboard/ext/platform/android/jni/Clipboard_impl.cpp +61 -0
- data/lib/commonAPI/clipboard/ext/platform/android/src/com/rho/clipboard/Clipboard.java +15 -0
- data/lib/commonAPI/clipboard/ext/platform/android/src/com/rho/clipboard/ClipboardFactory.java +18 -0
- data/lib/commonAPI/clipboard/ext/platform/android/src/com/rho/clipboard/ClipboardSingleton.java +146 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/Clipboard.xcodeproj/project.pbxproj +368 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/Clipboard_Prefix.pch +7 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/Rakefile +73 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/Clipboard.h +11 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/Clipboard.m +12 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardFactorySingleton.m +16 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardSetup.m +9 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardSingleton.h +18 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/ClipboardSingleton.m +43 -0
- data/lib/commonAPI/clipboard/ext/platform/iphone/impl/readme.txt +7 -0
- data/lib/commonAPI/coreapi/ext/NativeTabbar.xml +3 -3
- data/lib/commonAPI/coreapi/ext/shared/TimerImpl.cpp +36 -27
- data/lib/commonAPI/coreapi/public/api/rhoapi-force.ajax.js +3 -1
- data/lib/commonAPI/coreapi/public/api/rhoapi.js +2 -1
- data/lib/commonAPI/devicesecurity/ext.yml +11 -0
- data/lib/commonAPI/devicesecurity/ext/DeviceSecurity.xml +91 -0
- data/lib/commonAPI/devicesecurity/ext/build +19 -0
- data/lib/commonAPI/devicesecurity/ext/build.bat +29 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/InbuiltValues.erb +16 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/Rakefile +166 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/ext_java.files +10 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/ext_native.files +7 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/jni/DeviceSecurity_impl.cpp +61 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/src/com/rho/devicesecurity/DeviceSecurity.java +14 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/src/com/rho/devicesecurity/DeviceSecurityFactory.java +18 -0
- data/lib/commonAPI/devicesecurity/ext/platform/android/src/com/rho/devicesecurity/DeviceSecuritySingleton.java +412 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/DeviceSecurity.xcodeproj/project.pbxproj +368 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/DeviceSecurity_Prefix.pch +7 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/Rakefile +73 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecurity.h +11 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecurity.m +12 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecurityFactorySingleton.m +16 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecuritySetup.m +9 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecuritySingleton.h +19 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/DeviceSecuritySingleton.m +106 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/impl/readme.txt +7 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +5 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/Utils.java +9 -0
- data/platform/android/build/android.rake +42 -1
- data/platform/android/build/androidcommon.rb +4 -2
- data/platform/iphone/Classes/RhoWKWebView.m +4 -0
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.h +2 -0
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +195 -30
- data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +91 -4
- data/platform/iphone/rbuild/iphone.rake +297 -231
- data/platform/iphone/rbuild/putsOverride.rake +8 -0
- data/platform/shared/common/RhoTime.cpp +81 -40
- data/platform/shared/common/RhodesApp.cpp +16 -18
- data/platform/shared/db/DBAdapter.cpp +33 -0
- data/platform/shared/db/DBAdapter.h +5 -0
- data/platform/shared/net/HttpServer.cpp +27 -1
- data/platform/shared/net/INetRequest.cpp +33 -6
- data/platform/shared/qt/rhodes/qkineticscroller.cpp +2 -2
- data/platform/shared/qt/rhodes/qkineticscroller_p.h +1 -1
- data/platform/shared/qt/rhodes/qtscrollerfilter.cpp +3 -3
- data/platform/shared/qt/rhodes/qtscrollevent.cpp +2 -2
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.cpp +1 -1
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.h +1 -1
- data/platform/wm/build/wm.rake +7 -3
- data/platform/wm/rhodes/browser/BrowserFactory.cpp +4 -6
- data/platform/wm/rhodes/browser/stubs.cpp +5 -0
- data/platform/wm/rhodes/rhodes.vcproj +31 -2
- data/rakefile.rb +24 -0
- data/res/generators/templates/application/app/Settings/home.erb +1 -1
- data/res/generators/templates/application/build.yml +61 -4
- data/res/generators/templates/application/icon/icon.png +0 -0
- data/res/generators/templates/application/icon/icon114.png +0 -0
- data/res/generators/templates/application/icon/icon120.png +0 -0
- data/res/generators/templates/application/icon/icon144.png +0 -0
- data/res/generators/templates/application/icon/icon152.png +0 -0
- data/res/generators/templates/application/icon/icon180.png +0 -0
- data/res/generators/templates/application/icon/icon57.png +0 -0
- data/res/generators/templates/application/icon/icon60.png +0 -0
- data/res/generators/templates/application/icon/icon72.png +0 -0
- data/res/generators/templates/application/icon/icon76.png +0 -0
- data/res/generators/templates/application/production/iTunesArtwork.png +0 -0
- data/res/generators/templates/application/production/iTunesArtwork@2x.png +0 -0
- data/res/generators/templates/iphone_project/Bremen7.xcodeproj/project.pbxproj +1 -0
- data/res/generators/templates/iphone_project/buildRhoBundle +23 -7
- data/res/generators/templates/iphone_project/root/Info.plist +0 -2
- data/res/generators/templates/iphone_project/root/iTunesArtwork +0 -0
- data/res/generators/templates/iphone_project/root/iTunesArtwork@2x +0 -0
- data/res/generators/templates/iphone_project/root/icon114.png +0 -0
- data/res/generators/templates/iphone_project/root/icon120.png +0 -0
- data/res/generators/templates/iphone_project/root/icon144.png +0 -0
- data/res/generators/templates/iphone_project/root/icon152.png +0 -0
- data/res/generators/templates/iphone_project/root/icon180.png +0 -0
- data/res/generators/templates/iphone_project/root/icon57.png +0 -0
- data/res/generators/templates/iphone_project/root/icon60.png +0 -0
- data/res/generators/templates/iphone_project/root/icon72.png +0 -0
- data/res/generators/templates/iphone_project/root/icon76.png +0 -0
- data/res/generators/templates/iphone_project/root/rhorunner_development.entitlements +6 -0
- data/rhodes.gemspec +19 -17
- data/version +1 -1
- metadata +118 -44
@@ -1,18 +1,18 @@
|
|
1
1
|
/*------------------------------------------------------------------------
|
2
2
|
* (The MIT License)
|
3
|
-
*
|
3
|
+
*
|
4
4
|
* Copyright (c) 2008-2011 Rhomobile, Inc.
|
5
|
-
*
|
5
|
+
*
|
6
6
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
* of this software and associated documentation files (the "Software"), to deal
|
8
8
|
* in the Software without restriction, including without limitation the rights
|
9
9
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
10
|
* copies of the Software, and to permit persons to whom the Software is
|
11
11
|
* furnished to do so, subject to the following conditions:
|
12
|
-
*
|
12
|
+
*
|
13
13
|
* The above copyright notice and this permission notice shall be included in
|
14
14
|
* all copies or substantial portions of the Software.
|
15
|
-
*
|
15
|
+
*
|
16
16
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
17
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
18
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
@@ -20,13 +20,39 @@
|
|
20
20
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
* THE SOFTWARE.
|
23
|
-
*
|
23
|
+
*
|
24
24
|
* http://rhomobile.com
|
25
25
|
*------------------------------------------------------------------------*/
|
26
26
|
|
27
27
|
#include "common/RhoTime.h"
|
28
28
|
#include "common/RhodesApp.h"
|
29
29
|
|
30
|
+
#include "common/RhoConf.h"
|
31
|
+
|
32
|
+
|
33
|
+
#include "logging/RhoLog.h"
|
34
|
+
|
35
|
+
#undef DEFAULT_LOGCATEGORY
|
36
|
+
#define DEFAULT_LOGCATEGORY "RhoTimer"
|
37
|
+
|
38
|
+
|
39
|
+
static bool is_net_trace() {
|
40
|
+
static int res = -1;
|
41
|
+
if (res == -1) {
|
42
|
+
if (rho_conf_getBool("net_trace") ) {
|
43
|
+
res = 1;
|
44
|
+
}
|
45
|
+
else {
|
46
|
+
res = 0;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
return res == 1;
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
30
56
|
namespace rho{
|
31
57
|
namespace common{
|
32
58
|
|
@@ -143,33 +169,34 @@ boolean CRhoTimer::checkTimers()
|
|
143
169
|
for( int i = (int)m_arItems.size()-1; i >= 0; i--)
|
144
170
|
{
|
145
171
|
CTimerItem oItem = m_arItems.elementAt(i);
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
m_arItems.removeElementAt(i);
|
153
|
-
if ( RHODESAPP().callTimerCallback(oItem.m_strCallback, oItem.m_strCallbackData) )
|
154
|
-
bRet = true;
|
155
|
-
}
|
156
|
-
|
157
|
-
}
|
158
|
-
else
|
159
|
-
{
|
160
|
-
if ( curTime.toULong() >= oItem.m_oFireTime.toULong() )
|
161
|
-
{
|
162
|
-
if((curTime.toULong()-oItem.m_oFireTime.toULong())<=oItem.m_nInterval)
|
163
|
-
{
|
172
|
+
|
173
|
+
if(oItem.m_overflow==false)
|
174
|
+
{
|
175
|
+
|
176
|
+
if ( curTime.toULong() >= oItem.m_oFireTime.toULong() )
|
177
|
+
{
|
164
178
|
RAWTRACE("CRhoTimer::checkTimers: firing timer");
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
179
|
+
m_arItems.removeElementAt(i);
|
180
|
+
if ( RHODESAPP().callTimerCallback(oItem.m_strCallback, oItem.m_strCallbackData) )
|
181
|
+
bRet = true;
|
182
|
+
}
|
183
|
+
|
184
|
+
}
|
185
|
+
else
|
186
|
+
{
|
187
|
+
if ( curTime.toULong() >= oItem.m_oFireTime.toULong() )
|
188
|
+
{
|
189
|
+
if((curTime.toULong()-oItem.m_oFireTime.toULong())<=oItem.m_nInterval)
|
190
|
+
{
|
191
|
+
RAWTRACE("CRhoTimer::checkTimers: firing timer");
|
192
|
+
m_arItems.removeElementAt(i);
|
193
|
+
if ( RHODESAPP().callTimerCallback(oItem.m_strCallback, oItem.m_strCallbackData) )
|
194
|
+
bRet = true;
|
195
|
+
}
|
196
|
+
|
197
|
+
}
|
198
|
+
|
199
|
+
}
|
173
200
|
}
|
174
201
|
|
175
202
|
for( int i = (int)m_arNativeItems.size()-1; i >= 0; i--)
|
@@ -177,28 +204,42 @@ boolean CRhoTimer::checkTimers()
|
|
177
204
|
CNativeTimerItem oItem = m_arNativeItems.elementAt(i);
|
178
205
|
|
179
206
|
if(oItem.m_overflow==false)
|
180
|
-
|
207
|
+
{
|
181
208
|
if ( curTime.toULong() >= oItem.m_oFireTime.toULong() )
|
182
209
|
{
|
183
210
|
RAWTRACE("CRhoTimer::checkTimers: firing native timer");
|
184
211
|
m_arNativeItems.removeElementAt(i);
|
185
|
-
if (
|
212
|
+
if (is_net_trace()) {
|
213
|
+
RAWTRACE("$NetRequestProcess$ PRE ONTIMER CRhoTimer::checkTimers() 1 TIMER");
|
214
|
+
}
|
215
|
+
if ( oItem.m_pCallback->onTimer() ) {
|
186
216
|
bRet = true;
|
217
|
+
}
|
218
|
+
if (is_net_trace()) {
|
219
|
+
RAWTRACE("$NetRequestProcess$ POST ONTIMER CRhoTimer::checkTimers() 1 TIMER");
|
220
|
+
}
|
187
221
|
}
|
188
222
|
}
|
189
223
|
else
|
190
224
|
{
|
191
225
|
if ( curTime.toULong() >= oItem.m_oFireTime.toULong() )
|
192
|
-
|
193
|
-
|
194
|
-
|
226
|
+
{
|
227
|
+
if((curTime.toULong()-oItem.m_oFireTime.toULong())<=oItem.m_nInterval)
|
228
|
+
{
|
195
229
|
RAWTRACE("CRhoTimer::checkTimers: firing native timer");
|
196
230
|
m_arNativeItems.removeElementAt(i);
|
197
|
-
if (
|
231
|
+
if (is_net_trace()) {
|
232
|
+
RAWTRACE("$NetRequestProcess$ PRE ONTIMER CRhoTimer::checkTimers() 2 TIMER");
|
233
|
+
}
|
234
|
+
if ( oItem.m_pCallback->onTimer() ) {
|
198
235
|
bRet = true;
|
199
|
-
|
200
|
-
|
201
|
-
|
236
|
+
}
|
237
|
+
if (is_net_trace()) {
|
238
|
+
RAWTRACE("$NetRequestProcess$ POST ONTIMER CRhoTimer::checkTimers() 2 TIMER");
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
}
|
202
243
|
}
|
203
244
|
}
|
204
245
|
|
@@ -353,10 +353,10 @@ void CAppCallbacksQueue::processCommand(IQueueCommand* pCmd)
|
|
353
353
|
{
|
354
354
|
processUiCreated();
|
355
355
|
}
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
356
|
+
|
357
|
+
RHODESAPP().getApplicationEventReceiver()->onAppStateChange(rho::common::applicationStateActivated);
|
358
|
+
callCallback("/system/activateapp");
|
359
|
+
|
360
360
|
m_expected = app_deactivated;
|
361
361
|
}
|
362
362
|
break;
|
@@ -388,15 +388,15 @@ void CAppCallbacksQueue::processUiCreated()
|
|
388
388
|
#endif
|
389
389
|
|
390
390
|
// at this point JS app is unlikely to set its own handler, just navigate to overriden start path
|
391
|
-
|
392
|
-
|
391
|
+
RHODESAPP().getApplicationEventReceiver()->onUIStateChange(rho::common::UIStateCreated);
|
392
|
+
|
393
393
|
if ( rho_ruby_is_started() )
|
394
394
|
callCallback("/system/uicreated");
|
395
395
|
#if !defined(APP_BUILD_CAPABILITY_SHARED_RUNTIME) || !defined(OS_ANDROID)
|
396
396
|
else
|
397
397
|
rho_webview_navigate(startPath.c_str(), 0);
|
398
398
|
#endif
|
399
|
-
|
399
|
+
|
400
400
|
m_uistate = ui_created_processed;
|
401
401
|
}
|
402
402
|
|
@@ -742,16 +742,15 @@ void CRhodesApp::callUiDestroyedCallback()
|
|
742
742
|
if ( m_bExit/* || !rho_ruby_is_started()*/ )
|
743
743
|
return;
|
744
744
|
|
745
|
-
|
745
|
+
|
746
|
+
RHODESAPP().getApplicationEventReceiver()->onUIStateChange(rho::common::UIStateDestroyed);
|
747
|
+
if ( rho_ruby_is_started() )
|
746
748
|
{
|
747
|
-
|
749
|
+
String strUrl = m_strHomeUrl + "/system/uidestroyed";
|
750
|
+
NetResponse resp = getNetRequest().pullData( strUrl, null );
|
751
|
+
if ( !resp.isOK() )
|
748
752
|
{
|
749
|
-
|
750
|
-
NetResponse resp = getNetRequest().pullData( strUrl, null );
|
751
|
-
if ( !resp.isOK() )
|
752
|
-
{
|
753
|
-
LOG(ERROR) + "UI destroy callback failed. Code: " + resp.getRespCode() + "; Error body: " + resp.getCharData();
|
754
|
-
}
|
753
|
+
LOG(ERROR) + "UI destroy callback failed. Code: " + resp.getRespCode() + "; Error body: " + resp.getCharData();
|
755
754
|
}
|
756
755
|
}
|
757
756
|
}
|
@@ -789,8 +788,8 @@ void CRhodesApp::callAppActiveCallback(boolean bActive)
|
|
789
788
|
m_appCallbacksQueue->addQueueCommand(new CAppCallbacksQueue::Command(CAppCallbacksQueue::app_deactivated));
|
790
789
|
|
791
790
|
// TODO: Support stop_local_server command to be parsed from callback result
|
792
|
-
|
793
|
-
|
791
|
+
RHODESAPP().getApplicationEventReceiver()->onAppStateChange(rho::common::applicationStateDeactivated);
|
792
|
+
|
794
793
|
#ifndef RHO_NO_RUBY_API
|
795
794
|
if ( rho_ruby_is_started() )
|
796
795
|
{
|
@@ -814,7 +813,6 @@ void CRhodesApp::callAppActiveCallback(boolean bActive)
|
|
814
813
|
}
|
815
814
|
}
|
816
815
|
#endif
|
817
|
-
}
|
818
816
|
|
819
817
|
m_bDeactivationMode = false;
|
820
818
|
}
|
@@ -633,6 +633,39 @@ void CDBAdapter::copyTable(String tableName, CDBAdapter& dbFrom, CDBAdapter& dbT
|
|
633
633
|
}
|
634
634
|
}
|
635
635
|
}
|
636
|
+
|
637
|
+
// add file.blob attrib_type for blob attribs in changed_values
|
638
|
+
void CDBAdapter::updateAllBlobAttribChanges()
|
639
|
+
{
|
640
|
+
//Check for attrib = object
|
641
|
+
IDBResult res = executeSQL("SELECT object, source_id, attrib "
|
642
|
+
"FROM changed_values where update_type = 'update' and sent=0");
|
643
|
+
|
644
|
+
if ( res.isEnd() )
|
645
|
+
return;
|
646
|
+
|
647
|
+
startTransaction();
|
648
|
+
|
649
|
+
Vector<String> arObj, arAttrib;
|
650
|
+
Vector<int> arSrcID;
|
651
|
+
for( ; !res.isEnd(); res.next() )
|
652
|
+
{
|
653
|
+
arObj.addElement(res.getStringByIdx(0));
|
654
|
+
arSrcID.addElement(res.getIntByIdx(1));
|
655
|
+
arAttrib.addElement(res.getStringByIdx(2));
|
656
|
+
}
|
657
|
+
|
658
|
+
for( int i = 0; i < (int)arObj.size(); i++ )
|
659
|
+
{
|
660
|
+
String attribType = getAttrMgr().isBlobAttr(arSrcID.elementAt(i), arAttrib.elementAt(i).c_str()) ? "blob.file" : "";
|
661
|
+
if (attribType.length() > 0) {
|
662
|
+
executeSQL("UPDATE changed_values SET attrib_type=? WHERE source_id=? and object=? and attrib=? and sent=0", attribType, arSrcID.elementAt(i), arObj.elementAt(i), arAttrib.elementAt(i));
|
663
|
+
}
|
664
|
+
}
|
665
|
+
|
666
|
+
endTransaction();
|
667
|
+
}
|
668
|
+
|
636
669
|
|
637
670
|
void CDBAdapter::updateAllAttribChanges()
|
638
671
|
{
|
@@ -359,7 +359,12 @@ public:
|
|
359
359
|
|
360
360
|
DBResultPtr prepareStatement( const char* szSt );
|
361
361
|
DBResultPtr executeStatement(common::CAutoPtr<CDBResult>& res, const char* szSt);
|
362
|
+
|
363
|
+
// unpack object in changed_values with update_type==create to set of objects's attribs
|
362
364
|
void updateAllAttribChanges();
|
365
|
+
|
366
|
+
// add file.blob attrib_type for blob attribs in changed_values
|
367
|
+
void updateAllBlobAttribChanges();
|
363
368
|
void updateFullUpdateChanges(int nSrcID);
|
364
369
|
|
365
370
|
String exportDatabase();
|
@@ -81,6 +81,24 @@ typedef unsigned __int16 uint16_t;
|
|
81
81
|
#undef DEFAULT_LOGCATEGORY
|
82
82
|
#define DEFAULT_LOGCATEGORY "HttpServer"
|
83
83
|
|
84
|
+
|
85
|
+
static bool is_net_trace() {
|
86
|
+
static int res = -1;
|
87
|
+
if (res == -1) {
|
88
|
+
if (rho_conf_getBool("net_trace") ) {
|
89
|
+
res = 1;
|
90
|
+
}
|
91
|
+
else {
|
92
|
+
res = 0;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
return res == 1;
|
96
|
+
}
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
84
102
|
//extern "C" void rho_sync_addobjectnotify_bysrcname(const char* szSrcName, const char* szObject);
|
85
103
|
|
86
104
|
namespace rho
|
@@ -1497,8 +1515,13 @@ bool CHttpServer::decide(String const &method, String const &arg_uri, String con
|
|
1497
1515
|
#ifdef OS_MACOSX
|
1498
1516
|
String CHttpServer::directRequest( const String& method, const String& uri, const String& query, const HeaderList& headers ,const String& body )
|
1499
1517
|
{
|
1518
|
+
if (is_net_trace()) {
|
1519
|
+
RAWTRACE1("$NetRequestProcess$ PRE LOCK CHttpServer::directRequest uri = %s", uri.c_str());
|
1520
|
+
}
|
1500
1521
|
common::CMutexLock lock(m_mxSyncRequest);
|
1501
|
-
|
1522
|
+
if (is_net_trace()) {
|
1523
|
+
RAWTRACE1("$NetRequestProcess$ POST LOCK CHttpServer::directRequest uri = %s", uri.c_str());
|
1524
|
+
}
|
1502
1525
|
String ret;
|
1503
1526
|
if ( m_pQueue != 0 )
|
1504
1527
|
{
|
@@ -1526,6 +1549,9 @@ String CHttpServer::directRequest( const String& method, const String& uri, cons
|
|
1526
1549
|
|
1527
1550
|
ret = m_pQueue->getResponse();
|
1528
1551
|
}
|
1552
|
+
if (is_net_trace()) {
|
1553
|
+
RAWTRACE1("$NetRequestProcess$ FINISH CHttpServer::directRequest uri = %s", uri.c_str());
|
1554
|
+
}
|
1529
1555
|
|
1530
1556
|
return ret;
|
1531
1557
|
|
@@ -1,18 +1,18 @@
|
|
1
1
|
/*------------------------------------------------------------------------
|
2
2
|
* (The MIT License)
|
3
|
-
*
|
3
|
+
*
|
4
4
|
* Copyright (c) 2008-2011 Rhomobile, Inc.
|
5
|
-
*
|
5
|
+
*
|
6
6
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
* of this software and associated documentation files (the "Software"), to deal
|
8
8
|
* in the Software without restriction, including without limitation the rights
|
9
9
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
10
|
* copies of the Software, and to permit persons to whom the Software is
|
11
11
|
* furnished to do so, subject to the following conditions:
|
12
|
-
*
|
12
|
+
*
|
13
13
|
* The above copyright notice and this permission notice shall be included in
|
14
14
|
* all copies or substantial portions of the Software.
|
15
|
-
*
|
15
|
+
*
|
16
16
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
17
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
18
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
@@ -20,7 +20,7 @@
|
|
20
20
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
* THE SOFTWARE.
|
23
|
-
*
|
23
|
+
*
|
24
24
|
* http://rhomobile.com
|
25
25
|
*------------------------------------------------------------------------*/
|
26
26
|
|
@@ -31,6 +31,28 @@
|
|
31
31
|
#include "common/RhoFilePath.h"
|
32
32
|
#include "net/URI.h"
|
33
33
|
|
34
|
+
#include "common/RhoConf.h"
|
35
|
+
#include "logging/RhoLog.h"
|
36
|
+
|
37
|
+
#undef DEFAULT_LOGCATEGORY
|
38
|
+
#define DEFAULT_LOGCATEGORY "NetRequestTimer"
|
39
|
+
|
40
|
+
|
41
|
+
static bool is_net_trace() {
|
42
|
+
static int res = -1;
|
43
|
+
if (res == -1) {
|
44
|
+
if (rho_conf_getBool("net_trace") ) {
|
45
|
+
res = 1;
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
res = 0;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
return res == 1;
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
|
34
56
|
namespace rho {
|
35
57
|
namespace net {
|
36
58
|
|
@@ -50,12 +72,17 @@ void CNetRequestHolder::setRequest(INetRequestImpl* pReq)
|
|
50
72
|
|
51
73
|
void CNetRequestHolder::cancel()
|
52
74
|
{
|
75
|
+
if (is_net_trace()) {
|
76
|
+
RAWTRACE("$NetRequestProcess$ PRE SYNCHRONIZED CNetRequestHolder::cancel() TIMER");
|
77
|
+
}
|
53
78
|
synchronized(m_mxReq)
|
54
79
|
{
|
55
80
|
m_bCancel = true;
|
56
81
|
if ( m_pReq != 0 )
|
57
82
|
m_pReq->cancel();
|
58
|
-
|
83
|
+
if (is_net_trace()) {
|
84
|
+
RAWTRACE("$NetRequestProcess$ POST SYNCHRONIZED CNetRequestHolder::cancel() TIMER");
|
85
|
+
}
|
59
86
|
m_pReq = 0;
|
60
87
|
}
|
61
88
|
}
|
@@ -38,8 +38,8 @@
|
|
38
38
|
** $QT_END_LICENSE$
|
39
39
|
**
|
40
40
|
****************************************************************************/
|
41
|
-
#include
|
42
|
-
#include
|
41
|
+
#include "qkineticscroller.h"
|
42
|
+
#include "qkineticscroller_p.h"
|
43
43
|
#include <QMap>
|
44
44
|
#include <QApplication>
|
45
45
|
#include <QDesktopWidget>
|