| 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/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "content/browser/media/media_web_contents_observer.h" | 66 #include "content/browser/media/media_web_contents_observer.h" |
| 67 #include "content/browser/media/session/media_session_impl.h" | 67 #include "content/browser/media/session/media_session_impl.h" |
| 68 #include "content/browser/plugin_content_origin_whitelist.h" | 68 #include "content/browser/plugin_content_origin_whitelist.h" |
| 69 #include "content/browser/renderer_host/render_process_host_impl.h" | 69 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 70 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 70 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 71 #include "content/browser/renderer_host/render_view_host_impl.h" | 71 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 72 #include "content/browser/renderer_host/render_widget_host_impl.h" | 72 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 73 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" | 73 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
| 74 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 74 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 75 #include "content/browser/renderer_host/text_input_manager.h" | 75 #include "content/browser/renderer_host/text_input_manager.h" |
| 76 #include "content/browser/resource_coordinator_web_contents_observer.h" |
| 76 #include "content/browser/screen_orientation/screen_orientation_provider.h" | 77 #include "content/browser/screen_orientation/screen_orientation_provider.h" |
| 77 #include "content/browser/site_instance_impl.h" | 78 #include "content/browser/site_instance_impl.h" |
| 78 #include "content/browser/web_contents/web_contents_view_child_frame.h" | 79 #include "content/browser/web_contents/web_contents_view_child_frame.h" |
| 79 #include "content/browser/web_contents/web_contents_view_guest.h" | 80 #include "content/browser/web_contents/web_contents_view_guest.h" |
| 80 #include "content/browser/webui/generic_handler.h" | 81 #include "content/browser/webui/generic_handler.h" |
| 81 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 82 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
| 82 #include "content/browser/webui/web_ui_impl.h" | 83 #include "content/browser/webui/web_ui_impl.h" |
| 83 #include "content/common/browser_plugin/browser_plugin_constants.h" | 84 #include "content/common/browser_plugin/browser_plugin_constants.h" |
| 84 #include "content/common/browser_plugin/browser_plugin_messages.h" | 85 #include "content/common/browser_plugin/browser_plugin_messages.h" |
| 85 #include "content/common/drag_messages.h" | 86 #include "content/common/drag_messages.h" |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); | 479 media_web_contents_observer_.reset(new MediaWebContentsObserver(this)); |
| 479 #endif | 480 #endif |
| 480 #if BUILDFLAG(ENABLE_PLUGINS) | 481 #if BUILDFLAG(ENABLE_PLUGINS) |
| 481 pepper_playback_observer_.reset(new PepperPlaybackObserver(this)); | 482 pepper_playback_observer_.reset(new PepperPlaybackObserver(this)); |
| 482 #endif | 483 #endif |
| 483 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this)); | 484 loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this)); |
| 484 wake_lock_service_context_.reset(new device::WakeLockServiceContext( | 485 wake_lock_service_context_.reset(new device::WakeLockServiceContext( |
| 485 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 486 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
| 486 base::Bind(&WebContentsImpl::GetNativeView, base::Unretained(this)))); | 487 base::Bind(&WebContentsImpl::GetNativeView, base::Unretained(this)))); |
| 487 host_zoom_map_observer_.reset(new HostZoomMapObserver(this)); | 488 host_zoom_map_observer_.reset(new HostZoomMapObserver(this)); |
| 489 // TODO(oysteine): Only do this for top-level tab WebContents. |
| 490 ResourceCoordinatorWebContentsObserver::CreateForWebContents(this); |
| 488 } | 491 } |
| 489 | 492 |
| 490 WebContentsImpl::~WebContentsImpl() { | 493 WebContentsImpl::~WebContentsImpl() { |
| 491 is_being_destroyed_ = true; | 494 is_being_destroyed_ = true; |
| 492 | 495 |
| 493 // A WebContents should never be deleted while it is notifying observers, | 496 // A WebContents should never be deleted while it is notifying observers, |
| 494 // since this will lead to a use-after-free as it continues to notfiy later | 497 // since this will lead to a use-after-free as it continues to notfiy later |
| 495 // observers. | 498 // observers. |
| 496 CHECK(!is_notifying_observers_); | 499 CHECK(!is_notifying_observers_); |
| 497 | 500 |
| (...skipping 4915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5413 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); | 5416 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); |
| 5414 if (!render_view_host) | 5417 if (!render_view_host) |
| 5415 continue; | 5418 continue; |
| 5416 render_view_host_set.insert(render_view_host); | 5419 render_view_host_set.insert(render_view_host); |
| 5417 } | 5420 } |
| 5418 for (RenderViewHost* render_view_host : render_view_host_set) | 5421 for (RenderViewHost* render_view_host : render_view_host_set) |
| 5419 render_view_host->OnWebkitPreferencesChanged(); | 5422 render_view_host->OnWebkitPreferencesChanged(); |
| 5420 } | 5423 } |
| 5421 | 5424 |
| 5422 } // namespace content | 5425 } // namespace content |
| OLD | NEW |