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

Side by Side Diff: chrome/renderer/render_thread.cc

Issue 42680: Add more of the server-side plumbing for extension APIs. Also (Closed)
Patch Set: Introduce SyncExtensionFunction Created 11 years, 8 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/renderer/render_thread.h" 5 #include "chrome/renderer/render_thread.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 DCHECK(base::SharedMemory::IsHandleValid(table)) << "Bad table handle"; 140 DCHECK(base::SharedMemory::IsHandleValid(table)) << "Bad table handle";
141 visited_link_slave_->Init(table); 141 visited_link_slave_->Init(table);
142 } 142 }
143 143
144 void RenderThread::OnUpdateUserScripts( 144 void RenderThread::OnUpdateUserScripts(
145 base::SharedMemoryHandle scripts) { 145 base::SharedMemoryHandle scripts) {
146 DCHECK(base::SharedMemory::IsHandleValid(scripts)) << "Bad scripts handle"; 146 DCHECK(base::SharedMemory::IsHandleValid(scripts)) << "Bad scripts handle";
147 user_script_slave_->UpdateScripts(scripts); 147 user_script_slave_->UpdateScripts(scripts);
148 } 148 }
149 149
150 void RenderThread::OnSetExtensionFunctionNames(
151 const std::vector<std::string>& names) {
152 extensions_v8::ExtensionProcessBindings::SetFunctionNames(names);
153 }
154
150 void RenderThread::OnControlMessageReceived(const IPC::Message& msg) { 155 void RenderThread::OnControlMessageReceived(const IPC::Message& msg) {
151 IPC_BEGIN_MESSAGE_MAP(RenderThread, msg) 156 IPC_BEGIN_MESSAGE_MAP(RenderThread, msg)
152 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_NewTable, OnUpdateVisitedLinks) 157 IPC_MESSAGE_HANDLER(ViewMsg_VisitedLink_NewTable, OnUpdateVisitedLinks)
153 IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID) 158 IPC_MESSAGE_HANDLER(ViewMsg_SetNextPageID, OnSetNextPageID)
154 // TODO(port): removed from render_messages_internal.h; 159 // TODO(port): removed from render_messages_internal.h;
155 // is there a new non-windows message I should add here? 160 // is there a new non-windows message I should add here?
156 IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView) 161 IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView)
157 IPC_MESSAGE_HANDLER(ViewMsg_SetCacheCapacities, OnSetCacheCapacities) 162 IPC_MESSAGE_HANDLER(ViewMsg_SetCacheCapacities, OnSetCacheCapacities)
158 IPC_MESSAGE_HANDLER(ViewMsg_GetRendererHistograms, 163 IPC_MESSAGE_HANDLER(ViewMsg_GetRendererHistograms,
159 OnGetRendererHistograms) 164 OnGetRendererHistograms)
160 IPC_MESSAGE_HANDLER(ViewMsg_GetCacheResourceStats, 165 IPC_MESSAGE_HANDLER(ViewMsg_GetCacheResourceStats,
161 OnGetCacheResourceStats) 166 OnGetCacheResourceStats)
162 IPC_MESSAGE_HANDLER(ViewMsg_UserScripts_NewScripts, 167 IPC_MESSAGE_HANDLER(ViewMsg_UserScripts_NewScripts,
163 OnUpdateUserScripts) 168 OnUpdateUserScripts)
169 IPC_MESSAGE_HANDLER(ViewMsg_Extension_SetFunctionNames,
170 OnSetExtensionFunctionNames)
164 IPC_END_MESSAGE_MAP() 171 IPC_END_MESSAGE_MAP()
165 } 172 }
166 173
167 void RenderThread::OnSetNextPageID(int32 next_page_id) { 174 void RenderThread::OnSetNextPageID(int32 next_page_id) {
168 // This should only be called at process initialization time, so we shouldn't 175 // This should only be called at process initialization time, so we shouldn't
169 // have to worry about thread-safety. 176 // have to worry about thread-safety.
170 // TODO(port) 177 // TODO(port)
171 #if !defined(OS_LINUX) 178 #if !defined(OS_LINUX)
172 RenderView::SetNextPageID(next_page_id); 179 RenderView::SetNextPageID(next_page_id);
173 #endif 180 #endif
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 264 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
258 if (command_line.HasSwitch(switches::kPlaybackMode) || 265 if (command_line.HasSwitch(switches::kPlaybackMode) ||
259 command_line.HasSwitch(switches::kRecordMode)) { 266 command_line.HasSwitch(switches::kRecordMode)) {
260 WebKit::registerExtension(extensions_v8::PlaybackExtension::Get()); 267 WebKit::registerExtension(extensions_v8::PlaybackExtension::Get());
261 } 268 }
262 269
263 if (command_line.HasSwitch(switches::kEnableWebWorkers)) { 270 if (command_line.HasSwitch(switches::kEnableWebWorkers)) {
264 WebKit::enableWebWorkers(); 271 WebKit::enableWebWorkers();
265 } 272 }
266 } 273 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_thread.h ('k') | chrome/renderer/resources/extension_process_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698