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 #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 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
429 renderer_accessibility_ = new RendererAccessibility(this); | 429 renderer_accessibility_ = new RendererAccessibility(this); |
430 | 430 |
431 new IdleUserDetector(this); | 431 new IdleUserDetector(this); |
432 | 432 |
433 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 433 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
434 if (command_line.HasSwitch(switches::kEnableMediaStream)) { | 434 if (command_line.HasSwitch(switches::kEnableMediaStream)) { |
435 media_stream_impl_ = new MediaStreamImpl( | 435 media_stream_impl_ = new MediaStreamImpl( |
436 RenderThreadImpl::current()->video_capture_impl_manager()); | 436 RenderThreadImpl::current()->video_capture_impl_manager()); |
437 } | 437 } |
438 | 438 |
439 AddObserver(&pepper_delegate_); | |
jam
2011/12/05 19:26:36
nit: here and below, in general we try to avoid Re
Dmitry Polukhin
2011/12/05 19:53:51
Changing members order is not very reliable becaus
| |
440 | |
439 content::GetContentClient()->renderer()->RenderViewCreated(this); | 441 content::GetContentClient()->renderer()->RenderViewCreated(this); |
440 } | 442 } |
441 | 443 |
442 RenderViewImpl::~RenderViewImpl() { | 444 RenderViewImpl::~RenderViewImpl() { |
445 RemoveObserver(&pepper_delegate_); | |
443 history_page_ids_.clear(); | 446 history_page_ids_.clear(); |
444 | 447 |
445 if (decrement_shared_popup_at_destruction_) | 448 if (decrement_shared_popup_at_destruction_) |
446 shared_popup_counter_->data--; | 449 shared_popup_counter_->data--; |
447 | 450 |
448 // If file chooser is still waiting for answer, dispatch empty answer. | 451 // If file chooser is still waiting for answer, dispatch empty answer. |
449 while (!file_chooser_completions_.empty()) { | 452 while (!file_chooser_completions_.empty()) { |
450 if (file_chooser_completions_.front()->completion) { | 453 if (file_chooser_completions_.front()->completion) { |
451 file_chooser_completions_.front()->completion->didChooseFile( | 454 file_chooser_completions_.front()->completion->didChooseFile( |
452 WebVector<WebString>()); | 455 WebVector<WebString>()); |
(...skipping 4336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4789 return !!RenderThreadImpl::current()->compositor_thread(); | 4792 return !!RenderThreadImpl::current()->compositor_thread(); |
4790 } | 4793 } |
4791 | 4794 |
4792 void RenderViewImpl::OnJavaBridgeInit( | 4795 void RenderViewImpl::OnJavaBridgeInit( |
4793 const IPC::ChannelHandle& channel_handle) { | 4796 const IPC::ChannelHandle& channel_handle) { |
4794 DCHECK(!java_bridge_dispatcher_.get()); | 4797 DCHECK(!java_bridge_dispatcher_.get()); |
4795 #if defined(ENABLE_JAVA_BRIDGE) | 4798 #if defined(ENABLE_JAVA_BRIDGE) |
4796 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4799 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
4797 #endif | 4800 #endif |
4798 } | 4801 } |
OLD | NEW |