Chromium Code Reviews| Index: content/browser/loader/loader_io_thread_notifier_impl.h |
| diff --git a/content/browser/loader/loader_io_thread_notifier_impl.h b/content/browser/loader/loader_io_thread_notifier_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..64a5a5ed8ee2f2041d16b2dae4c5f0962eb31575 |
| --- /dev/null |
| +++ b/content/browser/loader/loader_io_thread_notifier_impl.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_LOADER_LOADER_IO_THREAD_NOTIFIER_IMPL_H_ |
| +#define CONTENT_BROWSER_LOADER_LOADER_IO_THREAD_NOTIFIER_IMPL_H_ |
| + |
| +#include "base/callback.h" |
| +#include "content/browser/frame_host/frame_tree.h" |
| +#include "content/browser/loader/global_routing_id.h" |
| +#include "content/public/browser/loader_io_thread_notifier.h" |
| +#include "content/public/browser/web_contents_observer.h" |
| + |
| +namespace content { |
| + |
| +class RenderFrameHost; |
| +class ResourceDispatcherHostImpl; |
| + |
| +// This class is responsible for notifying the IO thread (specifically, the |
| +// ResourceDispatcherHostImpl) of frame events. It has an interace for callers |
| +// to use and also sends notifications on WebContentsObserver events. All |
| +// methods (static or class) will be called from the UI thread and post to the |
| +// IO |
| +// thread. |
|
Randy Smith (Not in Mondays)
2016/01/06 21:56:30
nit: Remove unneeded newline?
Charlie Harrison
2016/01/07 22:47:05
Done.
|
| +// |
| +// TODO(csharrison): Add methods tracking visibility and audio changes, to |
| +// propogate to the ResourceScheduler. |
| +class LoaderIOThreadNotifierImpl : public LoaderIOThreadNotifier, |
| + public WebContentsObserver { |
| + public: |
| + explicit LoaderIOThreadNotifierImpl(WebContents* web_contents); |
| + ~LoaderIOThreadNotifierImpl() override; |
| + |
| + // Only use this method if the render frame host is not initialized yet or |
| + // inaccessible, but the route is known. Otherwise, use the methods that |
| + // explicitly take a RenderFrameHost*. |
|
Randy Smith (Not in Mondays)
2016/01/06 21:56:30
Hmmm. I find this comment a little confusing. Th
Charlie Harrison
2016/01/07 22:47:05
I was referring to the non-impl static methods. I'
|
| + static void ResumeBlockedRequestsForFrameInternal( |
| + const GlobalFrameRoutingId& routing_id); |
| + |
| + // This method notifies the RDHI concerning the status of an entire frame |
| + // tree. This will correspond to page-level events affecting resource loading. |
| + static void NotifyForEachFrame( |
| + FrameTree* frame_tree, |
| + base::Callback<void(ResourceDispatcherHostImpl*, |
| + const GlobalFrameRoutingId&)> frame_callback); |
| + |
| + // content::WebContentsObserver: |
| + void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_LOADER_LOADER_IO_THREAD_NOTIFIER_IMPL_H_ |