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 29 matching lines...) Expand all Loading... |
40 class ThreadableLoaderClientWrapper; | 40 class ThreadableLoaderClientWrapper; |
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 WTF_MAKE_FAST_ALLOCATED(WorkerLoaderClientBridge); | 47 WTF_MAKE_FAST_ALLOCATED(WorkerLoaderClientBridge); |
48 public: | 48 public: |
49 static PassOwnPtr<ThreadableLoaderClient> create(PassRefPtr<ThreadableLoader
ClientWrapper>, PassRefPtr<WorkerLoaderProxy>); | 49 static PassOwnPtr<ThreadableLoaderClient> create(PassRefPtr<ThreadableLoader
ClientWrapper>, PassRefPtr<WorkerLoaderProxy>); |
50 virtual ~WorkerLoaderClientBridge(); | 50 ~WorkerLoaderClientBridge() override; |
51 | 51 |
52 virtual void didSendData(unsigned long long bytesSent, unsigned long long to
talBytesToBeSent) override; | 52 void didSendData(unsigned long long bytesSent, unsigned long long totalBytes
ToBeSent) override; |
53 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp
onse&, PassOwnPtr<WebDataConsumerHandle>) override; | 53 void didReceiveResponse(unsigned long identifier, const ResourceResponse&, P
assOwnPtr<WebDataConsumerHandle>) override; |
54 virtual void didReceiveData(const char*, unsigned dataLength) override; | 54 void didReceiveData(const char*, unsigned dataLength) override; |
55 virtual void didDownloadData(int dataLength) override; | 55 void didDownloadData(int dataLength) override; |
56 virtual void didReceiveCachedMetadata(const char*, int dataLength) override; | 56 void didReceiveCachedMetadata(const char*, int dataLength) override; |
57 virtual void didFinishLoading(unsigned long identifier, double finishTime) o
verride; | 57 void didFinishLoading(unsigned long identifier, double finishTime) override; |
58 virtual void didFail(const ResourceError&) override; | 58 void didFail(const ResourceError&) override; |
59 virtual void didFailAccessControlCheck(const ResourceError&) override; | 59 void didFailAccessControlCheck(const ResourceError&) override; |
60 virtual void didFailRedirectCheck() override; | 60 void didFailRedirectCheck() override; |
61 virtual void didReceiveResourceTiming(const ResourceTimingInfo&) override; | 61 void didReceiveResourceTiming(const ResourceTimingInfo&) override; |
62 | 62 |
63 private: | 63 private: |
64 WorkerLoaderClientBridge(PassRefPtr<ThreadableLoaderClientWrapper>, PassRefP
tr<WorkerLoaderProxy>); | 64 WorkerLoaderClientBridge(PassRefPtr<ThreadableLoaderClientWrapper>, PassRefP
tr<WorkerLoaderProxy>); |
65 | 65 |
66 // Used on the worker context thread, while its refcounting is done on | 66 // Used on the worker context thread, while its refcounting is done on |
67 // either thread. | 67 // either thread. |
68 RefPtr<ThreadableLoaderClientWrapper> m_workerClientWrapper; | 68 RefPtr<ThreadableLoaderClientWrapper> m_workerClientWrapper; |
69 | 69 |
70 RefPtr<WorkerLoaderProxy> m_loaderProxy; | 70 RefPtr<WorkerLoaderProxy> m_loaderProxy; |
71 }; | 71 }; |
72 | 72 |
73 } // namespace blink | 73 } // namespace blink |
74 | 74 |
75 #endif // WorkerLoaderClientBridge_h | 75 #endif // WorkerLoaderClientBridge_h |
OLD | NEW |