Chromium Code Reviews| Index: content/browser/loader/loader_io_thread_notifier.h |
| diff --git a/content/browser/loader/loader_io_thread_notifier.h b/content/browser/loader/loader_io_thread_notifier.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..920795510fc00d698c75b51ddf8d850fd498f0da |
| --- /dev/null |
| +++ b/content/browser/loader/loader_io_thread_notifier.h |
| @@ -0,0 +1,39 @@ |
| +// 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_WEB_CONTENTS_OBSERVER_H_ |
| +#define CONTENT_BROWSER_LOADER_LOADER_WEB_CONTENTS_OBSERVER_H_ |
| + |
| +#include "base/callback.h" |
| +#include "content/browser/frame_host/frame_tree.h" |
| +#include "content/public/browser/web_contents_observer.h" |
| + |
| +namespace content { |
| + |
| +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. |
| +// |
| +// TODO(csharrison): Add methods tracking visibility and audio changes, to |
| +// propogate to the ResourceScheduler. |
| +class LoaderIOThreadNotifer : public WebContentsObserver { |
|
Randy Smith (Not in Mondays)
2015/12/29 23:11:37
A comment specifying the thread behavior of the cl
Charlie Harrison
2015/12/30 20:51:49
Done.
|
| + public: |
| + explicit LoaderIOThreadNotifer(WebContents* web_contents); |
| + |
| + // 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 NotifyForEachFrameOnIO( |
| + FrameTree* frame_tree, |
| + base::Callback<void(ResourceDispatcherHostImpl*, int, int)> |
| + frame_callback); |
| + |
| + // content::WebContentsObserver: |
| + void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_LOADER_LOADER_WEB_CONTENTS_OBSERVER_H_ |