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

Side by Side Diff: third_party/WebKit/Source/modules/notifications/Notification.cpp

Issue 1373773003: Implement 'window.isSecureContext'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: document. Created 5 years, 2 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
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return nullptr; 73 return nullptr;
74 } 74 }
75 75
76 // The Web Notification constructor may not be used in Service Worker contex ts. 76 // The Web Notification constructor may not be used in Service Worker contex ts.
77 if (context->isServiceWorkerGlobalScope()) { 77 if (context->isServiceWorkerGlobalScope()) {
78 exceptionState.throwTypeError("Illegal constructor."); 78 exceptionState.throwTypeError("Illegal constructor.");
79 return nullptr; 79 return nullptr;
80 } 80 }
81 81
82 String insecureOriginMessage; 82 String insecureOriginMessage;
83 UseCounter::Feature feature = context->isPrivilegedContext(insecureOriginMes sage) 83 UseCounter::Feature feature = context->isSecureContext(insecureOriginMessage )
84 ? UseCounter::NotificationSecureOrigin 84 ? UseCounter::NotificationSecureOrigin
85 : UseCounter::NotificationInsecureOrigin; 85 : UseCounter::NotificationInsecureOrigin;
86 86
87 UseCounter::count(context, feature); 87 UseCounter::count(context, feature);
88 88
89 WebNotificationData data = createWebNotificationData(context, title, options , exceptionState); 89 WebNotificationData data = createWebNotificationData(context, title, options , exceptionState);
90 if (exceptionState.hadException()) 90 if (exceptionState.hadException())
91 return nullptr; 91 return nullptr;
92 92
93 Notification* notification = new Notification(context, data); 93 Notification* notification = new Notification(context, data);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 return m_state == NotificationStateShowing || m_asyncRunner.isActive(); 358 return m_state == NotificationStateShowing || m_asyncRunner.isActive();
359 } 359 }
360 360
361 DEFINE_TRACE(Notification) 361 DEFINE_TRACE(Notification)
362 { 362 {
363 RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(vis itor); 363 RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(vis itor);
364 ActiveDOMObject::trace(visitor); 364 ActiveDOMObject::trace(visitor);
365 } 365 }
366 366
367 } // namespace blink 367 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698