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

Side by Side Diff: Source/core/workers/SharedWorker.cpp

Issue 111373003: Migrate bindings constructors to the new ExceptionState model. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Ugh. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/workers/AbstractWorker.cpp ('k') | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 RefPtr<MessageChannel> channel = MessageChannel::create(context); 64 RefPtr<MessageChannel> channel = MessageChannel::create(context);
65 worker->m_port = channel->port1(); 65 worker->m_port = channel->port1();
66 OwnPtr<blink::WebMessagePortChannel> remotePort = channel->port2()->disentan gle(); 66 OwnPtr<blink::WebMessagePortChannel> remotePort = channel->port2()->disentan gle();
67 ASSERT(remotePort); 67 ASSERT(remotePort);
68 68
69 worker->suspendIfNeeded(); 69 worker->suspendIfNeeded();
70 70
71 // We don't currently support nested workers, so workers can only be created from documents. 71 // We don't currently support nested workers, so workers can only be created from documents.
72 Document* document = toDocument(context); 72 Document* document = toDocument(context);
73 if (!document->securityOrigin()->canAccessSharedWorkers()) { 73 if (!document->securityOrigin()->canAccessSharedWorkers()) {
74 exceptionState.throwSecurityError("Failed to create 'SharedWorker': acce ss to shared workers is denied to origin '" + document->securityOrigin()->toStri ng() + "'."); 74 exceptionState.throwSecurityError("Access to shared workers is denied to origin '" + document->securityOrigin()->toString() + "'.");
75 return 0; 75 return 0;
76 } 76 }
77 77
78 KURL scriptURL = worker->resolveURL(url, exceptionState); 78 KURL scriptURL = worker->resolveURL(url, exceptionState);
79 if (scriptURL.isEmpty()) 79 if (scriptURL.isEmpty())
80 return 0; 80 return 0;
81 81
82 if (document->page() && document->page()->sharedWorkerRepositoryClient()) 82 if (document->page() && document->page()->sharedWorkerRepositoryClient())
83 document->page()->sharedWorkerRepositoryClient()->connect(worker.get(), remotePort.release(), scriptURL, name, exceptionState); 83 document->page()->sharedWorkerRepositoryClient()->connect(worker.get(), remotePort.release(), scriptURL, name, exceptionState);
84 84
(...skipping 13 matching lines...) Expand all
98 { 98 {
99 setPendingActivity(this); 99 setPendingActivity(this);
100 } 100 }
101 101
102 void SharedWorker::unsetPreventGC() 102 void SharedWorker::unsetPreventGC()
103 { 103 {
104 unsetPendingActivity(this); 104 unsetPendingActivity(this);
105 } 105 }
106 106
107 } // namespace WebCore 107 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/workers/AbstractWorker.cpp ('k') | Source/modules/webaudio/AudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698