OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |