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

Side by Side Diff: ppapi/cpp/dev/transport_dev.cc

Issue 7713021: Add SetProperty() in the PPB_Transport_Dev interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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) 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 "ppapi/cpp/dev/transport_dev.h" 5 #include "ppapi/cpp/dev/transport_dev.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/cpp/instance.h" 8 #include "ppapi/cpp/instance.h"
9 #include "ppapi/cpp/resource.h" 9 #include "ppapi/cpp/resource.h"
10 #include "ppapi/cpp/module.h" 10 #include "ppapi/cpp/module.h"
(...skipping 18 matching lines...) Expand all
29 instance->pp_instance(), name, proto)); 29 instance->pp_instance(), name, proto));
30 } 30 }
31 31
32 bool Transport_Dev::IsWritable() { 32 bool Transport_Dev::IsWritable() {
33 if (!has_interface<PPB_Transport_Dev>()) 33 if (!has_interface<PPB_Transport_Dev>())
34 return false; 34 return false;
35 return PP_ToBool( 35 return PP_ToBool(
36 get_interface<PPB_Transport_Dev>()->IsWritable(pp_resource())); 36 get_interface<PPB_Transport_Dev>()->IsWritable(pp_resource()));
37 } 37 }
38 38
39 int32_t Transport_Dev::SetConfig(const char* config) {
40 if (!has_interface<PPB_Transport_Dev>())
41 return PP_ERROR_NOINTERFACE;
42 return get_interface<PPB_Transport_Dev>()->SetConfig(
43 pp_resource(), config);
44 }
45
39 int32_t Transport_Dev::Connect(const CompletionCallback& cc) { 46 int32_t Transport_Dev::Connect(const CompletionCallback& cc) {
40 if (!has_interface<PPB_Transport_Dev>()) 47 if (!has_interface<PPB_Transport_Dev>())
41 return cc.MayForce(PP_ERROR_NOINTERFACE); 48 return cc.MayForce(PP_ERROR_NOINTERFACE);
42 return get_interface<PPB_Transport_Dev>()->Connect( 49 return get_interface<PPB_Transport_Dev>()->Connect(
43 pp_resource(), cc.pp_completion_callback()); 50 pp_resource(), cc.pp_completion_callback());
44 } 51 }
45 52
46 int32_t Transport_Dev::GetNextAddress(Var* address, 53 int32_t Transport_Dev::GetNextAddress(Var* address,
47 const CompletionCallback& cc) { 54 const CompletionCallback& cc) {
48 if (!has_interface<PPB_Transport_Dev>()) 55 if (!has_interface<PPB_Transport_Dev>())
(...skipping 28 matching lines...) Expand all
77 pp_resource(), data, len, cc.pp_completion_callback()); 84 pp_resource(), data, len, cc.pp_completion_callback());
78 } 85 }
79 86
80 int32_t Transport_Dev::Close() { 87 int32_t Transport_Dev::Close() {
81 if (!has_interface<PPB_Transport_Dev>()) 88 if (!has_interface<PPB_Transport_Dev>())
82 return PP_ERROR_NOINTERFACE; 89 return PP_ERROR_NOINTERFACE;
83 return get_interface<PPB_Transport_Dev>()->Close(pp_resource()); 90 return get_interface<PPB_Transport_Dev>()->Close(pp_resource());
84 } 91 }
85 92
86 } // namespace pp 93 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698