| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 namespace blink { | 54 namespace blink { |
| 55 | 55 |
| 56 // Callback class that keeps the SharedWorker and WebSharedWorker objects alive
while connecting. | 56 // Callback class that keeps the SharedWorker and WebSharedWorker objects alive
while connecting. |
| 57 class SharedWorkerConnector : private WebSharedWorkerConnector::ConnectListener
{ | 57 class SharedWorkerConnector : private WebSharedWorkerConnector::ConnectListener
{ |
| 58 public: | 58 public: |
| 59 SharedWorkerConnector(SharedWorker* worker, const KURL& url, const String& n
ame, PassOwnPtr<WebMessagePortChannel> channel, PassOwnPtr<WebSharedWorkerConnec
tor> webWorkerConnector) | 59 SharedWorkerConnector(SharedWorker* worker, const KURL& url, const String& n
ame, PassOwnPtr<WebMessagePortChannel> channel, PassOwnPtr<WebSharedWorkerConnec
tor> webWorkerConnector) |
| 60 : m_worker(worker) | 60 : m_worker(worker) |
| 61 , m_url(url) | 61 , m_url(url) |
| 62 , m_name(name) | 62 , m_name(name) |
| 63 , m_webWorkerConnector(webWorkerConnector) | 63 , m_webWorkerConnector(std::move(webWorkerConnector)) |
| 64 , m_channel(channel) { } | 64 , m_channel(std::move(channel)) { } |
| 65 | 65 |
| 66 virtual ~SharedWorkerConnector(); | 66 virtual ~SharedWorkerConnector(); |
| 67 void connect(); | 67 void connect(); |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 // WebSharedWorkerConnector::ConnectListener overrides. | 70 // WebSharedWorkerConnector::ConnectListener overrides. |
| 71 void connected() override; | 71 void connected() override; |
| 72 void scriptLoadFailed() override; | 72 void scriptLoadFailed() override; |
| 73 | 73 |
| 74 Persistent<SharedWorker> m_worker; | 74 Persistent<SharedWorker> m_worker; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 if (isSecureContext) { | 142 if (isSecureContext) { |
| 143 UseCounter::count(document, UseCounter::NonSecureSharedWorkerAcc
essedFromSecureContext); | 143 UseCounter::count(document, UseCounter::NonSecureSharedWorkerAcc
essedFromSecureContext); |
| 144 } else { | 144 } else { |
| 145 UseCounter::count(document, UseCounter::SecureSharedWorkerAccess
edFromNonSecureContext); | 145 UseCounter::count(document, UseCounter::SecureSharedWorkerAccess
edFromNonSecureContext); |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 // The connector object manages its own lifecycle (and the lifecycles of the
two worker objects). | 150 // The connector object manages its own lifecycle (and the lifecycles of the
two worker objects). |
| 151 // It will free itself once connecting is completed. | 151 // It will free itself once connecting is completed. |
| 152 SharedWorkerConnector* connector = new SharedWorkerConnector(worker, url, na
me, port, webWorkerConnector.release()); | 152 SharedWorkerConnector* connector = new SharedWorkerConnector(worker, url, na
me, std::move(port), webWorkerConnector.release()); |
| 153 connector->connect(); | 153 connector->connect(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void SharedWorkerRepositoryClientImpl::documentDetached(Document* document) | 156 void SharedWorkerRepositoryClientImpl::documentDetached(Document* document) |
| 157 { | 157 { |
| 158 DCHECK(m_client); | 158 DCHECK(m_client); |
| 159 m_client->documentDetached(getId(document)); | 159 m_client->documentDetached(getId(document)); |
| 160 } | 160 } |
| 161 | 161 |
| 162 SharedWorkerRepositoryClientImpl::SharedWorkerRepositoryClientImpl(WebSharedWork
erRepositoryClient* client) | 162 SharedWorkerRepositoryClientImpl::SharedWorkerRepositoryClientImpl(WebSharedWork
erRepositoryClient* client) |
| 163 : m_client(client) | 163 : m_client(client) |
| 164 { | 164 { |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace blink | 167 } // namespace blink |
| OLD | NEW |