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

Unified Diff: media/video/capture/screen/shared_buffer.h

Issue 12047101: Move screen capturers from remoting/capturer to media/video/capturer/screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« no previous file with comments | « media/video/capture/screen/screen_capturer_win.cc ('k') | media/video/capture/screen/shared_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/screen/shared_buffer.h
diff --git a/remoting/capturer/shared_buffer.h b/media/video/capture/screen/shared_buffer.h
similarity index 83%
rename from remoting/capturer/shared_buffer.h
rename to media/video/capture/screen/shared_buffer.h
index 16429b9fa19c3216c2eadc1cc1825dd0cdf673b4..4c77b6a0ef4505ca27832559935101f009db0f1f 100644
--- a/remoting/capturer/shared_buffer.h
+++ b/media/video/capture/screen/shared_buffer.h
@@ -2,20 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_CAPTURER_SHARED_BUFFER_H_
-#define REMOTING_CAPTURER_SHARED_BUFFER_H_
+#ifndef MEDIA_VIDEO_CAPTURE_SCREEN_SHARED_BUFFER_H_
+#define MEDIA_VIDEO_CAPTURE_SCREEN_SHARED_BUFFER_H_
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/process.h"
#include "base/shared_memory.h"
+#include "media/base/media_export.h"
-namespace remoting {
+namespace media {
// Represents a memory buffer that can be shared between multiple processes.
// It is more or less a convenience wrapper around base::SharedMemory providing
// ref-counted lifetime management and unique buffer identifiers.
-class SharedBuffer
+class MEDIA_EXPORT SharedBuffer
: public base::RefCountedThreadSafe<SharedBuffer> {
public:
// Creates a new shared memory buffer of the given size and maps it to
@@ -43,6 +44,11 @@ class SharedBuffer
// data buffer.
base::SharedMemoryHandle handle() const { return shared_memory_.handle(); }
+ // Calls SharedMemory::ShareToProcess to share the handle with a different
+ // process.
+ bool ShareToProcess(base::ProcessHandle process,
+ base::SharedMemoryHandle* new_handle);
+
int id() const { return id_; }
uint32 size() const { return size_; }
@@ -64,6 +70,6 @@ class SharedBuffer
DISALLOW_COPY_AND_ASSIGN(SharedBuffer);
};
-} // namespace remoting
+} // namespace media
-#endif // REMOTING_CAPTURER_SHARED_BUFFER_H_
+#endif // MEDIA_VIDEO_CAPTURE_SCREEN_SHARED_BUFFER_H_
« no previous file with comments | « media/video/capture/screen/screen_capturer_win.cc ('k') | media/video/capture/screen/shared_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698