OLD | NEW |
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 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 virtual void updateRequest(const ResourceRequest&) OVERRIDE; | 53 virtual void updateRequest(const ResourceRequest&) OVERRIDE; |
54 virtual void responseReceived(const ResourceResponse&) OVERRIDE; | 54 virtual void responseReceived(const ResourceResponse&) OVERRIDE; |
55 virtual void didSendData(unsigned long long bytesSent, unsigned long long to
talBytesToBeSent) OVERRIDE; | 55 virtual void didSendData(unsigned long long bytesSent, unsigned long long to
talBytesToBeSent) OVERRIDE; |
56 virtual void didDownloadData(int) OVERRIDE; | 56 virtual void didDownloadData(int) OVERRIDE; |
57 }; | 57 }; |
58 | 58 |
59 #ifdef SECURITY_ASSERT_ENABLED | 59 #ifdef SECURITY_ASSERT_ENABLED |
60 inline bool isRawResource(const Resource& resource) | 60 inline bool isRawResource(const Resource& resource) |
61 { | 61 { |
62 Resource::Type type = resource.type(); | 62 Resource::Type type = resource.type(); |
63 return type == Resource::MainResource || type == Resource::Raw || type == Re
source::TextTrack || type == Resource::ImportResource; | 63 return type == Resource::MainResource || type == Resource::Raw || type == Re
source::TextTrack || type == Resource::Media || type == Resource::ImportResource
; |
64 } | 64 } |
65 #endif | 65 #endif |
66 inline RawResource* toRawResource(const ResourcePtr<Resource>& resource) | 66 inline RawResource* toRawResource(const ResourcePtr<Resource>& resource) |
67 { | 67 { |
68 ASSERT_WITH_SECURITY_IMPLICATION(!resource || isRawResource(*resource.get())
); | 68 ASSERT_WITH_SECURITY_IMPLICATION(!resource || isRawResource(*resource.get())
); |
69 return static_cast<RawResource*>(resource.get()); | 69 return static_cast<RawResource*>(resource.get()); |
70 } | 70 } |
71 | 71 |
72 class RawResourceClient : public ResourceClient { | 72 class RawResourceClient : public ResourceClient { |
73 public: | 73 public: |
74 virtual ~RawResourceClient() { } | 74 virtual ~RawResourceClient() { } |
75 static ResourceClientType expectedType() { return RawResourceType; } | 75 static ResourceClientType expectedType() { return RawResourceType; } |
76 virtual ResourceClientType resourceClientType() const OVERRIDE FINAL { retur
n expectedType(); } | 76 virtual ResourceClientType resourceClientType() const OVERRIDE FINAL { retur
n expectedType(); } |
77 | 77 |
78 virtual void dataSent(Resource*, unsigned long long /* bytesSent */, unsigne
d long long /* totalBytesToBeSent */) { } | 78 virtual void dataSent(Resource*, unsigned long long /* bytesSent */, unsigne
d long long /* totalBytesToBeSent */) { } |
79 virtual void responseReceived(Resource*, const ResourceResponse&) { } | 79 virtual void responseReceived(Resource*, const ResourceResponse&) { } |
80 virtual void dataReceived(Resource*, const char* /* data */, int /* length *
/) { } | 80 virtual void dataReceived(Resource*, const char* /* data */, int /* length *
/) { } |
81 virtual void redirectReceived(Resource*, ResourceRequest&, const ResourceRes
ponse&) { } | 81 virtual void redirectReceived(Resource*, ResourceRequest&, const ResourceRes
ponse&) { } |
82 virtual void updateRequest(Resource*, const ResourceRequest&) { } | 82 virtual void updateRequest(Resource*, const ResourceRequest&) { } |
83 virtual void dataDownloaded(Resource*, int) { } | 83 virtual void dataDownloaded(Resource*, int) { } |
84 }; | 84 }; |
85 | 85 |
86 } | 86 } |
87 | 87 |
88 #endif // RawResource_h | 88 #endif // RawResource_h |
OLD | NEW |