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

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

Issue 2202173002: Refactoring: Make Resource::m_data private (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address on hiroshige's review Created 4 years, 4 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
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) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 // Returns the memory dump name used for tracing. See Resource::onMemoryDump . 288 // Returns the memory dump name used for tracing. See Resource::onMemoryDump .
289 String getMemoryDumpName() const; 289 String getMemoryDumpName() const;
290 290
291 const HashCountedSet<ResourceClient*>& clients() const { return m_clients; } 291 const HashCountedSet<ResourceClient*>& clients() const { return m_clients; }
292 DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBuffe ringPolicy; } 292 DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBuffe ringPolicy; }
293 293
294 void setCachePolicyBypassingCache(); 294 void setCachePolicyBypassingCache();
295 void setLoFiStateOff(); 295 void setLoFiStateOff();
296 296
297 RefPtr<SharedBuffer> m_data; 297 SharedBuffer* data() const { return m_data.get(); }
298 void clearData() { m_data.clear(); }
298 299
299 private: 300 private:
300 class ResourceCallback; 301 class ResourceCallback;
301 class CachedMetadataHandlerImpl; 302 class CachedMetadataHandlerImpl;
302 class ServiceWorkerResponseCachedMetadataHandler; 303 class ServiceWorkerResponseCachedMetadataHandler;
303 304
304 void cancelTimerFired(TimerBase*); 305 void cancelTimerFired(TimerBase*);
305 306
306 void revalidationSucceeded(const ResourceResponse&); 307 void revalidationSucceeded(const ResourceResponse&);
307 void revalidationFailed(); 308 void revalidationFailed();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 354
354 ResourceLoaderOptions m_options; 355 ResourceLoaderOptions m_options;
355 356
356 double m_responseTimestamp; 357 double m_responseTimestamp;
357 358
358 Timer<Resource> m_cancelTimer; 359 Timer<Resource> m_cancelTimer;
359 360
360 ResourceRequest m_resourceRequest; 361 ResourceRequest m_resourceRequest;
361 Member<ResourceLoader> m_loader; 362 Member<ResourceLoader> m_loader;
362 ResourceResponse m_response; 363 ResourceResponse m_response;
364
365 RefPtr<SharedBuffer> m_data;
363 }; 366 };
364 367
365 class ResourceFactory { 368 class ResourceFactory {
366 STACK_ALLOCATED(); 369 STACK_ALLOCATED();
367 public: 370 public:
368 virtual Resource* create(const ResourceRequest&, const ResourceLoaderOptions &, const String&) const = 0; 371 virtual Resource* create(const ResourceRequest&, const ResourceLoaderOptions &, const String&) const = 0;
369 Resource::Type type() const { return m_type; } 372 Resource::Type type() const { return m_type; }
370 373
371 protected: 374 protected:
372 ResourceFactory(Resource::Type type) : m_type(type) { } 375 ResourceFactory(Resource::Type type) : m_type(type) { }
373 376
374 Resource::Type m_type; 377 Resource::Type m_type;
375 }; 378 };
376 379
377 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 380 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
378 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); 381 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName);
379 382
380 } // namespace blink 383 } // namespace blink
381 384
382 #endif 385 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/RawResource.cpp ('k') | third_party/WebKit/Source/core/fetch/ScriptResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698