summaryrefslogtreecommitdiffstats
path: root/base/pickle.cc
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-06 20:35:17 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-06 20:35:17 +0000
commitc9046afea46a4b8252392adced73f3d2a9fb354e (patch)
treec557a80884a379eecf170e3cf88acee77bc4d837 /base/pickle.cc
parenta4930c88e7fb14ba66340cbe393fcdf4c668e41c (diff)
downloadchromium_src-c9046afea46a4b8252392adced73f3d2a9fb354e.zip
chromium_src-c9046afea46a4b8252392adced73f3d2a9fb354e.tar.gz
chromium_src-c9046afea46a4b8252392adced73f3d2a9fb354e.tar.bz2
Fix base::DIR_SOURCE_ROOT path calculation.
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
Diffstat (limited to 'base/pickle.cc')
-rw-r--r--base/pickle.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/base/pickle.cc b/base/pickle.cc
index a16368b..0fb1d9c 100644
--- a/base/pickle.cc
+++ b/base/pickle.cc
@@ -27,10 +27,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include "base/pickle.h"
+
#include <stdlib.h>
-#include <string>
-#include "base/pickle.h"
+#include <limits>
+#include <string>
//------------------------------------------------------------------------------
@@ -240,7 +242,11 @@ char* Pickle::BeginWrite(size_t length) {
if (header_size_ + new_size > capacity_ && !Resize(header_size_ + new_size))
return NULL;
- header_->payload_size = new_size;
+#ifdef ARCH_CPU_64_BITS
+ DCHECK_LE(length, std::numeric_limits<uint32>::max());
+#endif
+
+ header_->payload_size = static_cast<uint32>(new_size);
return payload() + offset;
}