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

Side by Side Diff: mojo/public/cpp/bindings/sync_call_restrictions.h

Issue 2448983003: gpu: Refactor memory buffer handling code out of content.
Patch Set: . Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_CPP_BINDINGS_SYNC_CALL_RESTRICTIONS_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_SYNC_CALL_RESTRICTIONS_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_SYNC_CALL_RESTRICTIONS_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_SYNC_CALL_RESTRICTIONS_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/threading/thread_restrictions.h" 9 #include "base/threading/thread_restrictions.h"
10 #include "mojo/public/cpp/bindings/bindings_export.h" 10 #include "mojo/public/cpp/bindings/bindings_export.h"
11 11
12 #if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) 12 #if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON))
13 #define ENABLE_SYNC_CALL_RESTRICTIONS 1 13 #define ENABLE_SYNC_CALL_RESTRICTIONS 1
14 #else 14 #else
15 #define ENABLE_SYNC_CALL_RESTRICTIONS 0 15 #define ENABLE_SYNC_CALL_RESTRICTIONS 0
16 #endif 16 #endif
17 17
18 namespace ui { 18 namespace ui {
19 class GpuService; 19 class GpuService;
20 class MojoGpuMemoryBufferManager;
20 } 21 }
21 22
22 namespace views { 23 namespace views {
23 class ClipboardMus; 24 class ClipboardMus;
24 } 25 }
25 26
26 namespace mojo { 27 namespace mojo {
27 28
28 // In some processes, sync calls are disallowed. For example, in the browser 29 // In some processes, sync calls are disallowed. For example, in the browser
29 // process we don't want any sync calls to child processes for performance, 30 // process we don't want any sync calls to child processes for performance,
(...skipping 15 matching lines...) Expand all
45 static void AssertSyncCallAllowed(); 46 static void AssertSyncCallAllowed();
46 #else 47 #else
47 // Inline the empty definitions of functions so that they can be compiled out. 48 // Inline the empty definitions of functions so that they can be compiled out.
48 static void AssertSyncCallAllowed() {} 49 static void AssertSyncCallAllowed() {}
49 #endif 50 #endif
50 51
51 private: 52 private:
52 // DO NOT ADD ANY OTHER FRIEND STATEMENTS, talk to mojo/OWNERS first. 53 // DO NOT ADD ANY OTHER FRIEND STATEMENTS, talk to mojo/OWNERS first.
53 // BEGIN ALLOWED USAGE. 54 // BEGIN ALLOWED USAGE.
54 friend class ui::GpuService; // http://crbug.com/620058 55 friend class ui::GpuService; // http://crbug.com/620058
56 friend class ui::MojoGpuMemoryBufferManager;
55 // END ALLOWED USAGE. 57 // END ALLOWED USAGE.
56 58
57 // BEGIN USAGE THAT NEEDS TO BE FIXED. 59 // BEGIN USAGE THAT NEEDS TO BE FIXED.
58 // In the non-mus case, we called blocking OS functions in the ui::Clipboard 60 // In the non-mus case, we called blocking OS functions in the ui::Clipboard
59 // implementation which weren't caught by sync call restrictions. Our blocking 61 // implementation which weren't caught by sync call restrictions. Our blocking
60 // calls to mus, however, are. 62 // calls to mus, however, are.
61 friend class views::ClipboardMus; 63 friend class views::ClipboardMus;
62 // END USAGE THAT NEEDS TO BE FIXED. 64 // END USAGE THAT NEEDS TO BE FIXED.
63 65
64 #if ENABLE_SYNC_CALL_RESTRICTIONS 66 #if ENABLE_SYNC_CALL_RESTRICTIONS
(...skipping 21 matching lines...) Expand all
86 88
87 DISALLOW_COPY_AND_ASSIGN(ScopedAllowSyncCall); 89 DISALLOW_COPY_AND_ASSIGN(ScopedAllowSyncCall);
88 }; 90 };
89 91
90 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncCallRestrictions); 92 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncCallRestrictions);
91 }; 93 };
92 94
93 } // namespace mojo 95 } // namespace mojo
94 96
95 #endif // MOJO_PUBLIC_CPP_BINDINGS_SYNC_CALL_RESTRICTIONS_H_ 97 #endif // MOJO_PUBLIC_CPP_BINDINGS_SYNC_CALL_RESTRICTIONS_H_
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.cc ('k') | services/ui/public/cpp/gpu_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698