| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 { | 54 { |
| 55 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); | 55 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); |
| 56 workerClientWrapper->didSendData(bytesSent, totalBytesToBeSent); | 56 workerClientWrapper->didSendData(bytesSent, totalBytesToBeSent); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void WorkerLoaderClientBridge::didSendData(unsigned long long bytesSent, unsigne
d long long totalBytesToBeSent) | 59 void WorkerLoaderClientBridge::didSendData(unsigned long long bytesSent, unsigne
d long long totalBytesToBeSent) |
| 60 { | 60 { |
| 61 m_loaderProxy.postTaskToWorkerGlobalScope(createCrossThreadTask(&workerGloba
lScopeDidSendData, m_workerClientWrapper, bytesSent, totalBytesToBeSent)); | 61 m_loaderProxy.postTaskToWorkerGlobalScope(createCrossThreadTask(&workerGloba
lScopeDidSendData, m_workerClientWrapper, bytesSent, totalBytesToBeSent)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 static void workerGlobalScopeDidReceiveResponse(ExecutionContext* context, PassR
efPtr<ThreadableLoaderClientWrapper> workerClientWrapper, unsigned long identifi
er, PassOwnPtr<CrossThreadResourceResponseData> responseData) | 64 static void workerGlobalScopeDidReceiveResponse(ExecutionContext* context, PassR
efPtr<ThreadableLoaderClientWrapper> workerClientWrapper, unsigned long identifi
er, PassOwnPtr<CrossThreadResourceResponseData> responseData, PassOwnPtr<WebData
ConsumerHandle> handle) |
| 65 { | 65 { |
| 66 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); | 66 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); |
| 67 OwnPtr<ResourceResponse> response(ResourceResponse::adopt(responseData)); | 67 OwnPtr<ResourceResponse> response(ResourceResponse::adopt(responseData)); |
| 68 workerClientWrapper->didReceiveResponse(identifier, *response); | 68 workerClientWrapper->didReceiveResponse(identifier, *response, handle); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void WorkerLoaderClientBridge::didReceiveResponse(unsigned long identifier, cons
t ResourceResponse& response) | 71 void WorkerLoaderClientBridge::didReceiveResponse(unsigned long identifier, cons
t ResourceResponse& response, PassOwnPtr<WebDataConsumerHandle> handle) |
| 72 { | 72 { |
| 73 m_loaderProxy.postTaskToWorkerGlobalScope(createCrossThreadTask(&workerGloba
lScopeDidReceiveResponse, m_workerClientWrapper, identifier, response)); | 73 m_loaderProxy.postTaskToWorkerGlobalScope(createCrossThreadTask(&workerGloba
lScopeDidReceiveResponse, m_workerClientWrapper, identifier, response, handle)); |
| 74 } | 74 } |
| 75 | 75 |
| 76 static void workerGlobalScopeDidReceiveData(ExecutionContext* context, PassRefPt
r<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<Vector<char> >
vectorData) | 76 static void workerGlobalScopeDidReceiveData(ExecutionContext* context, PassRefPt
r<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<Vector<char> >
vectorData) |
| 77 { | 77 { |
| 78 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); | 78 ASSERT_UNUSED(context, context->isWorkerGlobalScope()); |
| 79 RELEASE_ASSERT(vectorData->size() <= std::numeric_limits<unsigned>::max()); | 79 RELEASE_ASSERT(vectorData->size() <= std::numeric_limits<unsigned>::max()); |
| 80 workerClientWrapper->didReceiveData(vectorData->data(), vectorData->size()); | 80 workerClientWrapper->didReceiveData(vectorData->data(), vectorData->size()); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void WorkerLoaderClientBridge::didReceiveData(const char* data, unsigned dataLen
gth) | 83 void WorkerLoaderClientBridge::didReceiveData(const char* data, unsigned dataLen
gth) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 m_loaderProxy.postTaskToWorkerGlobalScope(createCrossThreadTask(&workerGloba
lScopeDidFailRedirectCheck, m_workerClientWrapper)); | 155 m_loaderProxy.postTaskToWorkerGlobalScope(createCrossThreadTask(&workerGloba
lScopeDidFailRedirectCheck, m_workerClientWrapper)); |
| 156 } | 156 } |
| 157 | 157 |
| 158 WorkerLoaderClientBridge::WorkerLoaderClientBridge(PassRefPtr<ThreadableLoaderCl
ientWrapper> clientWrapper, WorkerLoaderProxy& loaderProxy) | 158 WorkerLoaderClientBridge::WorkerLoaderClientBridge(PassRefPtr<ThreadableLoaderCl
ientWrapper> clientWrapper, WorkerLoaderProxy& loaderProxy) |
| 159 : m_workerClientWrapper(clientWrapper) | 159 : m_workerClientWrapper(clientWrapper) |
| 160 , m_loaderProxy(loaderProxy) | 160 , m_loaderProxy(loaderProxy) |
| 161 { | 161 { |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace blink | 164 } // namespace blink |
| OLD | NEW |