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

Side by Side Diff: ppapi/cpp/dev/message_loop_dev.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/dev/message_loop_dev.h ('k') | ppapi/cpp/dev/printing_dev.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/dev/message_loop_dev.h" 5 #include "ppapi/cpp/dev/message_loop_dev.h"
6 6
7 #include "ppapi/c/dev/ppb_message_loop_dev.h" 7 #include "ppapi/c/dev/ppb_message_loop_dev.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/cpp/completion_callback.h" 9 #include "ppapi/cpp/completion_callback.h"
10 #include "ppapi/cpp/instance.h" 10 #include "ppapi/cpp/instance_handle.h"
11 #include "ppapi/cpp/module_impl.h" 11 #include "ppapi/cpp/module_impl.h"
12 12
13 namespace pp { 13 namespace pp {
14 14
15 namespace { 15 namespace {
16 16
17 template <> const char* interface_name<PPB_MessageLoop_Dev>() { 17 template <> const char* interface_name<PPB_MessageLoop_Dev>() {
18 return PPB_MESSAGELOOP_DEV_INTERFACE_0_1; 18 return PPB_MESSAGELOOP_DEV_INTERFACE_0_1;
19 } 19 }
20 20
21 } // namespace 21 } // namespace
22 22
23 MessageLoop_Dev::MessageLoop_Dev() : Resource() { 23 MessageLoop_Dev::MessageLoop_Dev() : Resource() {
24 } 24 }
25 25
26 MessageLoop_Dev::MessageLoop_Dev(Instance* instance) : Resource() { 26 MessageLoop_Dev::MessageLoop_Dev(const InstanceHandle& instance) : Resource() {
27 if (has_interface<PPB_MessageLoop_Dev>()) { 27 if (has_interface<PPB_MessageLoop_Dev>()) {
28 PassRefFromConstructor(get_interface<PPB_MessageLoop_Dev>()->Create( 28 PassRefFromConstructor(get_interface<PPB_MessageLoop_Dev>()->Create(
29 instance->pp_instance())); 29 instance.pp_instance()));
30 } 30 }
31 } 31 }
32 32
33 MessageLoop_Dev::MessageLoop_Dev(const MessageLoop_Dev& other) 33 MessageLoop_Dev::MessageLoop_Dev(const MessageLoop_Dev& other)
34 : Resource(other) { 34 : Resource(other) {
35 } 35 }
36 36
37 MessageLoop_Dev::MessageLoop_Dev(PP_Resource pp_message_loop) 37 MessageLoop_Dev::MessageLoop_Dev(PP_Resource pp_message_loop)
38 : Resource(pp_message_loop) { 38 : Resource(pp_message_loop) {
39 } 39 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 79
80 int32_t MessageLoop_Dev::PostQuit(bool should_destroy) { 80 int32_t MessageLoop_Dev::PostQuit(bool should_destroy) {
81 if (!has_interface<PPB_MessageLoop_Dev>()) 81 if (!has_interface<PPB_MessageLoop_Dev>())
82 return PP_ERROR_NOINTERFACE; 82 return PP_ERROR_NOINTERFACE;
83 return get_interface<PPB_MessageLoop_Dev>()->PostQuit( 83 return get_interface<PPB_MessageLoop_Dev>()->PostQuit(
84 pp_resource(), PP_FromBool(should_destroy)); 84 pp_resource(), PP_FromBool(should_destroy));
85 } 85 }
86 86
87 } // namespace pp 87 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/dev/message_loop_dev.h ('k') | ppapi/cpp/dev/printing_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698