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

Side by Side Diff: third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp

Issue 2146403004: ThreadableLoader::cancel should be called before loader destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onheap-threadable-loader-client-wrapper
Patch Set: fix Created 4 years, 5 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 | « third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp ('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, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 void WorkerThreadableLoader::loadResourceSynchronously(WorkerGlobalScope& worker GlobalScope, const ResourceRequest& request, ThreadableLoaderClient& client, con st ThreadableLoaderOptions& options, const ResourceLoaderOptions& resourceLoader Options) 73 void WorkerThreadableLoader::loadResourceSynchronously(WorkerGlobalScope& worker GlobalScope, const ResourceRequest& request, ThreadableLoaderClient& client, con st ThreadableLoaderOptions& options, const ResourceLoaderOptions& resourceLoader Options)
74 { 74 {
75 std::unique_ptr<WorkerThreadableLoader> loader = wrapUnique(new WorkerThread ableLoader(workerGlobalScope, &client, options, resourceLoaderOptions, LoadSynch ronously)); 75 std::unique_ptr<WorkerThreadableLoader> loader = wrapUnique(new WorkerThread ableLoader(workerGlobalScope, &client, options, resourceLoaderOptions, LoadSynch ronously));
76 loader->start(request); 76 loader->start(request);
77 } 77 }
78 78
79 WorkerThreadableLoader::~WorkerThreadableLoader() 79 WorkerThreadableLoader::~WorkerThreadableLoader()
80 { 80 {
81 DCHECK(m_workerClientWrapper->done());
81 m_bridge->destroy(); 82 m_bridge->destroy();
82 m_bridge = nullptr; 83 m_bridge = nullptr;
83 } 84 }
84 85
85 void WorkerThreadableLoader::start(const ResourceRequest& request) 86 void WorkerThreadableLoader::start(const ResourceRequest& request)
86 { 87 {
87 ResourceRequest requestToPass(request); 88 ResourceRequest requestToPass(request);
88 if (!requestToPass.didSetHTTPReferrer()) 89 if (!requestToPass.didSetHTTPReferrer())
89 requestToPass.setHTTPReferrer(SecurityPolicy::generateReferrer(m_workerG lobalScope->getReferrerPolicy(), request.url(), m_workerGlobalScope->outgoingRef errer())); 90 requestToPass.setHTTPReferrer(SecurityPolicy::generateReferrer(m_workerG lobalScope->getReferrerPolicy(), request.url(), m_workerGlobalScope->outgoingRef errer()));
90 m_bridge->start(requestToPass, *m_workerGlobalScope); 91 m_bridge->start(requestToPass, *m_workerGlobalScope);
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 362
362 MutexLocker lock(m_lock); 363 MutexLocker lock(m_lock);
363 RELEASE_ASSERT(!m_done); 364 RELEASE_ASSERT(!m_done);
364 365
365 m_clientTasks.append(std::move(task)); 366 m_clientTasks.append(std::move(task));
366 m_done = true; 367 m_done = true;
367 m_loaderDoneEvent->signal(); 368 m_loaderDoneEvent->signal();
368 } 369 }
369 370
370 } // namespace blink 371 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698