OLD | NEW |
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 if (!m_proxy) | 68 if (!m_proxy) |
69 return true; | 69 return true; |
70 return m_proxy->allowIndexedDB(name); | 70 return m_proxy->allowIndexedDB(name); |
71 } | 71 } |
72 | 72 |
73 const char* WorkerPermissionClient::supplementName() | 73 const char* WorkerPermissionClient::supplementName() |
74 { | 74 { |
75 return "WorkerPermissionClient"; | 75 return "WorkerPermissionClient"; |
76 } | 76 } |
77 | 77 |
78 WorkerPermissionClient* WorkerPermissionClient::from(ExecutionContext* context) | 78 WorkerPermissionClient* WorkerPermissionClient::from(ExecutionContext& context) |
79 { | 79 { |
80 return static_cast<WorkerPermissionClient*>(Supplement<WorkerClients>::from(
toWorkerGlobalScope(context)->clients(), supplementName())); | 80 WorkerClients* clients = toWorkerGlobalScope(context).clients(); |
| 81 ASSERT(clients); |
| 82 return static_cast<WorkerPermissionClient*>(Supplement<WorkerClients>::from(
*clients, supplementName())); |
81 } | 83 } |
82 | 84 |
83 WorkerPermissionClient::WorkerPermissionClient(PassOwnPtr<WebWorkerPermissionCli
entProxy> proxy) | 85 WorkerPermissionClient::WorkerPermissionClient(PassOwnPtr<WebWorkerPermissionCli
entProxy> proxy) |
84 : m_proxy(proxy) | 86 : m_proxy(proxy) |
85 { | 87 { |
86 } | 88 } |
87 | 89 |
88 void providePermissionClientToWorker(WorkerClients* clients, PassOwnPtr<WebWorke
rPermissionClientProxy> proxy) | 90 void providePermissionClientToWorker(WorkerClients* clients, PassOwnPtr<WebWorke
rPermissionClientProxy> proxy) |
89 { | 91 { |
90 WorkerPermissionClient::provideTo(clients, WorkerPermissionClient::supplemen
tName(), WorkerPermissionClient::create(proxy)); | 92 ASSERT(clients); |
| 93 WorkerPermissionClient::provideTo(*clients, WorkerPermissionClient::suppleme
ntName(), WorkerPermissionClient::create(proxy)); |
91 } | 94 } |
92 | 95 |
93 } // namespace blink | 96 } // namespace blink |
OLD | NEW |