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

Side by Side Diff: Source/WebCore/loader/cache/CachedShader.cpp

Issue 14210003: Simplify CachedResource::data (Closed) Base URL: svn://svn.chromium.org/blink/trunk/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 if (m_shaderString.isNull() && m_data) { 52 if (m_shaderString.isNull() && m_data) {
53 StringBuilder builder; 53 StringBuilder builder;
54 builder.append(m_decoder->decode(m_data->data(), m_data->size())); 54 builder.append(m_decoder->decode(m_data->data(), m_data->size()));
55 builder.append(m_decoder->flush()); 55 builder.append(m_decoder->flush());
56 m_shaderString = builder.toString(); 56 m_shaderString = builder.toString();
57 } 57 }
58 58
59 return m_shaderString; 59 return m_shaderString;
60 } 60 }
61 61
62 void CachedShader::data(PassRefPtr<ResourceBuffer> data, bool allDataReceived)
63 {
64 if (allDataReceived)
65 m_data = data;
66 CachedResource::data(data, allDataReceived);
67 }
68
69 void CachedShader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 62 void CachedShader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
70 { 63 {
71 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou rceShader); 64 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou rceShader);
72 CachedResource::reportMemoryUsage(memoryObjectInfo); 65 CachedResource::reportMemoryUsage(memoryObjectInfo);
73 info.addMember(m_decoder, "decoder"); 66 info.addMember(m_decoder, "decoder");
74 info.addMember(m_shaderString, "shaderString"); 67 info.addMember(m_shaderString, "shaderString");
75 } 68 }
76 69
77 } // namespace WebCore 70 } // namespace WebCore
78 71
OLDNEW
« no previous file with comments | « Source/WebCore/loader/cache/CachedShader.h ('k') | Source/WebCore/loader/cache/CachedTextTrack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698