| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/worker_host/worker_process_host.h" | 5 #include "content/browser/worker_host/worker_process_host.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 OnWorkerContextClosed) | 380 OnWorkerContextClosed) |
| 381 IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerContextDestroyed, | 381 IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerContextDestroyed, |
| 382 OnWorkerContextDestroyed) | 382 OnWorkerContextDestroyed) |
| 383 IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerScriptLoaded, | 383 IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerScriptLoaded, |
| 384 OnWorkerScriptLoaded) | 384 OnWorkerScriptLoaded) |
| 385 IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerScriptLoadFailed, | 385 IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerScriptLoadFailed, |
| 386 OnWorkerScriptLoadFailed) | 386 OnWorkerScriptLoadFailed) |
| 387 IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerConnected, | 387 IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerConnected, |
| 388 OnWorkerConnected) | 388 OnWorkerConnected) |
| 389 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowDatabase, OnAllowDatabase) | 389 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowDatabase, OnAllowDatabase) |
| 390 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowFileSystem, OnAllowFileSystem) | 390 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_RequestFileSystemAccessSync, |
| 391 OnRequestFileSystemAccessSync) |
| 391 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowIndexedDB, OnAllowIndexedDB) | 392 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowIndexedDB, OnAllowIndexedDB) |
| 392 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_ForceKillWorker, | 393 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_ForceKillWorker, |
| 393 OnForceKillWorkerProcess) | 394 OnForceKillWorkerProcess) |
| 394 IPC_MESSAGE_UNHANDLED(handled = false) | 395 IPC_MESSAGE_UNHANDLED(handled = false) |
| 395 IPC_END_MESSAGE_MAP_EX() | 396 IPC_END_MESSAGE_MAP_EX() |
| 396 | 397 |
| 397 if (!msg_is_ok) { | 398 if (!msg_is_ok) { |
| 398 NOTREACHED(); | 399 NOTREACHED(); |
| 399 RecordAction(base::UserMetricsAction("BadMessageTerminate_WPH")); | 400 RecordAction(base::UserMetricsAction("BadMessageTerminate_WPH")); |
| 400 base::KillProcess( | 401 base::KillProcess( |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 const GURL& url, | 474 const GURL& url, |
| 474 const base::string16& name, | 475 const base::string16& name, |
| 475 const base::string16& display_name, | 476 const base::string16& display_name, |
| 476 unsigned long estimated_size, | 477 unsigned long estimated_size, |
| 477 bool* result) { | 478 bool* result) { |
| 478 *result = GetContentClient()->browser()->AllowWorkerDatabase( | 479 *result = GetContentClient()->browser()->AllowWorkerDatabase( |
| 479 url, name, display_name, estimated_size, resource_context_, | 480 url, name, display_name, estimated_size, resource_context_, |
| 480 GetRenderFrameIDsForWorker(worker_route_id)); | 481 GetRenderFrameIDsForWorker(worker_route_id)); |
| 481 } | 482 } |
| 482 | 483 |
| 483 void WorkerProcessHost::OnAllowFileSystem(int worker_route_id, | 484 void WorkerProcessHost::OnRequestFileSystemAccessSync(int worker_route_id, |
| 484 const GURL& url, | 485 const GURL& url, |
| 485 bool* result) { | 486 bool* result) { |
| 486 *result = GetContentClient()->browser()->AllowWorkerFileSystem( | 487 *result = GetContentClient()->browser()->AllowWorkerFileSystem( |
| 487 url, resource_context_, GetRenderFrameIDsForWorker(worker_route_id)); | 488 url, resource_context_, GetRenderFrameIDsForWorker(worker_route_id)); |
| 488 } | 489 } |
| 489 | 490 |
| 490 void WorkerProcessHost::OnAllowIndexedDB(int worker_route_id, | 491 void WorkerProcessHost::OnAllowIndexedDB(int worker_route_id, |
| 491 const GURL& url, | 492 const GURL& url, |
| 492 const base::string16& name, | 493 const base::string16& name, |
| 493 bool* result) { | 494 bool* result) { |
| 494 *result = GetContentClient()->browser()->AllowWorkerIndexedDB( | 495 *result = GetContentClient()->browser()->AllowWorkerIndexedDB( |
| 495 url, name, resource_context_, | 496 url, name, resource_context_, |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 return false; | 829 return false; |
| 829 } | 830 } |
| 830 | 831 |
| 831 WorkerProcessHost::WorkerInstance::FilterInfo | 832 WorkerProcessHost::WorkerInstance::FilterInfo |
| 832 WorkerProcessHost::WorkerInstance::GetFilter() const { | 833 WorkerProcessHost::WorkerInstance::GetFilter() const { |
| 833 DCHECK(NumFilters() == 1); | 834 DCHECK(NumFilters() == 1); |
| 834 return *filters_.begin(); | 835 return *filters_.begin(); |
| 835 } | 836 } |
| 836 | 837 |
| 837 } // namespace content | 838 } // namespace content |
| OLD | NEW |