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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerGlobalScope.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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 return m_messageStorage.get(); 352 return m_messageStorage.get();
353 } 353 }
354 354
355 void WorkerGlobalScope::exceptionHandled(int exceptionId, bool isHandled) 355 void WorkerGlobalScope::exceptionHandled(int exceptionId, bool isHandled)
356 { 356 {
357 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = m_pendingMessages.take(e xceptionId); 357 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = m_pendingMessages.take(e xceptionId);
358 if (!isHandled) 358 if (!isHandled)
359 addConsoleMessage(consoleMessage.release()); 359 addConsoleMessage(consoleMessage.release());
360 } 360 }
361 361
362 bool WorkerGlobalScope::isPrivilegedContext(String& errorMessage, const Privileg eContextCheck privilegeContextCheck) const 362 bool WorkerGlobalScope::isSecureContext(String& errorMessage, const SecureContex tCheck privilegeContextCheck) const
363 { 363 {
364 // Until there are APIs that are available in workers and that 364 // Until there are APIs that are available in workers and that
365 // require a privileged context test that checks ancestors, just do 365 // require a privileged context test that checks ancestors, just do
366 // a simple check here. Once we have a need for a real 366 // a simple check here. Once we have a need for a real
367 // |isPrivilegedContext| check here, we can check the responsible 367 // |isSecureContext| check here, we can check the responsible
368 // document for a privileged context at worker creation time, pass 368 // document for a privileged context at worker creation time, pass
369 // it in via WorkerThreadStartupData, and check it here. 369 // it in via WorkerThreadStartupData, and check it here.
370 return securityOrigin()->isPotentiallyTrustworthy(errorMessage); 370 return securityOrigin()->isPotentiallyTrustworthy(errorMessage);
371 } 371 }
372 372
373 void WorkerGlobalScope::removeURLFromMemoryCache(const KURL& url) 373 void WorkerGlobalScope::removeURLFromMemoryCache(const KURL& url)
374 { 374 {
375 m_thread->workerLoaderProxy()->postTaskToLoader(createCrossThreadTask(&Worke rGlobalScope::removeURLFromMemoryCacheInternal, url)); 375 m_thread->workerLoaderProxy()->postTaskToLoader(createCrossThreadTask(&Worke rGlobalScope::removeURLFromMemoryCacheInternal, url));
376 } 376 }
377 377
(...skipping 30 matching lines...) Expand all
408 visitor->trace(m_messageStorage); 408 visitor->trace(m_messageStorage);
409 visitor->trace(m_pendingMessages); 409 visitor->trace(m_pendingMessages);
410 HeapSupplementable<WorkerGlobalScope>::trace(visitor); 410 HeapSupplementable<WorkerGlobalScope>::trace(visitor);
411 #endif 411 #endif
412 ExecutionContext::trace(visitor); 412 ExecutionContext::trace(visitor);
413 EventTargetWithInlineData::trace(visitor); 413 EventTargetWithInlineData::trace(visitor);
414 SecurityContext::trace(visitor); 414 SecurityContext::trace(visitor);
415 } 415 }
416 416
417 } // namespace blink 417 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerGlobalScope.h ('k') | third_party/WebKit/Source/modules/bluetooth/Bluetooth.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698