OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2010 Apple 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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 worker->suspendIfNeeded(); | 66 worker->suspendIfNeeded(); |
67 | 67 |
68 KURL scriptURL = worker->resolveURL(url, ec); | 68 KURL scriptURL = worker->resolveURL(url, ec); |
69 if (scriptURL.isEmpty()) | 69 if (scriptURL.isEmpty()) |
70 return 0; | 70 return 0; |
71 | 71 |
72 // We don't currently support nested workers, so workers can only be created
from documents. | 72 // We don't currently support nested workers, so workers can only be created
from documents. |
73 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument()); | 73 ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument()); |
74 Document* document = toDocument(context); | 74 Document* document = toDocument(context); |
75 if (!document->securityOrigin()->canAccessSharedWorkers(document->topOrigin(
))) { | 75 if (!document->securityOrigin()->canAccessSharedWorkers(document->topOrigin(
))) { |
76 ec = SECURITY_ERR; | 76 ec = SecurityError; |
77 return 0; | 77 return 0; |
78 } | 78 } |
79 | 79 |
80 SharedWorkerRepository::connect(worker.get(), remotePort.release(), scriptUR
L, name, ec); | 80 SharedWorkerRepository::connect(worker.get(), remotePort.release(), scriptUR
L, name, ec); |
81 | 81 |
82 return worker.release(); | 82 return worker.release(); |
83 } | 83 } |
84 | 84 |
85 SharedWorker::~SharedWorker() | 85 SharedWorker::~SharedWorker() |
86 { | 86 { |
87 } | 87 } |
88 | 88 |
89 const AtomicString& SharedWorker::interfaceName() const | 89 const AtomicString& SharedWorker::interfaceName() const |
90 { | 90 { |
91 return eventNames().interfaceForSharedWorker; | 91 return eventNames().interfaceForSharedWorker; |
92 } | 92 } |
93 | 93 |
94 } // namespace WebCore | 94 } // namespace WebCore |
OLD | NEW |