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

Side by Side Diff: ppapi/cpp/private/flash_message_loop.cc

Issue 9381010: Convert resources to take an instance key instead of an Instance*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USELESS PATCH TITLE Created 8 years, 9 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
« no previous file with comments | « ppapi/cpp/private/flash_message_loop.h ('k') | ppapi/cpp/private/flash_net_connector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/cpp/private/flash_message_loop.h" 5 #include "ppapi/cpp/private/flash_message_loop.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/private/ppb_flash_message_loop.h" 8 #include "ppapi/c/private/ppb_flash_message_loop.h"
9 #include "ppapi/cpp/instance.h" 9 #include "ppapi/cpp/instance_handle.h"
10 #include "ppapi/cpp/module_impl.h" 10 #include "ppapi/cpp/module_impl.h"
11 11
12 namespace pp { 12 namespace pp {
13 13
14 namespace { 14 namespace {
15 15
16 template <> const char* interface_name<PPB_Flash_MessageLoop>() { 16 template <> const char* interface_name<PPB_Flash_MessageLoop>() {
17 return PPB_FLASH_MESSAGELOOP_INTERFACE; 17 return PPB_FLASH_MESSAGELOOP_INTERFACE;
18 } 18 }
19 19
20 } // namespace 20 } // namespace
21 21
22 namespace flash { 22 namespace flash {
23 23
24 MessageLoop::MessageLoop(Instance* instance) { 24 MessageLoop::MessageLoop(const InstanceHandle& instance) {
25 if (has_interface<PPB_Flash_MessageLoop>()) { 25 if (has_interface<PPB_Flash_MessageLoop>()) {
26 PassRefFromConstructor(get_interface<PPB_Flash_MessageLoop>()->Create( 26 PassRefFromConstructor(get_interface<PPB_Flash_MessageLoop>()->Create(
27 instance->pp_instance())); 27 instance.pp_instance()));
28 } 28 }
29 } 29 }
30 30
31 MessageLoop::~MessageLoop() { 31 MessageLoop::~MessageLoop() {
32 } 32 }
33 33
34 // static 34 // static
35 bool MessageLoop::IsAvailable() { 35 bool MessageLoop::IsAvailable() {
36 return has_interface<PPB_Flash_MessageLoop>(); 36 return has_interface<PPB_Flash_MessageLoop>();
37 } 37 }
38 38
39 int32_t MessageLoop::Run() { 39 int32_t MessageLoop::Run() {
40 if (!has_interface<PPB_Flash_MessageLoop>()) 40 if (!has_interface<PPB_Flash_MessageLoop>())
41 return PP_ERROR_NOINTERFACE; 41 return PP_ERROR_NOINTERFACE;
42 return get_interface<PPB_Flash_MessageLoop>()->Run(pp_resource()); 42 return get_interface<PPB_Flash_MessageLoop>()->Run(pp_resource());
43 } 43 }
44 44
45 void MessageLoop::Quit() { 45 void MessageLoop::Quit() {
46 if (has_interface<PPB_Flash_MessageLoop>()) 46 if (has_interface<PPB_Flash_MessageLoop>())
47 get_interface<PPB_Flash_MessageLoop>()->Quit(pp_resource()); 47 get_interface<PPB_Flash_MessageLoop>()->Quit(pp_resource());
48 } 48 }
49 49
50 } // namespace flash 50 } // namespace flash
51 } // namespace pp 51 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/private/flash_message_loop.h ('k') | ppapi/cpp/private/flash_net_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698