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

Side by Side Diff: third_party/WebKit/Source/web/WebDocument.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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 WebURL WebDocument::url() const { 72 WebURL WebDocument::url() const {
73 return constUnwrap<Document>()->url(); 73 return constUnwrap<Document>()->url();
74 } 74 }
75 75
76 WebSecurityOrigin WebDocument::getSecurityOrigin() const { 76 WebSecurityOrigin WebDocument::getSecurityOrigin() const {
77 if (!constUnwrap<Document>()) 77 if (!constUnwrap<Document>())
78 return WebSecurityOrigin(); 78 return WebSecurityOrigin();
79 return WebSecurityOrigin(constUnwrap<Document>()->getSecurityOrigin()); 79 return WebSecurityOrigin(constUnwrap<Document>()->getSecurityOrigin());
80 } 80 }
81 81
82 bool WebDocument::isSecureContext(WebString& errorMessage) const { 82 bool WebDocument::isSecureContext() const {
83 const Document* document = constUnwrap<Document>(); 83 const Document* document = constUnwrap<Document>();
84 if (!document) 84 return document && document->isSecureContext();
85 return false;
86 String message;
87 bool result = document->isSecureContext(message);
88 errorMessage = message;
89 return result;
90 } 85 }
91 86
92 WebString WebDocument::encoding() const { 87 WebString WebDocument::encoding() const {
93 return constUnwrap<Document>()->encodingName(); 88 return constUnwrap<Document>()->encodingName();
94 } 89 }
95 90
96 WebString WebDocument::contentLanguage() const { 91 WebString WebDocument::contentLanguage() const {
97 return constUnwrap<Document>()->contentLanguage(); 92 return constUnwrap<Document>()->contentLanguage();
98 } 93 }
99 94
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 WebDocument& WebDocument::operator=(Document* elem) { 296 WebDocument& WebDocument::operator=(Document* elem) {
302 m_private = elem; 297 m_private = elem;
303 return *this; 298 return *this;
304 } 299 }
305 300
306 WebDocument::operator Document*() const { 301 WebDocument::operator Document*() const {
307 return toDocument(m_private.get()); 302 return toDocument(m_private.get());
308 } 303 }
309 304
310 } // namespace blink 305 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/SharedWorkerRepositoryClientImpl.cpp ('k') | third_party/WebKit/public/web/WebDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698