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

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

Issue 520213002: Make SecurityContext available in RemoteFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase 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 | « Source/core/dom/RemoteSecurityContext.h ('k') | Source/core/frame/Frame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/dom/RemoteSecurityContext.h"
7
8 #include "core/frame/csp/ContentSecurityPolicy.h"
9 #include "platform/weborigin/SecurityOrigin.h"
10
11 namespace blink {
12
13 RemoteSecurityContext::RemoteSecurityContext()
14 : SecurityContext()
15 {
16 // RemoteSecurityContext's origin is expected to stay uninitialized until
17 // we set it using replicated origin data from the browser process.
18 ASSERT(!haveInitializedSecurityOrigin());
19
20 // CSP will not be replicated for RemoteSecurityContexts, as it is moving
21 // to the browser process. For now, initialize CSP to a default
22 // locked-down policy.
23 setContentSecurityPolicy(ContentSecurityPolicy::create());
24
25 // FIXME: Document::initSecurityContext has a few other things we may
26 // eventually want here, such as enforcing a setting to
27 // grantUniversalAccess().
28 }
29
30 PassRefPtr<RemoteSecurityContext> RemoteSecurityContext::create()
31 {
32 return adoptRef(new RemoteSecurityContext());
33 }
34
35 void RemoteSecurityContext::setReplicatedOrigin(PassRefPtr<SecurityOrigin> origi n)
36 {
37 // FIXME: Currently, replicated security origins are passed only at
38 // RemoteFrame creation time. Eventually, this class will also need to
39 // handle origin updates to handle cases like setting document.domain, but
40 // for now, check that this is the first and only time we are setting the
41 // origin.
42 ASSERT(!haveInitializedSecurityOrigin());
43 setSecurityOrigin(origin);
44 }
45
46
47 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/RemoteSecurityContext.h ('k') | Source/core/frame/Frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698