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

Side by Side Diff: Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 621003002: [ServiceWorker] Treat opaque response as a network error for frame loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 ASSERT(m_workerGlobalScope); 77 ASSERT(m_workerGlobalScope);
78 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Activate, eventID); 78 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Activate, eventID);
79 observer->willDispatchEvent(); 79 observer->willDispatchEvent();
80 m_workerGlobalScope->dispatchEvent(ExtendableEvent::create(EventTypeNames::a ctivate, EventInit(), observer)); 80 m_workerGlobalScope->dispatchEvent(ExtendableEvent::create(EventTypeNames::a ctivate, EventInit(), observer));
81 observer->didDispatchEvent(); 81 observer->didDispatchEvent();
82 } 82 }
83 83
84 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID, const WebSer viceWorkerRequest& webRequest) 84 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID, const WebSer viceWorkerRequest& webRequest)
85 { 85 {
86 ASSERT(m_workerGlobalScope); 86 ASSERT(m_workerGlobalScope);
87 RespondWithObserver* observer = RespondWithObserver::create(m_workerGlobalSc ope, eventID, webRequest.mode()); 87 RespondWithObserver* observer = RespondWithObserver::create(m_workerGlobalSc ope, eventID, webRequest.mode(), webRequest.frameType());
88 if (!RuntimeEnabledFeatures::serviceWorkerOnFetchEnabled()) { 88 if (!RuntimeEnabledFeatures::serviceWorkerOnFetchEnabled()) {
89 observer->didDispatchEvent(); 89 observer->didDispatchEvent();
90 return; 90 return;
91 } 91 }
92 92
93 Request* request = Request::create(m_workerGlobalScope, webRequest); 93 Request* request = Request::create(m_workerGlobalScope, webRequest);
94 RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(observer, reque st)); 94 RefPtrWillBeRawPtr<FetchEvent> fetchEvent(FetchEvent::create(observer, reque st));
95 fetchEvent->setIsReload(webRequest.isReload()); 95 fetchEvent->setIsReload(webRequest.isReload());
96 m_workerGlobalScope->dispatchEvent(fetchEvent.release()); 96 m_workerGlobalScope->dispatchEvent(fetchEvent.release());
97 observer->didDispatchEvent(); 97 observer->didDispatchEvent();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) 167 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client)
168 : m_embeddedWorker(embeddedWorker) 168 : m_embeddedWorker(embeddedWorker)
169 , m_document(document) 169 , m_document(document)
170 , m_client(client) 170 , m_client(client)
171 , m_workerGlobalScope(0) 171 , m_workerGlobalScope(0)
172 { 172 {
173 } 173 }
174 174
175 } // namespace blink 175 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698