| 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 namespace blink { | 40 namespace blink { |
| 41 class WebWaitableEvent; | 41 class WebWaitableEvent; |
| 42 } | 42 } |
| 43 | 43 |
| 44 namespace blink { | 44 namespace blink { |
| 45 | 45 |
| 46 // This bridge is created and destroyed on the worker thread, but is | 46 // This bridge is created and destroyed on the worker thread, but is |
| 47 // passed to and used on the main thread. Each did* method records the given | 47 // passed to and used on the main thread. Each did* method records the given |
| 48 // data so that they can be run on the worker thread later (by run()). | 48 // data so that they can be run on the worker thread later (by run()). |
| 49 class WorkerLoaderClientBridgeSyncHelper : public ThreadableLoaderClient { | 49 class WorkerLoaderClientBridgeSyncHelper : public ThreadableLoaderClient { |
| 50 WTF_MAKE_FAST_ALLOCATED(WorkerLoaderClientBridgeSyncHelper); |
| 50 public: | 51 public: |
| 51 static PassOwnPtr<WorkerLoaderClientBridgeSyncHelper> create(ThreadableLoade
rClientWrapper*, PassOwnPtr<WebWaitableEvent>); | 52 static PassOwnPtr<WorkerLoaderClientBridgeSyncHelper> create(ThreadableLoade
rClientWrapper*, PassOwnPtr<WebWaitableEvent>); |
| 52 virtual ~WorkerLoaderClientBridgeSyncHelper(); | 53 virtual ~WorkerLoaderClientBridgeSyncHelper(); |
| 53 | 54 |
| 54 // Called on the worker context thread. | 55 // Called on the worker context thread. |
| 55 void run(); | 56 void run(); |
| 56 | 57 |
| 57 // Called on the main thread. | 58 // Called on the main thread. |
| 58 virtual void didSendData(unsigned long long bytesSent, unsigned long long to
talBytesToBeSent) override; | 59 virtual void didSendData(unsigned long long bytesSent, unsigned long long to
talBytesToBeSent) override; |
| 59 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp
onse&, PassOwnPtr<WebDataConsumerHandle>) override; | 60 virtual void didReceiveResponse(unsigned long identifier, const ResourceResp
onse&, PassOwnPtr<WebDataConsumerHandle>) override; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 73 RefPtr<ThreadableLoaderClientWrapper> m_client; | 74 RefPtr<ThreadableLoaderClientWrapper> m_client; |
| 74 OwnPtr<WebWaitableEvent> m_event; | 75 OwnPtr<WebWaitableEvent> m_event; |
| 75 Vector<Vector<char>*> m_receivedData; | 76 Vector<Vector<char>*> m_receivedData; |
| 76 Vector<OwnPtr<Closure>> m_clientTasks; | 77 Vector<OwnPtr<Closure>> m_clientTasks; |
| 77 Mutex m_lock; | 78 Mutex m_lock; |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 } // namespace blink | 81 } // namespace blink |
| 81 | 82 |
| 82 #endif // WorkerLoaderClientBridgeSyncHelper_h | 83 #endif // WorkerLoaderClientBridgeSyncHelper_h |
| OLD | NEW |