Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1586)

Unified Diff: content/browser/renderer_host/media/web_contents_tracker.h

Issue 172003004: Fixit: Move tab and desktop capture code to new location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/web_contents_tracker.h
diff --git a/content/browser/renderer_host/media/web_contents_tracker.h b/content/browser/renderer_host/media/web_contents_tracker.h
deleted file mode 100644
index 632ced28be7a2e532c4676c292c2702313efba67..0000000000000000000000000000000000000000
--- a/content/browser/renderer_host/media/web_contents_tracker.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2013 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.
-//
-// Given a starting render_process_id and render_view_id, the WebContentsTracker
-// tracks RenderViewHost instance swapping during the lifetime of a WebContents
-// instance. This is used when mirroring tab video and audio so that user
-// navigations, crashes, etc., during a tab's lifetime allow the capturing code
-// to remain active on the current/latest RenderView.
-//
-// Threading issues: Start(), Stop() and the ChangeCallback are invoked on the
-// same thread. This can be any thread, and the decision is locked-in by
-// WebContentsTracker when Start() is called.
-
-#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEB_CONTENTS_TRACKER_H_
-#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEB_CONTENTS_TRACKER_H_
-
-#include "base/callback.h"
-#include "base/memory/ref_counted.h"
-#include "content/common/content_export.h"
-#include "content/public/browser/web_contents_observer.h"
-
-namespace base {
-class MessageLoopProxy;
-}
-
-namespace content {
-
-class CONTENT_EXPORT WebContentsTracker
- : public base::RefCountedThreadSafe<WebContentsTracker>,
- public WebContentsObserver {
- public:
- WebContentsTracker();
-
- // Callback for whenever the target is swapped. The callback is also invoked
- // with both arguments set to MSG_ROUTING_NONE to indicate tracking will not
- // continue (i.e., the WebContents instance was not found or has been
- // destroyed).
- typedef base::Callback<void(int render_process_id, int render_view_id)>
- ChangeCallback;
-
- // Start tracking. The last-known |render_process_id| and |render_view_id|
- // are provided, and the given callback is invoked asynchronously one or more
- // times. The callback will be invoked on the same thread calling Start().
- virtual void Start(int render_process_id, int render_view_id,
- const ChangeCallback& callback);
-
- // Stop tracking. Once this method returns, the callback is guaranteed not to
- // be invoked again.
- virtual void Stop();
-
- protected:
- friend class base::RefCountedThreadSafe<WebContentsTracker>;
- virtual ~WebContentsTracker();
-
- private:
- // Reads the render_process_id/render_view_id from the current WebContents
- // instance and then invokes the callback.
- void OnWebContentsChangeEvent();
-
- // Called on the thread that Start()/Stop() are called on, check whether the
- // callback is still valid and, if so, invoke it.
- void MaybeDoCallback(int render_process_id, int render_view_id);
-
- // Look-up the current WebContents instance associated with the given
- // |render_process_id| and |render_view_id| and begin observing it.
- void LookUpAndObserveWebContents(int render_process_id,
- int render_view_id);
-
- // WebContentsObserver overrides to react to events of interest.
- virtual void RenderViewReady() OVERRIDE;
- virtual void AboutToNavigateRenderView(RenderViewHost* render_view_host)
- OVERRIDE;
- virtual void DidNavigateMainFrame(const LoadCommittedDetails& details,
- const FrameNavigateParams& params) OVERRIDE;
- virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE;
-
- scoped_refptr<base::MessageLoopProxy> message_loop_;
- ChangeCallback callback_;
-
- DISALLOW_COPY_AND_ASSIGN(WebContentsTracker);
-};
-
-} // namespace content
-
-#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_WEB_CONTENTS_TRACKER_H_

Powered by Google App Engine
This is Rietveld 408576698