summaryrefslogtreecommitdiffstats
path: root/base/pickle.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove Pickle::WriteSize() now that it has no remaining callers. Also renamemdm@chromium.org2012-03-231-4/+0
| | | | | | | | | | | Pickle::WriteLong() to WriteLongUsingDangerousNonPortableLessPersistableForm() and add a strongly-worded comment against its use; it is used only for IPC which is safe. (These methods write variable amounts of data to pickles, depending on architecture, and aren't safe if pickles are persisted.) Review URL: http://codereview.chromium.org/9641005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128347 0039d316-1c4b-4281-b951-d872f2087c98
* Fix PickleTest.GetReadPointerAndAdvance not to produce wild addresses while ↵glider@chromium.org2012-03-131-6/+2
| | | | | | | | | | checking for overflows. BUG=117704 TBR=willchan Review URL: https://chromiumcodereview.appspot.com/9694034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126413 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor Pickle Read methods to use higher performance PickleIterator.jbates@chromium.org2012-03-071-204/+138
| | | | | | | | | | | | | | | | There was a lot of redundant error checking and initialization code in all Pickle Read methods because of the void** iterator type. This change replaces the void* iterator with PickleIterator, which encapsulates the read pointer so that less error checking and initialization code is needed for reading. PickleIterator has all the necessary data to do the actual reading. The advantage of having it provide Read methods (as opposed to leaving them solely in the Pickle interface) is that the callers do not need to pass around the const Pickle* once they have a PickleIterator. Followup CLs will refactor the call sites to remove const Pickle* arguments where they are now unnecessary. Then the Pickle::Read* methods can be removed entirely. The alternative approach would have been to change the Pickle::Read methods to non-const and remove the iterator parameter (making Read methods advance an internal read pointer). Unfortunately, the const Read with iterator design is entrenched throughout the chromium code, making this a much more complex change with the same performance outcome. BUG=13108 Review URL: https://chromiumcodereview.appspot.com/9447084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125447 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove a static initializer in pickle.cc.thestig@chromium.org2011-10-101-4/+2
| | | | | | | | | BUG=94925 TEST=none Review URL: http://codereview.chromium.org/8207011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104802 0039d316-1c4b-4281-b951-d872f2087c98
* Remove Purify and Quantify.Doing so will reduce substantially the size of ↵jeanluc@chromium.org2011-08-171-1/+1
| | | | | | | | | the project files. BUG=92102 Review URL: http://codereview.chromium.org/7528010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97156 0039d316-1c4b-4281-b951-d872f2087c98
* Updating logging in src/base/. Using DCHECK_NE/EQ/LE/GE/GT() where possiblekushi.p@gmail.com2011-05-041-1/+1
| | | | | | | | | BUG=58409 Review URL: http://codereview.chromium.org/6883295 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84016 0039d316-1c4b-4281-b951-d872f2087c98
* Update DCHECK() usage to utilize the more expressive debugging functions.kushi.p@gmail.com2011-04-221-3/+3
| | | | | | | | BUG=58409 Review URL: http://codereview.chromium.org/6891008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82639 0039d316-1c4b-4281-b951-d872f2087c98
* Use DCHECK_GE() where possible in base/. Patch by Kushal Pisavadia (see ↵pkasting@chromium.org2011-03-311-2/+2
| | | | | | | | | http://codereview.chromium.org/6688056/ ), r=me. BUG=58409 TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80063 0039d316-1c4b-4281-b951-d872f2087c98
* Propagate the remote socket address to URLRequest and to ↵bryner@chromium.org2011-02-221-0/+14
| | | | | | | | | | | | | | | | ViewHostMsg_FrameNavigate. This will be used to run pre-classification checks for client-side phishing detection, and will also enable the socket address to be exposed via the webRequest extension API. This is adapted from the original patch by pmarks on http://codereview.chromium.org/6369003/ . BUG=51663 TEST=added socket address checks to various unittests Review URL: http://codereview.chromium.org/6488010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75620 0039d316-1c4b-4281-b951-d872f2087c98
* Check that we've got a complete header before accessing its fields.glider@chromium.org2011-01-261-0/+3
| | | | | | | | | | | | | This patch was prepared by Evgeniy Stepanov (eugenis@chromium.org) and reviewed at http://codereview.chromium.org/6353010/ BUG=70376 TEST=none TBR=darin,willchan Review URL: http://codereview.chromium.org/6347013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72634 0039d316-1c4b-4281-b951-d872f2087c98
* Make the order of methods in the cc files match the headers in base/.erg@google.com2011-01-071-51/+51
| | | | | | | | | BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6189001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70771 0039d316-1c4b-4281-b951-d872f2087c98
* Pickle: handle invalid data on 64 bit systems.rvargas@google.com2010-11-151-3/+13
| | | | | | | | | | | | There was a problem with pointer arithmetic for 64 bit systems so invalid data was not properly detected. Now we do explicit tests. BUG=56449 TEST=base_unittests Review URL: http://codereview.chromium.org/4716006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66149 0039d316-1c4b-4281-b951-d872f2087c98
* Don't allow dragging browser actions between regular and incognito windows.mpcomplete@chromium.org2010-03-301-0/+2
| | | | | | | | | | | | This fixes a crash. Also small fix to Pickle::ReadBytes to fix up the iterator if it is NULL. BUG=39340 Review URL: http://codereview.chromium.org/1542007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43147 0039d316-1c4b-4281-b951-d872f2087c98
* Switch base to using CHECK_*.willchan@chromium.org2010-03-021-1/+1
| | | | | | Review URL: http://codereview.chromium.org/660357 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40394 0039d316-1c4b-4281-b951-d872f2087c98
* Take out intptr_t IPC serialization support to prevent people from sending ↵jam@chromium.org2010-02-091-14/+0
| | | | | | | | pointers between trusted and untrusted processes. Move HWNDs and other Windows HANDLEs serialization to use 32 bits even on 64 bit platforms since that's all that's needed. Review URL: http://codereview.chromium.org/565001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38455 0039d316-1c4b-4281-b951-d872f2087c98
* Defense-in-depth: initialize some variables.cevans@chromium.org2009-12-301-0/+3
| | | | | | | | | BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/517025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35387 0039d316-1c4b-4281-b951-d872f2087c98
* Fix build breakage at r30320.ukai@chromium.org2009-10-281-1/+1
| | | | | | | | | | | | | Fix warning: comparison between signed and unsigned integer expressions in base/pickle.cc TBR=thesig BUG=none TEST=build sucess Review URL: http://codereview.chromium.org/342014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30321 0039d316-1c4b-4281-b951-d872f2087c98
* Add Pickle::Read/WriteUint64.thestig@chromium.org2009-10-281-2/+16
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/297011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30320 0039d316-1c4b-4281-b951-d872f2087c98
* Add short circuit case for self assignment, and add virtual destructorjar@chromium.org2009-08-071-2/+7
| | | | | | | | | | | | | | | | | | | Pickle is a base class of Message, which has a virtual destructor, so it is better to have Pickle have a virtual destructor as well. Add more defensive code in the case of self assignment. **IF** self assignment was used, and the target was read-only, then the existing code would have a memory fault. I don't think this is currently possible in use cases, but the defensize code is much better. (per suggestion from CPU on last CL). BUG=17027 BUG=17088 r=cpu Review URL: http://codereview.chromium.org/159800 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22826 0039d316-1c4b-4281-b951-d872f2087c98
* Add defensive code in pickle to preclude realloc of shared header_ memory.jar@chromium.org2009-08-031-2/+7
| | | | | | | | | | | | | | | | Since I was able to (some how) generate a problem with header_ being double freed (perhaps, because it was shared in some way??), this change adds several lines of defensive coding. The current assignment operator appears very dangerous, as it allowed Resize to be called when the header_ was not owned by the instance (it was read-only). I haven't found a path to cause a problem, but we may as well be defensive. BUG=17027 BUG=17088 r=CPU Review URL: http://codereview.chromium.org/160490 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22261 0039d316-1c4b-4281-b951-d872f2087c98
* WriteData and BeginWriteData should fail if length iswtc@chromium.org2009-07-281-3/+3
| | | | | | | | | | | | | negative. Add a unit test for WriteData(NULL, 0). R=darin BUG=none TEST=new unit test should pass Review URL: http://codereview.chromium.org/159310 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21886 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a couple of integer issues in Pickle deserialization. Neither representcevans@chromium.org2009-06-251-1/+4
| | | | | | | | | | | | | a significant risk because the code is not directly exposed to user input. In addition, neither error leads to memory corruption. At worse, there's a C++ exception or abort(). BUG=NONE TEST=PickleTest.EvilLengths Review URL: http://codereview.chromium.org/146121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19249 0039d316-1c4b-4281-b951-d872f2087c98
* Moved bug to external tracker.maruel@chromium.org2009-06-011-6/+6
| | | | | | | TBR=nsylvain Review URL: http://codereview.chromium.org/118085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17347 0039d316-1c4b-4281-b951-d872f2087c98
* Change Pickle to double its capacity by default, rather than increasingmpcomplete@google.com2009-03-161-1/+2
| | | | | | | | | incrementally, when it needs to expand on writing data. BUG=8760 Review URL: http://codereview.chromium.org/46056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11769 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-101-1/+0
| | | | | | | | | Normalize end of file newlines in base/. All files end in a single newline. Review URL: http://codereview.chromium.org/42011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11329 0039d316-1c4b-4281-b951-d872f2087c98
* Update clipboard classes to use string16 and FilePath instead of wstring.estade@chromium.org2009-03-041-1/+25
| | | | | | | | | | Update callers as well. This patch builds on a patch by mark.a.lindner@gmail.com which can be found at http://codereview.chromium.org/28294 Review URL: http://codereview.chromium.org/27370 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10860 0039d316-1c4b-4281-b951-d872f2087c98
* * Bring up render_mesages.cc on POSIX.jeremy@chromium.org2008-12-291-0/+14
| | | | | | | | | * Add Pickle::Read/WriteUint32 & ParamTraits<uint32>. * Removed NSEvent from WebInputEvent since it appears not to be needed anymore. Review URL: http://codereview.chromium.org/16479 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7484 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Adds capabilities for IPC messages of type long, for the primary purpose of ↵klink@google.com2008-08-221-0/+16
| | | | | | accessibility related communication. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1263 0039d316-1c4b-4281-b951-d872f2087c98
* Fix more compiler warnings.darin@google.com2008-08-151-3/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@922 0039d316-1c4b-4281-b951-d872f2087c98
* Don't cast negative values to unsigned. This eliminates warnings in GCC.deanm@google.com2008-08-131-4/+7
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@799 0039d316-1c4b-4281-b951-d872f2087c98
* Reapply 508 to determine if it was indeed the cause of the ↵maruel@google.com2008-08-071-9/+10
| | | | | | webkit-release-playback failure. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@518 0039d316-1c4b-4281-b951-d872f2087c98
* Revert part of r508, it may have broken webkit-release-playback.deanm@google.com2008-08-071-10/+9
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@514 0039d316-1c4b-4281-b951-d872f2087c98
* Some cross platform changes and general cleanups to Pickle.deanm@google.com2008-08-071-9/+10
| | | | | | | | | | | - Clean up TrimWriteData, and remove the unneeded VariableLengthBuffer struct. Modify a test to slightly test TrimWriteData, but it probably deserves more. - Remove unneeded includes in pickle_unittest, including windows.h. - According to 3.5 of the C++ standard, CustomHeader could not be used as a template argument, because it had no linkage. This now builds on GCC. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@508 0039d316-1c4b-4281-b951-d872f2087c98
* Fix base::DIR_SOURCE_ROOT path calculation.maruel@google.com2008-08-061-3/+9
| | | | | | | | | Add missing header files to base.vcproj. Fix thread local storage implicit destructor call on Windows x64. Fix build compilation issues in x64 with third party headers. Fix Pickle for x64, the header doesn't need to be size_t, uint32 ought to be sufficient for the object. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@450 0039d316-1c4b-4281-b951-d872f2087c98
* Add base to the repository.initial.commit2008-07-261-0/+348
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8 0039d316-1c4b-4281-b951-d872f2087c98