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

Side by Side Diff: content/utility/utility_thread_impl.cc

Issue 8602002: Move some webkit_glue embedder functions into WebKitPlatformSupport virtual methods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright year Created 9 years 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/utility/utility_thread_impl.h" 5 #include "content/utility/utility_thread_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
11 #include "content/common/child_process.h" 11 #include "content/common/child_process.h"
12 #include "content/common/child_process_messages.h" 12 #include "content/common/child_process_messages.h"
13 #include "content/common/indexed_db_key.h" 13 #include "content/common/indexed_db_key.h"
14 #include "content/common/utility_messages.h" 14 #include "content/common/utility_messages.h"
15 #include "content/common/webkitplatformsupport_impl.h"
15 #include "content/public/utility/content_utility_client.h" 16 #include "content/public/utility/content_utility_client.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa lue.h" 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa lue.h"
19 #include "webkit/glue/idb_bindings.h" 20 #include "webkit/glue/idb_bindings.h"
20 #include "webkit/glue/webkitplatformsupport_impl.h"
21 #include "webkit/plugins/npapi/plugin_list.h" 21 #include "webkit/plugins/npapi/plugin_list.h"
22 22
23 namespace { 23 namespace {
24 24
25 template<typename SRC, typename DEST> 25 template<typename SRC, typename DEST>
26 void ConvertVector(const SRC& src, DEST* dest) { 26 void ConvertVector(const SRC& src, DEST* dest) {
27 dest->reserve(src.size()); 27 dest->reserve(src.size());
28 for (typename SRC::const_iterator i = src.begin(); i != src.end(); ++i) 28 for (typename SRC::const_iterator i = src.begin(); i != src.end(); ++i)
29 dest->push_back(typename DEST::value_type(*i)); 29 dest->push_back(typename DEST::value_type(*i));
30 } 30 }
31 31
32 } // namespace 32 } // namespace
33 33
34 UtilityThreadImpl::UtilityThreadImpl() 34 UtilityThreadImpl::UtilityThreadImpl()
35 : batch_mode_(false) { 35 : batch_mode_(false) {
36 ChildProcess::current()->AddRefProcess(); 36 ChildProcess::current()->AddRefProcess();
37 webkit_platform_support_.reset(new webkit_glue::WebKitPlatformSupportImpl); 37 webkit_platform_support_.reset(new content::WebKitPlatformSupportImpl);
38 WebKit::initialize(webkit_platform_support_.get()); 38 WebKit::initialize(webkit_platform_support_.get());
39 content::GetContentClient()->utility()->UtilityThreadStarted(); 39 content::GetContentClient()->utility()->UtilityThreadStarted();
40 } 40 }
41 41
42 UtilityThreadImpl::~UtilityThreadImpl() { 42 UtilityThreadImpl::~UtilityThreadImpl() {
43 WebKit::shutdown(); 43 WebKit::shutdown();
44 } 44 }
45 45
46 bool UtilityThreadImpl::Send(IPC::Message* msg) { 46 bool UtilityThreadImpl::Send(IPC::Message* msg) {
47 return ChildThread::Send(msg); 47 return ChildThread::Send(msg);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 const webkit::npapi::PluginGroup* group = plugin_groups[0]; 139 const webkit::npapi::PluginGroup* group = plugin_groups[0];
140 DCHECK_EQ(group->web_plugin_infos().size(), 1u); 140 DCHECK_EQ(group->web_plugin_infos().size(), 1u);
141 141
142 Send(new UtilityHostMsg_LoadedPlugin(i, group->web_plugin_infos().front())); 142 Send(new UtilityHostMsg_LoadedPlugin(i, group->web_plugin_infos().front()));
143 } 143 }
144 144
145 ReleaseProcessIfNeeded(); 145 ReleaseProcessIfNeeded();
146 } 146 }
147 #endif 147 #endif
148 148
OLDNEW
« no previous file with comments | « content/utility/utility_thread_impl.h ('k') | content/worker/worker_webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698