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

Side by Side Diff: mojo/public/python/src/common.h

Issue 796373006: Content handler for python. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « mojo/public/python/rules.gni ('k') | mojo/public/python/src/common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_PYTHON_SRC_COMMON_H_ 5 #ifndef MOJO_PUBLIC_PYTHON_SRC_COMMON_H_
6 #define MOJO_PUBLIC_PYTHON_SRC_COMMON_H_ 6 #define MOJO_PUBLIC_PYTHON_SRC_COMMON_H_
7 7
8 #include <Python.h> 8 #include <Python.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 22 matching lines...) Expand all
33 kAcquire, 33 kAcquire,
34 }; 34 };
35 35
36 class ScopedPyRef { 36 class ScopedPyRef {
37 public: 37 public:
38 explicit ScopedPyRef(PyObject* object); 38 explicit ScopedPyRef(PyObject* object);
39 ScopedPyRef(PyObject* object, ScopedPyRefAcquire); 39 ScopedPyRef(PyObject* object, ScopedPyRefAcquire);
40 40
41 ~ScopedPyRef(); 41 ~ScopedPyRef();
42 42
43 // Releases ownership of the python object contained by this instance.
44 PyObject* Release();
45
43 operator PyObject*() const; 46 operator PyObject*() const;
44 47
45 private: 48 private:
46 PyObject* object_; 49 PyObject* object_;
47 50
48 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedPyRef); 51 MOJO_DISALLOW_COPY_AND_ASSIGN(ScopedPyRef);
49 }; 52 };
50 53
51 54
52 class PythonClosure : public mojo::Closure::Runnable { 55 class PythonClosure : public mojo::Closure::Runnable {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 const mojo::Closure quit_; 97 const mojo::Closure quit_;
95 98
96 MOJO_DISALLOW_COPY_AND_ASSIGN(PythonAsyncWaiter); 99 MOJO_DISALLOW_COPY_AND_ASSIGN(PythonAsyncWaiter);
97 }; 100 };
98 101
99 } // namespace python 102 } // namespace python
100 } // namespace mojo 103 } // namespace mojo
101 104
102 #endif // MOJO_PUBLIC_PYTHON_SRC_COMMON_H_ 105 #endif // MOJO_PUBLIC_PYTHON_SRC_COMMON_H_
103 106
OLDNEW
« no previous file with comments | « mojo/public/python/rules.gni ('k') | mojo/public/python/src/common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698