Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: Source/core/loader/WorkerLoaderClientBridge.cpp

Issue 603903003: [Streams] Pass WebDataConsumerHandle when the response arrives. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@web-data-pipe
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/loader/WorkerLoaderClientBridge.h ('k') | Source/core/loader/WorkerLoaderClientBridgeSyncHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698