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

Side by Side Diff: third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp

Issue 2567173002: Clean up Document::isSecureContext (Closed)
Patch Set: Created 4 years 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 * 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 WebString header; 137 WebString header;
138 WebContentSecurityPolicyType headerType = WebContentSecurityPolicyTypeReport; 138 WebContentSecurityPolicyType headerType = WebContentSecurityPolicyTypeReport;
139 139
140 if (headers->size() > 0) { 140 if (headers->size() > 0) {
141 header = (*headers)[0].first; 141 header = (*headers)[0].first;
142 headerType = 142 headerType =
143 static_cast<WebContentSecurityPolicyType>((*headers)[0].second); 143 static_cast<WebContentSecurityPolicyType>((*headers)[0].second);
144 } 144 }
145 145
146 WebWorkerCreationError creationError; 146 WebWorkerCreationError creationError;
147 String unusedSecureContextError; 147 bool isSecureContext = worker->getExecutionContext()->isSecureContext();
148 bool isSecureContext =
149 worker->getExecutionContext()->isSecureContext(unusedSecureContextError);
150 std::unique_ptr<WebSharedWorkerConnector> webWorkerConnector = 148 std::unique_ptr<WebSharedWorkerConnector> webWorkerConnector =
151 WTF::wrapUnique(m_client->createSharedWorkerConnector( 149 WTF::wrapUnique(m_client->createSharedWorkerConnector(
152 url, name, getId(document), header, headerType, 150 url, name, getId(document), header, headerType,
153 worker->getExecutionContext()->securityContext().addressSpace(), 151 worker->getExecutionContext()->securityContext().addressSpace(),
154 isSecureContext ? WebSharedWorkerCreationContextTypeSecure 152 isSecureContext ? WebSharedWorkerCreationContextTypeSecure
155 : WebSharedWorkerCreationContextTypeNonsecure, 153 : WebSharedWorkerCreationContextTypeNonsecure,
156 &creationError)); 154 &creationError));
157 if (creationError != WebWorkerCreationErrorNone) { 155 if (creationError != WebWorkerCreationErrorNone) {
158 if (creationError == WebWorkerCreationErrorURLMismatch) { 156 if (creationError == WebWorkerCreationErrorURLMismatch) {
159 // Existing worker does not match this url, so return an error back to the 157 // Existing worker does not match this url, so return an error back to the
(...skipping 26 matching lines...) Expand all
186 void SharedWorkerRepositoryClientImpl::documentDetached(Document* document) { 184 void SharedWorkerRepositoryClientImpl::documentDetached(Document* document) {
187 DCHECK(m_client); 185 DCHECK(m_client);
188 m_client->documentDetached(getId(document)); 186 m_client->documentDetached(getId(document));
189 } 187 }
190 188
191 SharedWorkerRepositoryClientImpl::SharedWorkerRepositoryClientImpl( 189 SharedWorkerRepositoryClientImpl::SharedWorkerRepositoryClientImpl(
192 WebSharedWorkerRepositoryClient* client) 190 WebSharedWorkerRepositoryClient* client)
193 : m_client(client) {} 191 : m_client(client) {}
194 192
195 } // namespace blink 193 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/vr/VRDisplay.cpp ('k') | third_party/WebKit/Source/web/WebDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698