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

Side by Side Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 6055002: Create a message filter for message port messages. This allows a nice cleanu... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "chrome/browser/renderer_host/browser_render_process_host.h" 8 #include "chrome/browser/renderer_host/browser_render_process_host.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
11 #include <limits> 11 #include <limits>
12 #include <vector> 12 #include <vector>
13 13
14 #if defined(OS_POSIX) 14 #if defined(OS_POSIX)
15 #include <utility> // for pair<> 15 #include <utility> // for pair<>
16 #endif 16 #endif
17 17
18 #include "app/app_switches.h" 18 #include "app/app_switches.h"
19 #include "base/callback.h"
19 #include "base/command_line.h" 20 #include "base/command_line.h"
20 #include "base/logging.h" 21 #include "base/logging.h"
21 #include "base/metrics/field_trial.h" 22 #include "base/metrics/field_trial.h"
22 #include "base/metrics/histogram.h" 23 #include "base/metrics/histogram.h"
23 #include "base/path_service.h" 24 #include "base/path_service.h"
24 #include "base/platform_file.h" 25 #include "base/platform_file.h"
25 #include "base/stl_util-inl.h" 26 #include "base/stl_util-inl.h"
26 #include "base/string_util.h" 27 #include "base/string_util.h"
27 #include "base/thread.h" 28 #include "base/thread.h"
28 #include "base/thread_restrictions.h" 29 #include "base/thread_restrictions.h"
(...skipping 30 matching lines...) Expand all
59 #include "chrome/browser/renderer_host/render_widget_host.h" 60 #include "chrome/browser/renderer_host/render_widget_host.h"
60 #include "chrome/browser/renderer_host/resource_message_filter.h" 61 #include "chrome/browser/renderer_host/resource_message_filter.h"
61 #include "chrome/browser/renderer_host/socket_stream_dispatcher_host.h" 62 #include "chrome/browser/renderer_host/socket_stream_dispatcher_host.h"
62 #include "chrome/browser/renderer_host/web_cache_manager.h" 63 #include "chrome/browser/renderer_host/web_cache_manager.h"
63 #include "chrome/browser/safe_browsing/client_side_detection_service.h" 64 #include "chrome/browser/safe_browsing/client_side_detection_service.h"
64 #include "chrome/browser/search_engines/search_provider_install_state_message_fi lter.h" 65 #include "chrome/browser/search_engines/search_provider_install_state_message_fi lter.h"
65 #include "chrome/browser/speech/speech_input_dispatcher_host.h" 66 #include "chrome/browser/speech/speech_input_dispatcher_host.h"
66 #include "chrome/browser/spellcheck_host.h" 67 #include "chrome/browser/spellcheck_host.h"
67 #include "chrome/browser/metrics/user_metrics.h" 68 #include "chrome/browser/metrics/user_metrics.h"
68 #include "chrome/browser/visitedlink/visitedlink_master.h" 69 #include "chrome/browser/visitedlink/visitedlink_master.h"
70 #include "chrome/browser/worker_host/worker_message_filter.h"
69 #include "chrome/common/chrome_paths.h" 71 #include "chrome/common/chrome_paths.h"
70 #include "chrome/common/chrome_switches.h" 72 #include "chrome/common/chrome_switches.h"
71 #include "chrome/common/child_process_info.h" 73 #include "chrome/common/child_process_info.h"
72 #include "chrome/common/extensions/extension.h" 74 #include "chrome/common/extensions/extension.h"
73 #include "chrome/common/extensions/extension_icon_set.h" 75 #include "chrome/common/extensions/extension_icon_set.h"
74 #include "chrome/common/gpu_messages.h" 76 #include "chrome/common/gpu_messages.h"
75 #include "chrome/common/logging_chrome.h" 77 #include "chrome/common/logging_chrome.h"
76 #include "chrome/common/net/url_request_context_getter.h" 78 #include "chrome/common/net/url_request_context_getter.h"
77 #include "chrome/common/notification_service.h" 79 #include "chrome/common/notification_service.h"
78 #include "chrome/common/pref_names.h" 80 #include "chrome/common/pref_names.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 new SearchProviderInstallStateMessageFilter(id(), profile())); 452 new SearchProviderInstallStateMessageFilter(id(), profile()));
451 channel_->AddFilter(new FileSystemDispatcherHost(profile())); 453 channel_->AddFilter(new FileSystemDispatcherHost(profile()));
452 channel_->AddFilter(new device_orientation::MessageFilter()); 454 channel_->AddFilter(new device_orientation::MessageFilter());
453 channel_->AddFilter( 455 channel_->AddFilter(
454 new BlobMessageFilter(id(), profile()->GetBlobStorageContext())); 456 new BlobMessageFilter(id(), profile()->GetBlobStorageContext()));
455 channel_->AddFilter(new FileUtilitiesMessageFilter(id())); 457 channel_->AddFilter(new FileUtilitiesMessageFilter(id()));
456 channel_->AddFilter(new MimeRegistryMessageFilter()); 458 channel_->AddFilter(new MimeRegistryMessageFilter());
457 channel_->AddFilter(new DatabaseMessageFilter( 459 channel_->AddFilter(new DatabaseMessageFilter(
458 profile()->GetDatabaseTracker(), profile()->GetHostContentSettingsMap())); 460 profile()->GetDatabaseTracker(), profile()->GetHostContentSettingsMap()));
459 channel_->AddFilter(new SocketStreamDispatcherHost()); 461 channel_->AddFilter(new SocketStreamDispatcherHost());
462 channel_->AddFilter(new WorkerMessageFilter(
463 id(),
464 profile()->GetRequestContext(),
465 g_browser_process->resource_dispatcher_host(),
466 NewCallbackWithReturnValue(
467 widget_helper_.get(), &RenderWidgetHelper::GetNextRoutingID)));
460 } 468 }
461 469
462 int BrowserRenderProcessHost::GetNextRoutingID() { 470 int BrowserRenderProcessHost::GetNextRoutingID() {
463 return widget_helper_->GetNextRoutingID(); 471 return widget_helper_->GetNextRoutingID();
464 } 472 }
465 473
466 void BrowserRenderProcessHost::CancelResourceRequests(int render_widget_id) { 474 void BrowserRenderProcessHost::CancelResourceRequests(int render_widget_id) {
467 widget_helper_->CancelResourceRequests(render_widget_id); 475 widget_helper_->CancelResourceRequests(render_widget_id);
468 } 476 }
469 477
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 IPC::PlatformFileForTransit file; 1292 IPC::PlatformFileForTransit file;
1285 #if defined(OS_POSIX) 1293 #if defined(OS_POSIX)
1286 file = base::FileDescriptor(model_file, false); 1294 file = base::FileDescriptor(model_file, false);
1287 #elif defined(OS_WIN) 1295 #elif defined(OS_WIN)
1288 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, 1296 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0,
1289 false, DUPLICATE_SAME_ACCESS); 1297 false, DUPLICATE_SAME_ACCESS);
1290 #endif 1298 #endif
1291 Send(new ViewMsg_SetPhishingModel(file)); 1299 Send(new ViewMsg_SetPhishingModel(file));
1292 } 1300 }
1293 } 1301 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698