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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 1109633002: Basic experimental suborigin CSP directive and SecurityOrigin mods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on ToT Created 5 years, 6 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 | « Source/core/dom/Document.h ('k') | Source/core/dom/ExecutionContext.h » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 5567 matching lines...) Expand 10 before | Expand all | Expand 10 after
5578 { 5578 {
5579 V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType, wrapper ); 5579 V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType, wrapper );
5580 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate); 5580 DOMWrapperWorld& world = DOMWrapperWorld::current(isolate);
5581 if (world.isMainWorld() && frame()) 5581 if (world.isMainWorld() && frame())
5582 frame()->script().windowProxy(world)->updateDocumentWrapper(wrapper); 5582 frame()->script().windowProxy(world)->updateDocumentWrapper(wrapper);
5583 return wrapper; 5583 return wrapper;
5584 } 5584 }
5585 5585
5586 bool Document::isPrivilegedContext(String& errorMessage, const PrivilegeContextC heck privilegeContextCheck) const 5586 bool Document::isPrivilegedContext(String& errorMessage, const PrivilegeContextC heck privilegeContextCheck) const
5587 { 5587 {
5588 if (securityContext().isSandboxed(SandboxOrigin)) { 5588 if (SecurityContext::isSandboxed(SandboxOrigin)) {
5589 if (!SecurityOrigin::create(url())->isPotentiallyTrustworthy(errorMessag e)) 5589 if (!SecurityOrigin::create(url())->isPotentiallyTrustworthy(errorMessag e))
5590 return false; 5590 return false;
5591 } else { 5591 } else {
5592 if (!securityOrigin()->isPotentiallyTrustworthy(errorMessage)) 5592 if (!securityOrigin()->isPotentiallyTrustworthy(errorMessage))
5593 return false; 5593 return false;
5594 } 5594 }
5595 5595
5596 if (privilegeContextCheck == StandardPrivilegeCheck) { 5596 if (privilegeContextCheck == StandardPrivilegeCheck) {
5597 Document* context = parentDocument(); 5597 Document* context = parentDocument();
5598 while (context) { 5598 while (context) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
5681 #ifndef NDEBUG 5681 #ifndef NDEBUG
5682 using namespace blink; 5682 using namespace blink;
5683 void showLiveDocumentInstances() 5683 void showLiveDocumentInstances()
5684 { 5684 {
5685 WeakDocumentSet& set = liveDocumentSet(); 5685 WeakDocumentSet& set = liveDocumentSet();
5686 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5686 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5687 for (Document* document : set) 5687 for (Document* document : set)
5688 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5688 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5689 } 5689 }
5690 #endif 5690 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/ExecutionContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698