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

Side by Side Diff: third_party/WebKit/Source/modules/notifications/Notification.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) 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return nullptr; 84 return nullptr;
85 } 85 }
86 86
87 if (!options.actions().isEmpty()) { 87 if (!options.actions().isEmpty()) {
88 exceptionState.throwTypeError( 88 exceptionState.throwTypeError(
89 "Actions are only supported for persistent notifications shown using " 89 "Actions are only supported for persistent notifications shown using "
90 "ServiceWorkerRegistration.showNotification()."); 90 "ServiceWorkerRegistration.showNotification().");
91 return nullptr; 91 return nullptr;
92 } 92 }
93 93
94 String insecureOriginMessage; 94 if (context->isSecureContext()) {
95 if (context->isSecureContext(insecureOriginMessage)) {
96 UseCounter::count(context, UseCounter::NotificationSecureOrigin); 95 UseCounter::count(context, UseCounter::NotificationSecureOrigin);
97 if (context->isDocument()) 96 if (context->isDocument())
98 UseCounter::countCrossOriginIframe( 97 UseCounter::countCrossOriginIframe(
99 *toDocument(context), UseCounter::NotificationAPISecureOriginIframe); 98 *toDocument(context), UseCounter::NotificationAPISecureOriginIframe);
100 } else { 99 } else {
101 UseCounter::count(context, UseCounter::NotificationInsecureOrigin); 100 UseCounter::count(context, UseCounter::NotificationInsecureOrigin);
102 if (context->isDocument()) 101 if (context->isDocument())
103 UseCounter::countCrossOriginIframe( 102 UseCounter::countCrossOriginIframe(
104 *toDocument(context), 103 *toDocument(context),
105 UseCounter::NotificationAPIInsecureOriginIframe); 104 UseCounter::NotificationAPIInsecureOriginIframe);
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 } 400 }
402 401
403 DEFINE_TRACE(Notification) { 402 DEFINE_TRACE(Notification) {
404 visitor->trace(m_prepareShowMethodRunner); 403 visitor->trace(m_prepareShowMethodRunner);
405 visitor->trace(m_loader); 404 visitor->trace(m_loader);
406 EventTargetWithInlineData::trace(visitor); 405 EventTargetWithInlineData::trace(visitor);
407 SuspendableObject::trace(visitor); 406 SuspendableObject::trace(visitor);
408 } 407 }
409 408
410 } // namespace blink 409 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698