OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 30 matching lines...) Expand all Loading... |
41 class WorkerLoaderProxy; | 41 class WorkerLoaderProxy; |
42 | 42 |
43 // This bridge is created and destroyed on the worker thread, but is | 43 // This bridge is created and destroyed on the worker thread, but is |
44 // passed to and used on the main thread. Each did* method relays the given | 44 // passed to and used on the main thread. Each did* method relays the given |
45 // data to the client wrapper on the worker context thread. | 45 // data to the client wrapper on the worker context thread. |
46 class WorkerLoaderClientBridge : public ThreadableLoaderClient { | 46 class WorkerLoaderClientBridge : public ThreadableLoaderClient { |
47 public: | 47 public: |
48 static PassOwnPtr<ThreadableLoaderClient> create(PassRefPtr<ThreadableLoader
ClientWrapper>, WorkerLoaderProxy&); | 48 static PassOwnPtr<ThreadableLoaderClient> create(PassRefPtr<ThreadableLoader
ClientWrapper>, WorkerLoaderProxy&); |
49 virtual ~WorkerLoaderClientBridge(); | 49 virtual ~WorkerLoaderClientBridge(); |
50 | 50 |
51 virtual void didSendData(unsigned long long bytesSent, unsigned long long to
talBytesToBeSent) OVERRIDE; | 51 virtual void didSendData(unsigned long long bytesSent, unsigned long long to
talBytesToBeSent) override; |
52 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp
onse&) OVERRIDE; | 52 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp
onse&) override; |
53 virtual void didReceiveData(const char*, unsigned dataLength) OVERRIDE; | 53 virtual void didReceiveData(const char*, unsigned dataLength) override; |
54 virtual void didDownloadData(int dataLength) OVERRIDE; | 54 virtual void didDownloadData(int dataLength) override; |
55 virtual void didReceiveCachedMetadata(const char*, int dataLength) OVERRIDE; | 55 virtual void didReceiveCachedMetadata(const char*, int dataLength) override; |
56 virtual void didFinishLoading(unsigned long identifier, double finishTime) O
VERRIDE; | 56 virtual void didFinishLoading(unsigned long identifier, double finishTime) o
verride; |
57 virtual void didFail(const ResourceError&) OVERRIDE; | 57 virtual void didFail(const ResourceError&) override; |
58 virtual void didFailAccessControlCheck(const ResourceError&) OVERRIDE; | 58 virtual void didFailAccessControlCheck(const ResourceError&) override; |
59 virtual void didFailRedirectCheck() OVERRIDE; | 59 virtual void didFailRedirectCheck() override; |
60 | 60 |
61 private: | 61 private: |
62 WorkerLoaderClientBridge(PassRefPtr<ThreadableLoaderClientWrapper>, WorkerLo
aderProxy&); | 62 WorkerLoaderClientBridge(PassRefPtr<ThreadableLoaderClientWrapper>, WorkerLo
aderProxy&); |
63 | 63 |
64 // Used on the worker context thread, while its refcounting is done on | 64 // Used on the worker context thread, while its refcounting is done on |
65 // either thread. | 65 // either thread. |
66 RefPtr<ThreadableLoaderClientWrapper> m_workerClientWrapper; | 66 RefPtr<ThreadableLoaderClientWrapper> m_workerClientWrapper; |
67 | 67 |
68 WorkerLoaderProxy& m_loaderProxy; | 68 WorkerLoaderProxy& m_loaderProxy; |
69 }; | 69 }; |
70 | 70 |
71 } // namespace blink | 71 } // namespace blink |
72 | 72 |
73 #endif // WorkerLoaderClientBridge_h | 73 #endif // WorkerLoaderClientBridge_h |
OLD | NEW |