Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: xfa/fxfa/fm2js/xfa_fm2jscontext.cpp

Issue 1983683003: Remove some c_str() calls from StringCs in xfa docs. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_ffwidgetacc.cpp ('k') | xfa/fxfa/include/fxfa.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fxfa/fm2js/xfa_fm2jscontext.h" 7 #include "xfa/fxfa/fm2js/xfa_fm2jscontext.h"
8 8
9 #include <time.h> 9 #include <time.h>
10 10
(...skipping 5422 matching lines...) Expand 10 before | Expand all | Expand 10 after
5433 } 5433 }
5434 IXFA_AppProvider* pAppProvider = 5434 IXFA_AppProvider* pAppProvider =
5435 pDoc->GetParser()->GetNotify()->GetAppProvider(); 5435 pDoc->GetParser()->GetNotify()->GetAppProvider();
5436 if (!pAppProvider) { 5436 if (!pAppProvider) {
5437 return; 5437 return;
5438 } 5438 }
5439 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0); 5439 FXJSE_HVALUE argOne = GetSimpleHValue(hThis, args, 0);
5440 CFX_ByteString urlString; 5440 CFX_ByteString urlString;
5441 HValueToUTF8String(argOne, urlString); 5441 HValueToUTF8String(argOne, urlString);
5442 IFX_FileRead* pFile = pAppProvider->DownloadURL( 5442 IFX_FileRead* pFile = pAppProvider->DownloadURL(
5443 CFX_WideString::FromUTF8(urlString.AsStringC()).AsStringC()); 5443 CFX_WideString::FromUTF8(urlString.AsStringC()));
5444 if (pFile) { 5444 if (pFile) {
5445 int32_t size = pFile->GetSize(); 5445 int32_t size = pFile->GetSize();
5446 uint8_t* pData = FX_Alloc(uint8_t, size); 5446 uint8_t* pData = FX_Alloc(uint8_t, size);
5447 pFile->ReadBlock(pData, size); 5447 pFile->ReadBlock(pData, size);
5448 FXJSE_Value_SetUTF8String(args.GetReturnValue(), 5448 FXJSE_Value_SetUTF8String(args.GetReturnValue(),
5449 CFX_ByteStringC(pData, size)); 5449 CFX_ByteStringC(pData, size));
5450 FX_Free(pData); 5450 FX_Free(pData);
5451 pFile->Release(); 5451 pFile->Release();
5452 } 5452 }
5453 FXJSE_Value_Release(argOne); 5453 FXJSE_Value_Release(argOne);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
5493 if (argc > 3) { 5493 if (argc > 3) {
5494 argFour = GetSimpleHValue(hThis, args, 3); 5494 argFour = GetSimpleHValue(hThis, args, 3);
5495 HValueToUTF8String(argFour, bsEncode); 5495 HValueToUTF8String(argFour, bsEncode);
5496 } 5496 }
5497 if (argc > 4) { 5497 if (argc > 4) {
5498 argFive = GetSimpleHValue(hThis, args, 4); 5498 argFive = GetSimpleHValue(hThis, args, 4);
5499 HValueToUTF8String(argFive, bsHeader); 5499 HValueToUTF8String(argFive, bsHeader);
5500 } 5500 }
5501 CFX_WideString decodedResponse; 5501 CFX_WideString decodedResponse;
5502 FX_BOOL bFlags = pAppProvider->PostRequestURL( 5502 FX_BOOL bFlags = pAppProvider->PostRequestURL(
5503 CFX_WideString::FromUTF8(bsURL.AsStringC()).AsStringC(), 5503 CFX_WideString::FromUTF8(bsURL.AsStringC()),
5504 CFX_WideString::FromUTF8(bsData.AsStringC()).AsStringC(), 5504 CFX_WideString::FromUTF8(bsData.AsStringC()),
5505 CFX_WideString::FromUTF8(bsContentType.AsStringC()).AsStringC(), 5505 CFX_WideString::FromUTF8(bsContentType.AsStringC()),
5506 CFX_WideString::FromUTF8(bsEncode.AsStringC()).AsStringC(), 5506 CFX_WideString::FromUTF8(bsEncode.AsStringC()),
5507 CFX_WideString::FromUTF8(bsHeader.AsStringC()).AsStringC(), 5507 CFX_WideString::FromUTF8(bsHeader.AsStringC()), decodedResponse);
5508 decodedResponse);
5509 FXJSE_Value_Release(argOne); 5508 FXJSE_Value_Release(argOne);
5510 FXJSE_Value_Release(argTwo); 5509 FXJSE_Value_Release(argTwo);
5511 if (argc > 2) { 5510 if (argc > 2) {
5512 FXJSE_Value_Release(argThree); 5511 FXJSE_Value_Release(argThree);
5513 } 5512 }
5514 if (argc > 3) { 5513 if (argc > 3) {
5515 FXJSE_Value_Release(argFour); 5514 FXJSE_Value_Release(argFour);
5516 } 5515 }
5517 if (argc > 4) { 5516 if (argc > 4) {
5518 FXJSE_Value_Release(argFive); 5517 FXJSE_Value_Release(argFive);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
5554 FXJSE_HVALUE argThree; 5553 FXJSE_HVALUE argThree;
5555 argOne = GetSimpleHValue(hThis, args, 0); 5554 argOne = GetSimpleHValue(hThis, args, 0);
5556 HValueToUTF8String(argOne, bsURL); 5555 HValueToUTF8String(argOne, bsURL);
5557 argTwo = GetSimpleHValue(hThis, args, 1); 5556 argTwo = GetSimpleHValue(hThis, args, 1);
5558 HValueToUTF8String(argTwo, bsData); 5557 HValueToUTF8String(argTwo, bsData);
5559 if (argc > 2) { 5558 if (argc > 2) {
5560 argThree = GetSimpleHValue(hThis, args, 2); 5559 argThree = GetSimpleHValue(hThis, args, 2);
5561 HValueToUTF8String(argThree, bsEncode); 5560 HValueToUTF8String(argThree, bsEncode);
5562 } 5561 }
5563 FX_BOOL bFlags = pAppProvider->PutRequestURL( 5562 FX_BOOL bFlags = pAppProvider->PutRequestURL(
5564 CFX_WideString::FromUTF8(bsURL.AsStringC()).AsStringC(), 5563 CFX_WideString::FromUTF8(bsURL.AsStringC()),
5565 CFX_WideString::FromUTF8(bsData.AsStringC()).AsStringC(), 5564 CFX_WideString::FromUTF8(bsData.AsStringC()),
5566 CFX_WideString::FromUTF8(bsEncode.AsStringC()).AsStringC()); 5565 CFX_WideString::FromUTF8(bsEncode.AsStringC()));
5567 FXJSE_Value_Release(argOne); 5566 FXJSE_Value_Release(argOne);
5568 FXJSE_Value_Release(argTwo); 5567 FXJSE_Value_Release(argTwo);
5569 if (argc > 2) { 5568 if (argc > 2) {
5570 FXJSE_Value_Release(argThree); 5569 FXJSE_Value_Release(argThree);
5571 } 5570 }
5572 if (bFlags) { 5571 if (bFlags) {
5573 FXJSE_Value_SetUTF8String(args.GetReturnValue(), ""); 5572 FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
5574 } else { 5573 } else {
5575 pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY); 5574 pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY);
5576 } 5575 }
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
7212 CFX_WideString wsFormat; 7211 CFX_WideString wsFormat;
7213 pAppProvider->LoadString(iStringID, wsFormat); 7212 pAppProvider->LoadString(iStringID, wsFormat);
7214 CFX_WideString wsMessage; 7213 CFX_WideString wsMessage;
7215 va_list arg_ptr; 7214 va_list arg_ptr;
7216 va_start(arg_ptr, iStringID); 7215 va_start(arg_ptr, iStringID);
7217 wsMessage.FormatV(wsFormat.c_str(), arg_ptr); 7216 wsMessage.FormatV(wsFormat.c_str(), arg_ptr);
7218 va_end(arg_ptr); 7217 va_end(arg_ptr);
7219 FXJSE_ThrowMessage( 7218 FXJSE_ThrowMessage(
7220 "", FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); 7219 "", FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC());
7221 } 7220 }
OLDNEW
« no previous file with comments | « xfa/fxfa/app/xfa_ffwidgetacc.cpp ('k') | xfa/fxfa/include/fxfa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698