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

Side by Side Diff: webkit/compositor_bindings/web_compositor_impl.cc

Issue 11344004: Remove WebKit::Platform dependencies from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix webkit_compositor_bindings_unittests Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "config.h" 5 #include "config.h"
6 6
7 #include "web_compositor_impl.h" 7 #include "web_compositor_impl.h"
8 8
9 #ifdef LOG 9 #ifdef LOG
10 #undef LOG 10 #undef LOG
11 #endif 11 #endif
12 #include "base/message_loop_proxy.h" 12 #include "base/message_loop_proxy.h"
13 #include "cc/layer_tree_host.h" 13 #include "cc/layer_tree_host.h"
14 #include "cc/proxy.h" 14 #include "cc/proxy.h"
15 #include "cc/settings.h" 15 #include "cc/settings.h"
16 #include "ccthread_impl.h" 16 #include "cc/thread_impl.h"
17 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" 17 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h"
18 #include "webkit/glue/webthread_impl.h" 18 #include "webkit/glue/webthread_impl.h"
19 19
20 using namespace cc; 20 using namespace cc;
21 21
22 namespace WebKit { 22 namespace WebKit {
23 23
24 bool WebCompositorImpl::s_initialized = false; 24 bool WebCompositorImpl::s_initialized = false;
25 Thread* WebCompositorImpl::s_mainThread = 0; 25 Thread* WebCompositorImpl::s_mainThread = 0;
26 Thread* WebCompositorImpl::s_implThread = 0; 26 Thread* WebCompositorImpl::s_implThread = 0;
(...skipping 11 matching lines...) Expand all
38 void WebCompositor::shutdown() 38 void WebCompositor::shutdown()
39 { 39 {
40 WebCompositorImpl::shutdown(); 40 WebCompositorImpl::shutdown();
41 } 41 }
42 42
43 void WebCompositorImpl::initialize(WebThread* implThread) 43 void WebCompositorImpl::initialize(WebThread* implThread)
44 { 44 {
45 ASSERT(!s_initialized); 45 ASSERT(!s_initialized);
46 s_initialized = true; 46 s_initialized = true;
47 47
48 s_mainThread = CCThreadImpl::createForCurrentThread().release(); 48 s_mainThread = cc::ThreadImpl::createForCurrentThread().release();
49 Proxy::setMainThread(s_mainThread); 49 Proxy::setMainThread(s_mainThread);
50 if (implThread) { 50 if (implThread) {
51 s_implThread = CCThreadImpl::createForDifferentThread(implThread).releas e(); 51 webkit_glue::WebThreadImpl* webThreadImpl = static_cast<webkit_glue::Web ThreadImpl*>(implThread);
52 MessageLoop* implMessageLoop = webThreadImpl->message_loop();
53 s_implThread = cc::ThreadImpl::createForDifferentThread(implMessageLoop- >message_loop_proxy()).release();
52 Proxy::setImplThread(s_implThread); 54 Proxy::setImplThread(s_implThread);
53 } else 55 } else
54 Proxy::setImplThread(0); 56 Proxy::setImplThread(0);
55 } 57 }
56 58
57 bool WebCompositorImpl::isThreadingEnabled() 59 bool WebCompositorImpl::isThreadingEnabled()
58 { 60 {
59 return s_implThread; 61 return s_implThread;
60 } 62 }
61 63
(...skipping 12 matching lines...) Expand all
74 s_implThread = 0; 76 s_implThread = 0;
75 } 77 }
76 delete s_mainThread; 78 delete s_mainThread;
77 s_mainThread = 0; 79 s_mainThread = 0;
78 Proxy::setImplThread(0); 80 Proxy::setImplThread(0);
79 Proxy::setMainThread(0); 81 Proxy::setMainThread(0);
80 s_initialized = false; 82 s_initialized = false;
81 } 83 }
82 84
83 } 85 }
OLDNEW
« no previous file with comments | « webkit/compositor_bindings/test/run_all_unittests.cc ('k') | webkit/compositor_bindings/web_layer_tree_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698