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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1908 if (!context) | 1908 if (!context) |
1909 return NULL; | 1909 return NULL; |
1910 | 1910 |
1911 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1911 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
1912 if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) { | 1912 if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) { |
1913 // In the absence of a software-based delegating renderer, use this | 1913 // In the absence of a software-based delegating renderer, use this |
1914 // stopgap adapter class to present the software renderer output using a | 1914 // stopgap adapter class to present the software renderer output using a |
1915 // 3d context. | 1915 // 3d context. |
1916 return new CompositorOutputSurface(routing_id(), NULL, | 1916 return new CompositorOutputSurface(routing_id(), NULL, |
1917 new CompositorSoftwareOutputDeviceGLAdapter(context)); | 1917 new CompositorSoftwareOutputDeviceGLAdapter(context)); |
1918 } else | 1918 } else { |
1919 return new CompositorOutputSurface(routing_id(), context, NULL); | 1919 return new CompositorOutputSurface(routing_id(), context, NULL); |
| 1920 } |
1920 } | 1921 } |
1921 | 1922 |
1922 void RenderViewImpl::didAddMessageToConsole( | 1923 void RenderViewImpl::didAddMessageToConsole( |
1923 const WebConsoleMessage& message, const WebString& source_name, | 1924 const WebConsoleMessage& message, const WebString& source_name, |
1924 unsigned source_line) { | 1925 unsigned source_line) { |
1925 logging::LogSeverity log_severity = logging::LOG_VERBOSE; | 1926 logging::LogSeverity log_severity = logging::LOG_VERBOSE; |
1926 switch (message.level) { | 1927 switch (message.level) { |
1927 case WebConsoleMessage::LevelTip: | 1928 case WebConsoleMessage::LevelTip: |
1928 log_severity = logging::LOG_VERBOSE; | 1929 log_severity = logging::LOG_VERBOSE; |
1929 break; | 1930 break; |
(...skipping 2332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4262 if (source_view) | 4263 if (source_view) |
4263 params.source_routing_id = source_view->routing_id(); | 4264 params.source_routing_id = source_view->routing_id(); |
4264 params.source_frame_id = sourceFrame->identifier(); | 4265 params.source_frame_id = sourceFrame->identifier(); |
4265 | 4266 |
4266 // Include the process, route, and frame IDs of the target frame. This allows | 4267 // Include the process, route, and frame IDs of the target frame. This allows |
4267 // the browser to detect races between this message being sent and the target | 4268 // the browser to detect races between this message being sent and the target |
4268 // frame no longer being valid. | 4269 // frame no longer being valid. |
4269 params.target_process_id = target_process_id_; | 4270 params.target_process_id = target_process_id_; |
4270 params.target_routing_id = target_routing_id_; | 4271 params.target_routing_id = target_routing_id_; |
4271 | 4272 |
4272 std::map<int,int>::iterator it = active_frame_id_map_.find( | 4273 std::map<int, int>::iterator it = active_frame_id_map_.find( |
4273 targetFrame->identifier()); | 4274 targetFrame->identifier()); |
4274 if (it != active_frame_id_map_.end()) { | 4275 if (it != active_frame_id_map_.end()) { |
4275 params.target_frame_id = it->second; | 4276 params.target_frame_id = it->second; |
4276 } else { | 4277 } else { |
4277 params.target_frame_id = 0; | 4278 params.target_frame_id = 0; |
4278 } | 4279 } |
4279 | 4280 |
4280 Send(new ViewHostMsg_RouteMessageEvent(routing_id_, params)); | 4281 Send(new ViewHostMsg_RouteMessageEvent(routing_id_, params)); |
4281 return true; | 4282 return true; |
4282 } | 4283 } |
(...skipping 2222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6505 } | 6506 } |
6506 #endif | 6507 #endif |
6507 | 6508 |
6508 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6509 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
6509 TransportDIB::Handle dib_handle) { | 6510 TransportDIB::Handle dib_handle) { |
6510 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6511 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
6511 RenderProcess::current()->ReleaseTransportDIB(dib); | 6512 RenderProcess::current()->ReleaseTransportDIB(dib); |
6512 } | 6513 } |
6513 | 6514 |
6514 } // namespace content | 6515 } // namespace content |
OLD | NEW |