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

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

Issue 204983007: Make ThreadableLoader class to use references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments Created 6 years, 8 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/AssociatedURLLoader.cpp ('k') | Source/web/WebSharedWorkerImpl.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 /* 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return adoptPtr(new Loader()); 67 return adoptPtr(new Loader());
68 } 68 }
69 69
70 virtual ~Loader() 70 virtual ~Loader()
71 { 71 {
72 m_scriptLoader->setClient(0); 72 m_scriptLoader->setClient(0);
73 } 73 }
74 74
75 void load(ExecutionContext* loadingContext, const KURL& scriptURL, const Clo sure& callback) 75 void load(ExecutionContext* loadingContext, const KURL& scriptURL, const Clo sure& callback)
76 { 76 {
77 ASSERT(loadingContext);
77 m_callback = callback; 78 m_callback = callback;
78 m_scriptLoader->setTargetType(ResourceRequest::TargetIsServiceWorker); 79 m_scriptLoader->setTargetType(ResourceRequest::TargetIsServiceWorker);
79 m_scriptLoader->loadAsynchronously( 80 m_scriptLoader->loadAsynchronously(
80 loadingContext, scriptURL, DenyCrossOriginRequests, this); 81 *loadingContext, scriptURL, DenyCrossOriginRequests, this);
81 } 82 }
82 83
83 virtual void notifyFinished() OVERRIDE 84 virtual void notifyFinished() OVERRIDE
84 { 85 {
85 m_callback(); 86 m_callback();
86 } 87 }
87 88
88 void cancel() 89 void cancel()
89 { 90 {
90 m_scriptLoader->cancel(); 91 m_scriptLoader->cancel();
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 m_mainScriptLoader.clear(); 265 m_mainScriptLoader.clear();
265 266
266 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW ebFrameImpl(m_mainFrame)->frame()->document(), *contextClient); 267 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW ebFrameImpl(m_mainFrame)->frame()->document(), *contextClient);
267 m_loaderProxy = LoaderProxy::create(*this); 268 m_loaderProxy = LoaderProxy::create(*this);
268 269
269 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); 270 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release());
270 m_workerThread->start(); 271 m_workerThread->start();
271 } 272 }
272 273
273 } // namespace blink 274 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/AssociatedURLLoader.cpp ('k') | Source/web/WebSharedWorkerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698