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

Side by Side Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 2247073007: Make SharedBuffer in Resource non-discardable and remove PurgeableVector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SharedBuffer_DoNotUnlock
Patch Set: Rebase. Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/platform/PurgeableVector.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 /* 1 /*
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 void Resource::appendData(const char* data, size_t length) 353 void Resource::appendData(const char* data, size_t length)
354 { 354 {
355 TRACE_EVENT0("blink", "Resource::appendData"); 355 TRACE_EVENT0("blink", "Resource::appendData");
356 DCHECK(!m_isRevalidating); 356 DCHECK(!m_isRevalidating);
357 ASSERT(!errorOccurred()); 357 ASSERT(!errorOccurred());
358 if (m_options.dataBufferingPolicy == DoNotBufferData) 358 if (m_options.dataBufferingPolicy == DoNotBufferData)
359 return; 359 return;
360 if (m_data) 360 if (m_data)
361 m_data->append(data, length); 361 m_data->append(data, length);
362 else 362 else
363 m_data = SharedBuffer::createPurgeable(data, length); 363 m_data = SharedBuffer::create(data, length);
364 setEncodedSize(m_data->size()); 364 setEncodedSize(m_data->size());
365 } 365 }
366 366
367 void Resource::setResourceBuffer(PassRefPtr<SharedBuffer> resourceBuffer) 367 void Resource::setResourceBuffer(PassRefPtr<SharedBuffer> resourceBuffer)
368 { 368 {
369 DCHECK(!m_isRevalidating); 369 DCHECK(!m_isRevalidating);
370 ASSERT(!errorOccurred()); 370 ASSERT(!errorOccurred());
371 ASSERT(m_options.dataBufferingPolicy == BufferData); 371 ASSERT(m_options.dataBufferingPolicy == BufferData);
372 m_data = resourceBuffer; 372 m_data = resourceBuffer;
373 setEncodedSize(m_data->size()); 373 setEncodedSize(m_data->size());
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 case Resource::TextTrack: 1049 case Resource::TextTrack:
1050 case Resource::Media: 1050 case Resource::Media:
1051 case Resource::Manifest: 1051 case Resource::Manifest:
1052 return false; 1052 return false;
1053 } 1053 }
1054 ASSERT_NOT_REACHED(); 1054 ASSERT_NOT_REACHED();
1055 return false; 1055 return false;
1056 } 1056 }
1057 1057
1058 } // namespace blink 1058 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/PurgeableVector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698