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

Side by Side Diff: content/renderer/service_worker/service_worker_script_context.cc

Issue 475333002: [ServiceWorker] Sends the blob uuid of the request body to the ServiceWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve blobs Created 6 years, 4 months 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
« no previous file with comments | « content/common/service_worker/service_worker_types.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/service_worker/service_worker_script_context.h" 5 #include "content/renderer/service_worker/service_worker_script_context.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/child/thread_safe_sender.h" 10 #include "content/child/thread_safe_sender.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 blink::WebServiceWorkerRequest webRequest; 142 blink::WebServiceWorkerRequest webRequest;
143 webRequest.setURL(blink::WebURL(request.url)); 143 webRequest.setURL(blink::WebURL(request.url));
144 webRequest.setMethod(blink::WebString::fromUTF8(request.method)); 144 webRequest.setMethod(blink::WebString::fromUTF8(request.method));
145 for (std::map<std::string, std::string>::const_iterator it = 145 for (std::map<std::string, std::string>::const_iterator it =
146 request.headers.begin(); 146 request.headers.begin();
147 it != request.headers.end(); 147 it != request.headers.end();
148 ++it) { 148 ++it) {
149 webRequest.setHeader(blink::WebString::fromUTF8(it->first), 149 webRequest.setHeader(blink::WebString::fromUTF8(it->first),
150 blink::WebString::fromUTF8(it->second)); 150 blink::WebString::fromUTF8(it->second));
151 } 151 }
152 if (!request.blob_uuid.empty()) {
153 webRequest.setBlob(blink::WebString::fromUTF8(request.blob_uuid),
154 request.blob_size);
155 }
152 webRequest.setReferrer(blink::WebString::fromUTF8(request.referrer.spec()), 156 webRequest.setReferrer(blink::WebString::fromUTF8(request.referrer.spec()),
153 blink::WebReferrerPolicyDefault); 157 blink::WebReferrerPolicyDefault);
154 webRequest.setIsReload(request.is_reload); 158 webRequest.setIsReload(request.is_reload);
155 proxy_->dispatchFetchEvent(request_id, webRequest); 159 proxy_->dispatchFetchEvent(request_id, webRequest);
156 } 160 }
157 161
158 void ServiceWorkerScriptContext::OnSyncEvent(int request_id) { 162 void ServiceWorkerScriptContext::OnSyncEvent(int request_id) {
159 proxy_->dispatchSyncEvent(request_id); 163 proxy_->dispatchSyncEvent(request_id);
160 } 164 }
161 165
(...skipping 30 matching lines...) Expand all
192 return; 196 return;
193 } 197 }
194 scoped_ptr<blink::WebServiceWorkerClientsInfo> info( 198 scoped_ptr<blink::WebServiceWorkerClientsInfo> info(
195 new blink::WebServiceWorkerClientsInfo); 199 new blink::WebServiceWorkerClientsInfo);
196 info->clientIDs = client_ids; 200 info->clientIDs = client_ids;
197 callbacks->onSuccess(info.release()); 201 callbacks->onSuccess(info.release());
198 pending_clients_callbacks_.Remove(request_id); 202 pending_clients_callbacks_.Remove(request_id);
199 } 203 }
200 204
201 } // namespace content 205 } // namespace content
OLDNEW
« no previous file with comments | « content/common/service_worker/service_worker_types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698