OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/browser/android/in_process/synchronous_compositor_impl.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 it.Advance(); | 38 it.Advance(); |
39 DCHECK(it.IsAtEnd()); // Not multiprocess compatible. | 39 DCHECK(it.IsAtEnd()); // Not multiprocess compatible. |
40 return id; | 40 return id; |
41 } | 41 } |
42 | 42 |
43 base::LazyInstance<SynchronousCompositorFactoryImpl>::Leaky g_factory = | 43 base::LazyInstance<SynchronousCompositorFactoryImpl>::Leaky g_factory = |
44 LAZY_INSTANCE_INITIALIZER; | 44 LAZY_INSTANCE_INITIALIZER; |
45 | 45 |
46 } // namespace | 46 } // namespace |
47 | 47 |
| 48 SynchronousCompositor::ContextHolder::ContextHolder() : context(nullptr) { |
| 49 } |
| 50 |
| 51 SynchronousCompositor::ContextHolder::~ContextHolder() { |
| 52 } |
| 53 |
48 DEFINE_WEB_CONTENTS_USER_DATA_KEY(SynchronousCompositorImpl); | 54 DEFINE_WEB_CONTENTS_USER_DATA_KEY(SynchronousCompositorImpl); |
49 | 55 |
50 // static | 56 // static |
51 SynchronousCompositorImpl* SynchronousCompositorImpl::FromID(int process_id, | 57 SynchronousCompositorImpl* SynchronousCompositorImpl::FromID(int process_id, |
52 int routing_id) { | 58 int routing_id) { |
53 if (g_factory == NULL) | 59 if (g_factory == NULL) |
54 return NULL; | 60 return NULL; |
55 RenderViewHost* rvh = RenderViewHost::FromID(process_id, routing_id); | 61 RenderViewHost* rvh = RenderViewHost::FromID(process_id, routing_id); |
56 if (!rvh) | 62 if (!rvh) |
57 return NULL; | 63 return NULL; |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 g_factory.Get(); // Ensure it's initialized. | 374 g_factory.Get(); // Ensure it's initialized. |
369 SynchronousCompositorImpl::CreateForWebContents(contents); | 375 SynchronousCompositorImpl::CreateForWebContents(contents); |
370 } | 376 } |
371 SynchronousCompositorImpl* instance = | 377 SynchronousCompositorImpl* instance = |
372 SynchronousCompositorImpl::FromWebContents(contents); | 378 SynchronousCompositorImpl::FromWebContents(contents); |
373 DCHECK(instance); | 379 DCHECK(instance); |
374 instance->SetClient(client); | 380 instance->SetClient(client); |
375 } | 381 } |
376 | 382 |
377 } // namespace content | 383 } // namespace content |
OLD | NEW |