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

Side by Side Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 13080002: Apps V2 in Pepper: introduce singleton resource ExtensionsCommon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ppapi/proxy/ppb_instance_proxy.h" 5 #include "ppapi/proxy/ppb_instance_proxy.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/pp_time.h" 10 #include "ppapi/c/pp_time.h"
11 #include "ppapi/c/pp_var.h" 11 #include "ppapi/c/pp_var.h"
12 #include "ppapi/c/ppb_audio_config.h" 12 #include "ppapi/c/ppb_audio_config.h"
13 #include "ppapi/c/ppb_instance.h" 13 #include "ppapi/c/ppb_instance.h"
14 #include "ppapi/c/ppb_messaging.h" 14 #include "ppapi/c/ppb_messaging.h"
15 #include "ppapi/c/ppb_mouse_lock.h" 15 #include "ppapi/c/ppb_mouse_lock.h"
16 #include "ppapi/c/private/pp_content_decryptor.h" 16 #include "ppapi/c/private/pp_content_decryptor.h"
17 #include "ppapi/proxy/broker_resource.h" 17 #include "ppapi/proxy/broker_resource.h"
18 #include "ppapi/proxy/browser_font_singleton_resource.h" 18 #include "ppapi/proxy/browser_font_singleton_resource.h"
19 #include "ppapi/proxy/content_decryptor_private_serializer.h" 19 #include "ppapi/proxy/content_decryptor_private_serializer.h"
20 #include "ppapi/proxy/enter_proxy.h" 20 #include "ppapi/proxy/enter_proxy.h"
21 #include "ppapi/proxy/extensions_common_resource.h"
21 #include "ppapi/proxy/flash_clipboard_resource.h" 22 #include "ppapi/proxy/flash_clipboard_resource.h"
22 #include "ppapi/proxy/flash_file_resource.h" 23 #include "ppapi/proxy/flash_file_resource.h"
23 #include "ppapi/proxy/flash_fullscreen_resource.h" 24 #include "ppapi/proxy/flash_fullscreen_resource.h"
24 #include "ppapi/proxy/flash_resource.h" 25 #include "ppapi/proxy/flash_resource.h"
25 #include "ppapi/proxy/gamepad_resource.h" 26 #include "ppapi/proxy/gamepad_resource.h"
26 #include "ppapi/proxy/host_dispatcher.h" 27 #include "ppapi/proxy/host_dispatcher.h"
27 #include "ppapi/proxy/plugin_dispatcher.h" 28 #include "ppapi/proxy/plugin_dispatcher.h"
28 #include "ppapi/proxy/ppapi_messages.h" 29 #include "ppapi/proxy/ppapi_messages.h"
29 #include "ppapi/proxy/serialized_var.h" 30 #include "ppapi/proxy/serialized_var.h"
30 #include "ppapi/proxy/truetype_font_singleton_resource.h" 31 #include "ppapi/proxy/truetype_font_singleton_resource.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 if (it != data->singleton_resources.end()) 349 if (it != data->singleton_resources.end())
349 return it->second.get(); 350 return it->second.get();
350 351
351 scoped_refptr<Resource> new_singleton; 352 scoped_refptr<Resource> new_singleton;
352 Connection connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher()); 353 Connection connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher());
353 354
354 switch (id) { 355 switch (id) {
355 case BROKER_SINGLETON_ID: 356 case BROKER_SINGLETON_ID:
356 new_singleton = new BrokerResource(connection, instance); 357 new_singleton = new BrokerResource(connection, instance);
357 break; 358 break;
359 case EXTENSIONS_COMMON_SINGLETON_ID:
360 new_singleton = new ExtensionsCommonResource(connection, instance);
361 break;
358 case GAMEPAD_SINGLETON_ID: 362 case GAMEPAD_SINGLETON_ID:
359 new_singleton = new GamepadResource(connection, instance); 363 new_singleton = new GamepadResource(connection, instance);
360 break; 364 break;
361 case TRUETYPE_FONT_SINGLETON_ID: 365 case TRUETYPE_FONT_SINGLETON_ID:
362 new_singleton = new TrueTypeFontSingletonResource(connection, instance); 366 new_singleton = new TrueTypeFontSingletonResource(connection, instance);
363 break; 367 break;
364 // Flash/trusted resources aren't needed for NaCl. 368 // Flash/trusted resources aren't needed for NaCl.
365 #if !defined(OS_NACL) && !defined(NACL_WIN64) 369 #if !defined(OS_NACL) && !defined(NACL_WIN64)
366 case BROWSER_FONT_SINGLETON_ID: 370 case BROWSER_FONT_SINGLETON_ID:
367 new_singleton = new BrowserFontSingletonResource(connection, instance); 371 new_singleton = new BrowserFontSingletonResource(connection, instance);
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 PP_Instance instance) { 1241 PP_Instance instance) {
1238 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 1242 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
1239 GetInstanceData(instance); 1243 GetInstanceData(instance);
1240 if (!data) 1244 if (!data)
1241 return; // Instance was probably deleted. 1245 return; // Instance was probably deleted.
1242 data->should_do_request_surrounding_text = false; 1246 data->should_do_request_surrounding_text = false;
1243 } 1247 }
1244 1248
1245 } // namespace proxy 1249 } // namespace proxy
1246 } // namespace ppapi 1250 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698