Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 // 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> |
| (...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 915 // On OSX, the browser allocates all DIBs and keeps a file descriptor around | 915 // On OSX, the browser allocates all DIBs and keeps a file descriptor around |
| 916 // for each. | 916 // for each. |
| 917 return widget_helper_->MapTransportDIB(dib_id); | 917 return widget_helper_->MapTransportDIB(dib_id); |
| 918 #elif defined(OS_POSIX) | 918 #elif defined(OS_POSIX) |
| 919 return TransportDIB::Map(dib_id); | 919 return TransportDIB::Map(dib_id); |
| 920 #endif // defined(OS_POSIX) | 920 #endif // defined(OS_POSIX) |
| 921 } | 921 } |
| 922 | 922 |
| 923 TransportDIB* BrowserRenderProcessHost::GetTransportDIB( | 923 TransportDIB* BrowserRenderProcessHost::GetTransportDIB( |
| 924 TransportDIB::Id dib_id) { | 924 TransportDIB::Id dib_id) { |
| 925 if (dib_id == TransportDIB::InvalidId()) | |
|
brettw
2011/03/17 03:31:00
We should be sure to comment the valid cases where
| |
| 926 return NULL; | |
| 927 | |
| 925 const std::map<TransportDIB::Id, TransportDIB*>::iterator | 928 const std::map<TransportDIB::Id, TransportDIB*>::iterator |
| 926 i = cached_dibs_.find(dib_id); | 929 i = cached_dibs_.find(dib_id); |
| 927 if (i != cached_dibs_.end()) { | 930 if (i != cached_dibs_.end()) { |
| 928 cached_dibs_cleaner_.Reset(); | 931 cached_dibs_cleaner_.Reset(); |
| 929 return i->second; | 932 return i->second; |
| 930 } | 933 } |
| 931 | 934 |
| 932 TransportDIB* dib = MapTransportDIB(dib_id); | 935 TransportDIB* dib = MapTransportDIB(dib_id); |
| 933 if (!dib) | 936 if (!dib) |
| 934 return NULL; | 937 return NULL; |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1300 IPC::PlatformFileForTransit file; | 1303 IPC::PlatformFileForTransit file; |
| 1301 #if defined(OS_POSIX) | 1304 #if defined(OS_POSIX) |
| 1302 file = base::FileDescriptor(model_file, false); | 1305 file = base::FileDescriptor(model_file, false); |
| 1303 #elif defined(OS_WIN) | 1306 #elif defined(OS_WIN) |
| 1304 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, | 1307 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, |
| 1305 false, DUPLICATE_SAME_ACCESS); | 1308 false, DUPLICATE_SAME_ACCESS); |
| 1306 #endif | 1309 #endif |
| 1307 Send(new ViewMsg_SetPhishingModel(file)); | 1310 Send(new ViewMsg_SetPhishingModel(file)); |
| 1308 } | 1311 } |
| 1309 } | 1312 } |
| OLD | NEW |