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

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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 461
460 SocketStreamDispatcherHost* socket_stream_dispatcher_host = 462 SocketStreamDispatcherHost* socket_stream_dispatcher_host =
461 new SocketStreamDispatcherHost(); 463 new SocketStreamDispatcherHost();
462 socket_stream_dispatcher_host->set_url_request_context_override( 464 socket_stream_dispatcher_host->set_url_request_context_override(
463 url_request_context_override); 465 url_request_context_override);
464 channel_->AddFilter(socket_stream_dispatcher_host); 466 channel_->AddFilter(socket_stream_dispatcher_host);
467
468 channel_->AddFilter(new WorkerMessageFilter(
469 id(),
470 profile()->GetRequestContext(),
471 g_browser_process->resource_dispatcher_host(),
472 NewCallbackWithReturnValue(
473 widget_helper_.get(), &RenderWidgetHelper::GetNextRoutingID)));
465 } 474 }
466 475
467 int BrowserRenderProcessHost::GetNextRoutingID() { 476 int BrowserRenderProcessHost::GetNextRoutingID() {
468 return widget_helper_->GetNextRoutingID(); 477 return widget_helper_->GetNextRoutingID();
469 } 478 }
470 479
471 void BrowserRenderProcessHost::CancelResourceRequests(int render_widget_id) { 480 void BrowserRenderProcessHost::CancelResourceRequests(int render_widget_id) {
472 widget_helper_->CancelResourceRequests(render_widget_id); 481 widget_helper_->CancelResourceRequests(render_widget_id);
473 } 482 }
474 483
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 IPC::PlatformFileForTransit file; 1298 IPC::PlatformFileForTransit file;
1290 #if defined(OS_POSIX) 1299 #if defined(OS_POSIX)
1291 file = base::FileDescriptor(model_file, false); 1300 file = base::FileDescriptor(model_file, false);
1292 #elif defined(OS_WIN) 1301 #elif defined(OS_WIN)
1293 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, 1302 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0,
1294 false, DUPLICATE_SAME_ACCESS); 1303 false, DUPLICATE_SAME_ACCESS);
1295 #endif 1304 #endif
1296 Send(new ViewMsg_SetPhishingModel(file)); 1305 Send(new ViewMsg_SetPhishingModel(file));
1297 } 1306 }
1298 } 1307 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698