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

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

Issue 874833003: [ServiceWorker] Block all mixed-content requests from a ServiceWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 | « LayoutTests/http/tests/serviceworker/fetch-mixed-content-to-inscope-expected.txt ('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) 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() 297 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader()
298 { 298 {
299 // Create 'shadow page', which is never displayed and is used mainly to 299 // Create 'shadow page', which is never displayed and is used mainly to
300 // provide a context for loading on the main thread. 300 // provide a context for loading on the main thread.
301 // 301 //
302 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader. 302 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader.
303 // This code, and probably most of the code in this class should be shared 303 // This code, and probably most of the code in this class should be shared
304 // with SharedWorker. 304 // with SharedWorker.
305 ASSERT(!m_webView); 305 ASSERT(!m_webView);
306 m_webView = WebView::create(0); 306 m_webView = WebView::create(0);
307 WebSettings* settings = m_webView->settings();
307 // FIXME: http://crbug.com/363843. This needs to find a better way to 308 // FIXME: http://crbug.com/363843. This needs to find a better way to
308 // not create graphics layers. 309 // not create graphics layers.
309 m_webView->settings()->setAcceleratedCompositingEnabled(false); 310 settings->setAcceleratedCompositingEnabled(false);
311 // Currently we block all mixed-content requests from a ServiceWorker.
312 // FIXME: When we support FetchEvent.default(), we should relax this
313 // restriction.
314 settings->setStrictMixedContentChecking(true);
Mike West 2015/01/26 10:04:53 This settings object only takes effect for this wo
horo 2015/01/26 11:17:14 Yes. This WebView is only used for the resource lo
315 settings->setAllowDisplayOfInsecureContent(false);
316 settings->setAllowRunningOfInsecureContent(false);
Mike West 2015/01/26 10:04:53 Setting strict mode will stop notifications up to
horo 2015/01/26 11:17:14 We discussed with rsleevi@ and decided to block al
310 m_mainFrame = WebLocalFrame::create(this); 317 m_mainFrame = WebLocalFrame::create(this);
311 m_webView->setMainFrame(m_mainFrame); 318 m_webView->setMainFrame(m_mainFrame);
312 m_webView->setDevToolsAgentClient(this); 319 m_webView->setDevToolsAgentClient(this);
313 320
314 // If we were asked to wait for debugger then it is the good time to do that . 321 // If we were asked to wait for debugger then it is the good time to do that .
315 // However if we are updating service worker version (m_pauseAfterDownloadSt ate is set) 322 // However if we are updating service worker version (m_pauseAfterDownloadSt ate is set)
316 // Then we need to load the worker script to check the version, so in this c ase we wait for debugger 323 // Then we need to load the worker script to check the version, so in this c ase we wait for debugger
317 // later in ::resumeAfterDownload(). 324 // later in ::resumeAfterDownload().
318 if (m_pauseAfterDownloadState != DoPauseAfterDownload) { 325 if (m_pauseAfterDownloadState != DoPauseAfterDownload) {
319 m_workerContextClient->workerReadyForInspection(); 326 m_workerContextClient->workerReadyForInspection();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 m_mainScriptLoader.clear(); 441 m_mainScriptLoader.clear();
435 442
436 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); 443 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient);
437 m_loaderProxy = LoaderProxy::create(*this); 444 m_loaderProxy = LoaderProxy::create(*this);
438 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); 445 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release());
439 m_workerThread->start(); 446 m_workerThread->start();
440 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); 447 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL);
441 } 448 }
442 449
443 } // namespace blink 450 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/serviceworker/fetch-mixed-content-to-inscope-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698