summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-20 00:56:25 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-20 00:56:25 +0000
commitd717e03b637b8bd133db3fde5f3108b999a51a88 (patch)
treeaca70991012a49441d24bbd201d894903ba05416 /base
parent5fe524efcaf51b401067d936b5ff331249dc99df (diff)
downloadchromium_src-d717e03b637b8bd133db3fde5f3108b999a51a88.zip
chromium_src-d717e03b637b8bd133db3fde5f3108b999a51a88.tar.gz
chromium_src-d717e03b637b8bd133db3fde5f3108b999a51a88.tar.bz2
GPU plugin forwards repaint events to Pepper plugin.
WM_PAINT results in a call to Pepper repaint callback. Implemented WM_ERASEBKGND to prevent flickering on repaint. Implemented PGL_NO_CONTEXT (copied from EGL spec). This is already reviewed by alokp but unfortunately got entangled with this CL. TEST=none BUG=none Review URL: http://codereview.chromium.org/571018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39530 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/base.gypi1
-rw-r--r--base/scoped_open_process.h49
2 files changed, 50 insertions, 0 deletions
diff --git a/base/base.gypi b/base/base.gypi
index 66094b9d..0c9de8c 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -178,6 +178,7 @@
'scoped_nsautorelease_pool.mm',
'scoped_nsdisable_screen_updates.h',
'scoped_nsobject.h',
+ 'scoped_open_process.h',
'scoped_ptr.h',
'scoped_temp_dir.cc',
'scoped_temp_dir.h',
diff --git a/base/scoped_open_process.h b/base/scoped_open_process.h
new file mode 100644
index 0000000..9badc76
--- /dev/null
+++ b/base/scoped_open_process.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2010 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 BASE_SCOPED_OPEN_PROCESS_H_
+#define BASE_SCOPED_OPEN_PROCESS_H_
+
+#include "base/process.h"
+#include "base/process_util.h"
+
+namespace base {
+
+// A class that opens a process from its process id and closes it when the
+// instance goes out of scope.
+class ScopedOpenProcess {
+ public:
+ ScopedOpenProcess() : handle_(kNullProcessHandle) {
+ }
+
+ // Automatically close the process.
+ ~ScopedOpenProcess() {
+ Close();
+ }
+
+ // Open a new process by pid. Closes any previously opened process (even if
+ // opening the new one fails).
+ bool Open(ProcessId pid) {
+ Close();
+ return OpenProcessHandle(pid, &handle_);
+ }
+
+ // Close the previously opened process.
+ void Close() {
+ if (handle_ == kNullProcessHandle)
+ return;
+
+ CloseProcessHandle(handle_);
+ handle_ = kNullProcessHandle;
+ }
+
+ ProcessHandle handle() const { return handle_; }
+
+ private:
+ ProcessHandle handle_;
+ DISALLOW_COPY_AND_ASSIGN(ScopedOpenProcess);
+};
+} // namespace base
+
+#endif // BASE_SCOPED_OPEN_PROCESS_H_