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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 647853002: Create a proprietary scheme for loading web-accessible resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update include guards too Created 6 years, 1 month 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 | « content/public/common/url_constants.cc ('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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 message_loop()->AddTaskObserver(memory_observer_.get()); 977 message_loop()->AddTaskObserver(memory_observer_.get());
978 } 978 }
979 } 979 }
980 980
981 void RenderThreadImpl::RegisterSchemes() { 981 void RenderThreadImpl::RegisterSchemes() {
982 // swappedout: pages should not be accessible, and should also 982 // swappedout: pages should not be accessible, and should also
983 // be treated as empty documents that can commit synchronously. 983 // be treated as empty documents that can commit synchronously.
984 WebString swappedout_scheme(base::ASCIIToUTF16(kSwappedOutScheme)); 984 WebString swappedout_scheme(base::ASCIIToUTF16(kSwappedOutScheme));
985 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(swappedout_scheme); 985 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(swappedout_scheme);
986 WebSecurityPolicy::registerURLSchemeAsEmptyDocument(swappedout_scheme); 986 WebSecurityPolicy::registerURLSchemeAsEmptyDocument(swappedout_scheme);
987
988 // This scheme serves resources that may be injected into the
989 // web page (e.g. by Blink). This isn't mixed content, and
990 // content security policy doesn't apply.
991 WebString resource_scheme(base::ASCIIToUTF16(kResourceScheme));
992 WebSecurityPolicy::registerURLSchemeAsSecure(resource_scheme);
993 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy(
994 resource_scheme, static_cast<WebSecurityPolicy::PolicyAreas>(
995 WebSecurityPolicy::PolicyAreaImage |
996 WebSecurityPolicy::PolicyAreaStyle));
987 } 997 }
988 998
989 void RenderThreadImpl::NotifyTimezoneChange() { 999 void RenderThreadImpl::NotifyTimezoneChange() {
990 NotifyTimezoneChangeOnThisThread(); 1000 NotifyTimezoneChangeOnThisThread();
991 RenderThread::Get()->PostTaskToAllWebWorkers( 1001 RenderThread::Get()->PostTaskToAllWebWorkers(
992 base::Bind(&NotifyTimezoneChangeOnThisThread)); 1002 base::Bind(&NotifyTimezoneChangeOnThisThread));
993 } 1003 }
994 1004
995 void RenderThreadImpl::RecordAction(const base::UserMetricsAction& action) { 1005 void RenderThreadImpl::RecordAction(const base::UserMetricsAction& action) {
996 Send(new ViewHostMsg_UserMetricsRecordAction(action.str_)); 1006 Send(new ViewHostMsg_UserMetricsRecordAction(action.str_));
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
1626 hidden_widget_count_--; 1636 hidden_widget_count_--;
1627 1637
1628 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1638 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1629 return; 1639 return;
1630 } 1640 }
1631 1641
1632 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1642 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1633 } 1643 }
1634 1644
1635 } // namespace content 1645 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/url_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698