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

Side by Side Diff: third_party/WebKit/Source/core/workers/SharedWorker.cpp

Issue 2056183002: Implement the `require-sri-for` CSP directive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated tests 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2010 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 worker->suspendIfNeeded(); 70 worker->suspendIfNeeded();
71 71
72 // We don't currently support nested workers, so workers can only be created from documents. 72 // We don't currently support nested workers, so workers can only be created from documents.
73 Document* document = toDocument(context); 73 Document* document = toDocument(context);
74 if (!document->getSecurityOrigin()->canAccessSharedWorkers()) { 74 if (!document->getSecurityOrigin()->canAccessSharedWorkers()) {
75 exceptionState.throwSecurityError("Access to shared workers is denied to origin '" + document->getSecurityOrigin()->toString() + "'."); 75 exceptionState.throwSecurityError("Access to shared workers is denied to origin '" + document->getSecurityOrigin()->toString() + "'.");
76 return nullptr; 76 return nullptr;
77 } 77 }
78 78
79 KURL scriptURL = worker->resolveURL(url, exceptionState); 79 KURL scriptURL = worker->resolveURL(url, exceptionState, WebURLRequest::Requ estContextSharedWorker);
80 if (scriptURL.isEmpty()) 80 if (scriptURL.isEmpty())
81 return nullptr; 81 return nullptr;
82 82
83 if (document->frame()->loader().client()->sharedWorkerRepositoryClient()) 83 if (document->frame()->loader().client()->sharedWorkerRepositoryClient())
84 document->frame()->loader().client()->sharedWorkerRepositoryClient()->co nnect(worker, std::move(remotePort), scriptURL, name, exceptionState); 84 document->frame()->loader().client()->sharedWorkerRepositoryClient()->co nnect(worker, std::move(remotePort), scriptURL, name, exceptionState);
85 85
86 return worker; 86 return worker;
87 } 87 }
88 88
89 SharedWorker::~SharedWorker() 89 SharedWorker::~SharedWorker()
(...skipping 11 matching lines...) Expand all
101 } 101 }
102 102
103 DEFINE_TRACE(SharedWorker) 103 DEFINE_TRACE(SharedWorker)
104 { 104 {
105 visitor->trace(m_port); 105 visitor->trace(m_port);
106 AbstractWorker::trace(visitor); 106 AbstractWorker::trace(visitor);
107 Supplementable<SharedWorker>::trace(visitor); 107 Supplementable<SharedWorker>::trace(visitor);
108 } 108 }
109 109
110 } // namespace blink 110 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698