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

Side by Side Diff: Source/modules/serviceworkers/Cache.cpp

Issue 692443002: Move the v8::Isolate* parameter to the first parameter of various binding methods in third_party/We… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« no previous file with comments | « Source/modules/serviceworkers/Body.cpp ('k') | Source/modules/serviceworkers/FetchManager.cpp » ('j') | 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 "config.h" 5 #include "config.h"
6 #include "modules/serviceworkers/Cache.h" 6 #include "modules/serviceworkers/Cache.h"
7 7
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8ThrowException.h" 10 #include "bindings/core/v8/V8ThrowException.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); 331 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState);
332 const ScriptPromise promise = resolver->promise(); 332 const ScriptPromise promise = resolver->promise();
333 m_webCache->dispatchBatch(new CacheDeleteCallback(resolver), batchOperations ); 333 m_webCache->dispatchBatch(new CacheDeleteCallback(resolver), batchOperations );
334 return promise; 334 return promise;
335 } 335 }
336 336
337 ScriptPromise Cache::putImpl(ScriptState* scriptState, const Request* request, R esponse* response) 337 ScriptPromise Cache::putImpl(ScriptState* scriptState, const Request* request, R esponse* response)
338 { 338 {
339 KURL url(KURL(), request->url()); 339 KURL url(KURL(), request->url());
340 if (!url.protocolIsInHTTPFamily()) 340 if (!url.protocolIsInHTTPFamily())
341 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror("Request scheme '" + url.protocol() + "' is unsupported", scriptState->isola te())); 341 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror(scriptState->isolate(), "Request scheme '" + url.protocol() + "' is unsuppor ted"));
342 if (request->method() != "GET") 342 if (request->method() != "GET")
343 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror("Request method '" + request->method() + "' is unsupported", scriptState->is olate())); 343 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror(scriptState->isolate(), "Request method '" + request->method() + "' is unsup ported"));
344 344
345 WebVector<WebServiceWorkerCache::BatchOperation> batchOperations(size_t(1)); 345 WebVector<WebServiceWorkerCache::BatchOperation> batchOperations(size_t(1));
346 batchOperations[0].operationType = WebServiceWorkerCache::OperationTypePut; 346 batchOperations[0].operationType = WebServiceWorkerCache::OperationTypePut;
347 request->populateWebServiceWorkerRequest(batchOperations[0].request); 347 request->populateWebServiceWorkerRequest(batchOperations[0].request);
348 response->populateWebServiceWorkerResponse(batchOperations[0].response); 348 response->populateWebServiceWorkerResponse(batchOperations[0].response);
349 349
350 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); 350 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState);
351 const ScriptPromise promise = resolver->promise(); 351 const ScriptPromise promise = resolver->promise();
352 m_webCache->dispatchBatch(new CacheAddOrPutCallbacks(resolver), batchOperati ons); 352 m_webCache->dispatchBatch(new CacheAddOrPutCallbacks(resolver), batchOperati ons);
353 return promise; 353 return promise;
(...skipping 12 matching lines...) Expand all
366 WebServiceWorkerRequest webRequest; 366 WebServiceWorkerRequest webRequest;
367 request->populateWebServiceWorkerRequest(webRequest); 367 request->populateWebServiceWorkerRequest(webRequest);
368 368
369 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); 369 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState);
370 const ScriptPromise promise = resolver->promise(); 370 const ScriptPromise promise = resolver->promise();
371 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), 0, toWebQ ueryParams(options)); 371 m_webCache->dispatchKeys(new CacheWithRequestsCallbacks(resolver), 0, toWebQ ueryParams(options));
372 return promise; 372 return promise;
373 } 373 }
374 374
375 } // namespace blink 375 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/Body.cpp ('k') | Source/modules/serviceworkers/FetchManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698