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

Side by Side Diff: content/browser/worker_host/worker_process_host.cc

Issue 8919017: Split UserMetrics into API vs. implementation. Move API to content/public. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Version for commit (merged again). Created 9 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 | « content/browser/user_metrics.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 8 #include <vector>
9 9
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/message_loop.h" 15 #include "base/message_loop.h"
16 #include "base/string_util.h" 16 #include "base/string_util.h"
17 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
18 #include "content/browser/appcache/appcache_dispatcher_host.h" 18 #include "content/browser/appcache/appcache_dispatcher_host.h"
19 #include "content/browser/child_process_security_policy.h" 19 #include "content/browser/child_process_security_policy.h"
20 #include "content/browser/debugger/worker_devtools_message_filter.h" 20 #include "content/browser/debugger/worker_devtools_message_filter.h"
21 #include "content/browser/file_system/file_system_dispatcher_host.h" 21 #include "content/browser/file_system/file_system_dispatcher_host.h"
22 #include "content/browser/mime_registry_message_filter.h" 22 #include "content/browser/mime_registry_message_filter.h"
23 #include "content/browser/renderer_host/blob_message_filter.h" 23 #include "content/browser/renderer_host/blob_message_filter.h"
24 #include "content/browser/renderer_host/database_message_filter.h" 24 #include "content/browser/renderer_host/database_message_filter.h"
25 #include "content/browser/renderer_host/file_utilities_message_filter.h" 25 #include "content/browser/renderer_host/file_utilities_message_filter.h"
26 #include "content/browser/renderer_host/render_view_host.h" 26 #include "content/browser/renderer_host/render_view_host.h"
27 #include "content/browser/renderer_host/render_view_host_delegate.h" 27 #include "content/browser/renderer_host/render_view_host_delegate.h"
28 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h" 28 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h"
29 #include "content/browser/resource_context.h" 29 #include "content/browser/resource_context.h"
30 #include "content/browser/user_metrics.h"
31 #include "content/browser/worker_host/message_port_service.h" 30 #include "content/browser/worker_host/message_port_service.h"
32 #include "content/browser/worker_host/worker_message_filter.h" 31 #include "content/browser/worker_host/worker_message_filter.h"
33 #include "content/browser/worker_host/worker_service.h" 32 #include "content/browser/worker_host/worker_service.h"
34 #include "content/common/child_process_host_impl.h" 33 #include "content/common/child_process_host_impl.h"
35 #include "content/common/debug_flags.h" 34 #include "content/common/debug_flags.h"
36 #include "content/common/view_messages.h" 35 #include "content/common/view_messages.h"
37 #include "content/common/worker_messages.h" 36 #include "content/common/worker_messages.h"
38 #include "content/public/browser/browser_thread.h" 37 #include "content/public/browser/browser_thread.h"
39 #include "content/public/browser/content_browser_client.h" 38 #include "content/public/browser/content_browser_client.h"
39 #include "content/public/browser/user_metrics.h"
40 #include "content/public/common/content_switches.h" 40 #include "content/public/common/content_switches.h"
41 #include "content/public/common/result_codes.h" 41 #include "content/public/common/result_codes.h"
42 #include "ipc/ipc_switches.h" 42 #include "ipc/ipc_switches.h"
43 #include "net/base/mime_util.h" 43 #include "net/base/mime_util.h"
44 #include "net/base/registry_controlled_domain.h" 44 #include "net/base/registry_controlled_domain.h"
45 #include "ui/base/ui_base_switches.h" 45 #include "ui/base/ui_base_switches.h"
46 #include "webkit/fileapi/file_system_context.h" 46 #include "webkit/fileapi/file_system_context.h"
47 #include "webkit/fileapi/file_system_path_manager.h" 47 #include "webkit/fileapi/file_system_path_manager.h"
48 #include "webkit/fileapi/sandbox_mount_point_provider.h" 48 #include "webkit/fileapi/sandbox_mount_point_provider.h"
49 #include "webkit/glue/resource_type.h" 49 #include "webkit/glue/resource_type.h"
50 50
51 using content::BrowserThread; 51 using content::BrowserThread;
52 using content::ChildProcessHost; 52 using content::ChildProcessHost;
53 using content::UserMetricsAction;
53 54
54 namespace { 55 namespace {
55 56
56 // Helper class that we pass to SocketStreamDispatcherHost so that it can find 57 // Helper class that we pass to SocketStreamDispatcherHost so that it can find
57 // the right net::URLRequestContext for a request. 58 // the right net::URLRequestContext for a request.
58 class URLRequestContextSelector 59 class URLRequestContextSelector
59 : public ResourceMessageFilter::URLRequestContextSelector { 60 : public ResourceMessageFilter::URLRequestContextSelector {
60 public: 61 public:
61 explicit URLRequestContextSelector( 62 explicit URLRequestContextSelector(
62 net::URLRequestContext* url_request_context) 63 net::URLRequestContext* url_request_context)
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 IPC_BEGIN_MESSAGE_MAP_EX(WorkerProcessHost, message, msg_is_ok) 314 IPC_BEGIN_MESSAGE_MAP_EX(WorkerProcessHost, message, msg_is_ok)
314 IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerContextClosed, 315 IPC_MESSAGE_HANDLER(WorkerHostMsg_WorkerContextClosed,
315 OnWorkerContextClosed) 316 OnWorkerContextClosed)
316 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowDatabase, OnAllowDatabase) 317 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowDatabase, OnAllowDatabase)
317 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowFileSystem, OnAllowFileSystem) 318 IPC_MESSAGE_HANDLER(WorkerProcessHostMsg_AllowFileSystem, OnAllowFileSystem)
318 IPC_MESSAGE_UNHANDLED(handled = false) 319 IPC_MESSAGE_UNHANDLED(handled = false)
319 IPC_END_MESSAGE_MAP_EX() 320 IPC_END_MESSAGE_MAP_EX()
320 321
321 if (!msg_is_ok) { 322 if (!msg_is_ok) {
322 NOTREACHED(); 323 NOTREACHED();
323 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_WPH")); 324 content::RecordAction(UserMetricsAction("BadMessageTerminate_WPH"));
324 base::KillProcess(handle(), content::RESULT_CODE_KILLED_BAD_MESSAGE, false); 325 base::KillProcess(handle(), content::RESULT_CODE_KILLED_BAD_MESSAGE, false);
325 } 326 }
326 327
327 if (handled) 328 if (handled)
328 return true; 329 return true;
329 330
330 if (message.type() == WorkerHostMsg_WorkerContextDestroyed::ID) { 331 if (message.type() == WorkerHostMsg_WorkerContextDestroyed::ID) {
331 WorkerService::GetInstance()->NotifyWorkerDestroyed(this, 332 WorkerService::GetInstance()->NotifyWorkerDestroyed(this,
332 message.routing_id()); 333 message.routing_id());
333 } 334 }
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 } 628 }
628 } 629 }
629 return false; 630 return false;
630 } 631 }
631 632
632 WorkerProcessHost::WorkerInstance::FilterInfo 633 WorkerProcessHost::WorkerInstance::FilterInfo
633 WorkerProcessHost::WorkerInstance::GetFilter() const { 634 WorkerProcessHost::WorkerInstance::GetFilter() const {
634 DCHECK(NumFilters() == 1); 635 DCHECK(NumFilters() == 1);
635 return *filters_.begin(); 636 return *filters_.begin();
636 } 637 }
OLDNEW
« no previous file with comments | « content/browser/user_metrics.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698