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

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

Issue 1322523002: Make WorkerScriptLoader back to RefCounted class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « Source/web/WebSharedWorkerImpl.h ('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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 { 165 {
166 if (m_networkProvider) 166 if (m_networkProvider)
167 m_networkProvider->willSendRequest(frame->dataSource(), request); 167 m_networkProvider->willSendRequest(frame->dataSource(), request);
168 } 168 }
169 169
170 void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame, bool) 170 void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame, bool)
171 { 171 {
172 ASSERT(!m_loadingDocument); 172 ASSERT(!m_loadingDocument);
173 ASSERT(!m_mainScriptLoader); 173 ASSERT(!m_mainScriptLoader);
174 m_networkProvider = adoptPtr(m_client->createServiceWorkerNetworkProvider(fr ame->dataSource())); 174 m_networkProvider = adoptPtr(m_client->createServiceWorkerNetworkProvider(fr ame->dataSource()));
175 m_mainScriptLoader = adoptPtr(new WorkerScriptLoader()); 175 m_mainScriptLoader = WorkerScriptLoader::create();
176 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextSharedWor ker); 176 m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextSharedWor ker);
177 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document(); 177 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document();
178 m_mainScriptLoader->loadAsynchronously( 178 m_mainScriptLoader->loadAsynchronously(
179 *m_loadingDocument.get(), 179 *m_loadingDocument.get(),
180 m_url, 180 m_url,
181 DenyCrossOriginRequests, 181 DenyCrossOriginRequests,
182 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, this), 182 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, this),
183 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this)); 183 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this));
184 // Do nothing here since onScriptLoaderFinished() might have been already 184 // Do nothing here since onScriptLoaderFinished() might have been already
185 // invoked and |this| might have been deleted at this point. 185 // invoked and |this| might have been deleted at this point.
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 if (devtoolsAgent) 394 if (devtoolsAgent)
395 devtoolsAgent->dispatchOnInspectorBackend(message); 395 devtoolsAgent->dispatchOnInspectorBackend(message);
396 } 396 }
397 397
398 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) 398 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client)
399 { 399 {
400 return new WebSharedWorkerImpl(client); 400 return new WebSharedWorkerImpl(client);
401 } 401 }
402 402
403 } // namespace blink 403 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebSharedWorkerImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698